yolo

claude_code 0 companion files
← Back

SKILL.md

---
name: yolo
description: Skill that spawns Claude Code in tmux sessions for autonomous development tasks. Use when user mentions 'yolo mode', 'yolo work', 'in background', 'autonomous task' or similar. Observable via tmux attach.
allowed-tools: Bash, Write, Read, Edit, Grep, Glob, Task, WebSearch, WebFetch, Skill, SlashCommand, mcp__jina__*, Bash(gh:*), Bash(tmux:*)
---

# YOLO Mode - Tmux-Based Autonomous Execution

Spawn full Claude Code sessions in tmux panes/windows for observable, autonomous
work.

## Key Behavior (from experience)

**Claude Code requires manual Enter press** - `C-m` doesn't auto-execute. This
is by design for safety. The workflow is:

1. Create tmux session/pane
2. Send `claude` command with `tmux send-keys`
3. User observes and presses Enter to start
4. Claude runs interactively in the pane

**No `--dangerously-skip-permissions` as root** - It doesn't work. Run full
interactive sessions instead where Claude asks for permissions normally.

## Quick Reference

```bash
# Create session and send claude command (user presses Enter)
tmux new-session -d -s yolo-task1 -c <directory>
tmux send-keys -t yolo-task1 'claude' C-m

# With initial prompt ready (user still presses Enter to start)
tmux new-session -d -s yolo-task1 -c <directory>
tmux send-keys -t yolo-task1 'claude'
# User attaches, presses Enter, then types/pastes task

# Observe session
tmux attach -t yolo-task1

# Split pane approach (side-by-side observation)
tmux split-window -h -c <directory>
tmux send-keys -t 1 'claude' C-m

# Capture output (non-blocking check)
tmux capture-pane -t yolo-task1 -p

# List all YOLO sessions
tmux list-sessions | grep yolo

# Kill session
tmux kill-session -t yolo-task1
```

## Execution Instructions

When the user invokes this skill:

### 1. Gather Requirements

Ask if not provided:

- **Task**: What Claude should accomplish
- **Directory**: Project path (default: current working directory)
- **Parallel**: Single task or multiple parallel tasks?

### 2. Create Worktree (for parallel tasks)

For parallel execution, use git worktrees to isolate each task:

```bash
# Create worktrees first
/tree feat/task-1,feat/task-2,feat/task-3
```

### 3. Spawn YOLO Session

#### Single Task - New Window

```bash
# Create session in project directory
tmux new-session -d -s yolo-<task-id> -c <directory>

# Send claude command (user will press Enter to start)
tmux send-keys -t yolo-<task-id> 'claude' C-m
```

#### Single Task - Split Pane (observable alongside current work)

```bash
# Split current window horizontally
tmux split-window -h -c <directory>

# Send claude to the new pane (pane 1)
tmux send-keys -t 1 'claude' C-m
```

#### Parallel Tasks with Worktrees

Each task runs in its own tmux session with its own worktree:

```bash
# Task 1 in worktree 1
tmux new-session -d -s yolo-task1 -c ~/project/trees/feat/task-1
tmux send-keys -t yolo-task1 'claude' C-m

# Task 2 in worktree 2
tmux new-session -d -s yolo-task2 -c ~/project/trees/feat/task-2
tmux send-keys -t yolo-task2 'claude' C-m

# Task 3 in worktree 3
tmux new-session -d -s yolo-task3 -c ~/project/trees/feat/task-3
tmux send-keys -t yolo-task3 'claude' C-m
```

### 4. User Interaction Flow

After spawning, tell the user:

```
## YOLO Session Ready

Session `yolo-task1` created in <directory>

**Next steps:**
1. Attach: `tmux attach -t yolo-task1`
2. Press Enter to start Claude
3. Type or paste your task
4. Detach anytime: `Ctrl+b d`

**Navigation:**
- Switch panes: `Ctrl+b` then arrow keys
- Switch sessions: `Ctrl+b s`
- Detach: `Ctrl+b d`
```

### 5. Monitor Progress

```bash
# List all YOLO sessions
tmux list-sessions | grep yolo

# Capture recent output from a session (last 100 lines)
tmux capture-pane -t yolo-task1 -p -S -100

# Check if session still exists
tmux has-session -t yolo-task1 2>/dev/null && echo "Running" || echo "Ended"
```

### 6. Report Status

```
## YOLO Sessions Status

| Session | Directory | Status |
|---------|-----------|--------|
| yolo-task1 | ~/project/trees/feat/task-1 | Running |
| yolo-task2 | ~/project/trees/feat/task-2 | Running |

## Commands
- Attach: `tmux attach -t yolo-task1`
- Capture: `tmux capture-pane -t yolo-task1 -p`
- Kill: `tmux kill-session -t yolo-task1`

## After Completion
- Merge worktrees: `/tree merge feat/task-1`
```

