harness/plugins/subagents/claude/skills/tmux-subagent/SKILL.md
This skill should be used when the user asks to "launch a subagent in tmux", "run claude in a new pane", "open agent in tmux", "parallel agents in tmux", "tmux pane for claude", or wants to spawn Claude Code instances in separate tmux panes/windows for parallel work.
npx skillsauth add popoffvg/dotfiles tmux-subagentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Launch Claude Code subagent instances in separate tmux panes for parallel, visible work. Each agent runs in its own pane with full terminal output, unlike background Agent tool calls which hide intermediate work.
Verify inside a tmux session before launching:
# Returns something like /dev/ttys001 if inside tmux, empty otherwise
echo "$TMUX"
If not inside tmux, fall back to the standard Agent tool.
Interactive (default) — user can chat with the agent, approve tools, steer:
tmux split-window -h -c "<workdir>" 'claude "<prompt>"'
Non-interactive (-p) — fire-and-forget, agent prints result and exits:
tmux split-window -h -c "<workdir>" \
'claude -p --dangerously-skip-permissions "<prompt>"'
Default to interactive unless the user explicitly asks for fire-and-forget.
tmux split-window -h -c "<workdir>" 'claude "<prompt>"'
tmux split-window -v -c "<workdir>" 'claude "<prompt>"'
tmux new-window -n "agent: <task-label>" -c "<workdir>" 'claude "<prompt>"'
tmux display-popup -w 80% -h 80% -d "<workdir>" -E 'claude "<prompt>"'
Break work into independent subtasks. Each subtask becomes one pane.
| Agents | Strategy | Command |
|--------|----------|---------|
| 1 | Popup or split | display-popup or split-window |
| 2-3 | Directional splits | split-window -h / split-window -v |
| 4+ | Separate windows | new-window |
Each agent prompt must be self-contained — include all context the agent needs:
--allowedTools to restrict tool access if needed)Run all tmux commands. Panes stay open after the agent exits so you can review output. Use tmux kill-pane to clean up.
After agents finish, read their output files or check git status for changes.
| Flag | Purpose |
|------|---------|
| -p / --print | Non-interactive mode, print and exit |
| --dangerously-skip-permissions | Skip permission prompts (use in trusted dirs only) |
| --allowedTools "Tool1 Tool2" | Restrict available tools |
| --model sonnet | Use a faster/cheaper model for simple tasks |
| --max-budget-usd 0.50 | Cap spending per agent |
| --output-format json | Structured output for programmatic consumption |
| --json-schema '{...}' | Enforce output schema |
| -w / --worktree | Isolate agent in a git worktree |
for topic in "auth flow" "database schema" "API endpoints"; do
tmux split-window -v -c "$(pwd)" \
"claude -p \"Analyze the $topic in this codebase. Write summary to /tmp/research-${topic// /-}.md\""
done
tmux select-layout tiled # evenly distribute panes
# Left pane: implement
tmux split-window -h -c "$(pwd)" \
'claude -p --dangerously-skip-permissions "Implement feature X in src/handler.go"'
# Right pane: write tests (launch manually after impl finishes)
# Prepare the command in a pane, user presses Enter when ready:
tmux split-window -h -c "$(pwd)" \
'read -p "Press Enter to start test agent..." && claude -p --dangerously-skip-permissions "Write tests for feature X in src/handler_test.go"'
tmux new-window -n "agent: refactor" -c "$(pwd)" \
'claude -p -w "refactor-branch" --dangerously-skip-permissions "Refactor the auth module to use interfaces"'
Each agent gets its own git worktree — no conflicts between parallel changes.
# Create a named window, then send command to it
tmux new-window -n "research"
tmux send-keys -t "research" \
'claude -p "Summarize the authentication module"' Enter
$TMUX first. If empty, use standard Agent tool or suggest the user starts tmux.tmux select-layout tiled to redistribute, or switch to new-window strategy.tmux kill-pane to clean up.tools
Improve a whole CLAUDE.local.md — the private, per-project rules captured from user corrections. Wraps each conditional rule in a <task-relevant> block so it only surfaces for matching work, merges duplicates, generalizes one-off facts, drops stale entries, and routes raw project facts to engram. Use when the user says "improve claude.local", "clean up the local rules", "claude.local is bloated", or after the Stop hook has appended many rules.
testing
WM pipeline and conventions shared across all phases. Agents must read this before spec, impl, or verify work.
development
One entry point for spec writing, implementation, and bug fixing. Default is new (write spec → grill loop → produce notes → author TODO bodies). Other subcommands: verify (audit), revise (sync to shipped), prototype (settle a decision), code-map (diagram), impl (execute one TODO), fix (analyze cause, correct thoughts, fix behavior), help (this page). Invoke as /code <subcommand>.
development
Red-Green-Refactor cycle for bug fixes. Before fixing a bug, first write a failing test that reproduces it (Red), then make the minimal change to pass (Green), then clean up the code (Refactor). Use on any bug fix, error correction, failing test repair, or when user says "fix this bug".