## Session Naming Convention

| Pattern | Use Case |
|---------|----------|
| `yolo-<ticket-id>` | GitHub issue (e.g., `yolo-42`) |
| `yolo-<feature>` | Feature name (e.g., `yolo-auth`) |
| `yolo-<timestamp>` | Ad-hoc tasks |

## Parallel Execution Guidelines

### Worktree Isolation (REQUIRED for parallel)

ALWAYS use git worktrees for parallel tasks to prevent git conflicts:

```bash
# Before spawning parallel sessions
/tree feat/task-1,feat/task-2,feat/task-3

# Each session works in its own worktree
# After completion, merge with
/tree merge feat/task-1
```

### Pane Layout for Observation

```bash
# Create 3-pane layout for parallel observation
tmux new-session -d -s yolo-parallel -c ~/project/trees/feat/task-1
tmux send-keys -t yolo-parallel 'claude' C-m

tmux split-window -h -c ~/project/trees/feat/task-2 -t yolo-parallel
tmux send-keys -t yolo-parallel:0.1 'claude' C-m

tmux split-window -v -c ~/project/trees/feat/task-3 -t yolo-parallel
tmux send-keys -t yolo-parallel:0.2 'claude' C-m

# Now attach to see all 3 panes
tmux attach -t yolo-parallel
```

## Tmux Cheatsheet

| Action | Keys |
|--------|------|
| Detach from session | `Ctrl+b d` |
| Switch panes | `Ctrl+b` + arrow |
| Switch sessions | `Ctrl+b s` |
| Scroll mode | `Ctrl+b [` |
| Exit scroll | `q` |
| Kill pane | `Ctrl+b x` |
| New window | `Ctrl+b c` |
| Next window | `Ctrl+b n` |

## Comparison with Docker YOLO

| Feature | Tmux YOLO | Docker YOLO |
|---------|-----------|-------------|
| Startup time | Instant | ~30s container spin-up |
| Memory overhead | None | ~500MB per container |
| Observable | `tmux attach` (live) | `docker logs` |
| Interaction | Full interactive | Prompt-only or interactive |
| Host isolation | None (runs on host) | Full isolation |
| Root user | Works (no skip-perms) | Works with skip-perms |

**When to use Docker YOLO instead**:
- Untrusted code execution
- Need network isolation
- Want `--dangerously-skip-permissions` safely

Docker YOLO archived at: `/root/.claude/skills/yolo-docker/`

## Troubleshooting

**Session won't start:**
```bash
# Check if session name already exists
tmux list-sessions | grep yolo-task1

# Kill existing and retry
tmux kill-session -t yolo-task1
```

**Claude doesn't start:**
- Remember: You must press Enter after attaching
- `C-m` in send-keys sends Enter but Claude Code ignores auto-sent Enter for safety

**Can't see output:**
```bash
# Capture last 200 lines
tmux capture-pane -t yolo-task1 -p -S -200
```

## Anti-Patterns

**DO NOT:**
- Run multiple tasks in same directory without worktrees (git conflicts)
- Expect `C-m` to auto-start Claude (it won't - by design)
- Use `--dangerously-skip-permissions` as root (doesn't work)
- Forget that user needs to interact to start

**DO:**
- Use worktrees for parallel execution
- Tell user to attach and press Enter
- Use `tmux capture-pane` for status checks
- Clean up sessions after completion

---

## Example Full Workflow

```bash
# 1. Create worktrees for parallel tasks
/tree feat/auth,feat/tests

# 2. Create multi-pane session
tmux new-session -d -s yolo-work -c ~/project/trees/feat/auth
tmux send-keys -t yolo-work 'claude' C-m

tmux split-window -h -c ~/project/trees/feat/tests -t yolo-work
tmux send-keys -t yolo-work:0.1 'claude' C-m

# 3. Tell user
echo "Attach with: tmux attach -t yolo-work"
echo "Press Enter in each pane to start Claude"
echo "Detach anytime with: Ctrl+b d"

# 4. After completion, merge
/tree merge feat/auth
/tree merge feat/tests

# 5. Cleanup
tmux kill-session -t yolo-work
```

No companion files

Add companion files to enhance this skill

Danger Zone

Deleting this skill will remove all associated files. This action cannot be undone.

Owner
Prasham Trivedi
Created
2/16/2026, 6:50:18 PM
Last Updated
2/16/2026, 6:50:18 PM
🆔 Skill ID
ifbSZoT93DJvi5dP_r4Oy