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.testing
Use when the user asks to create test sets, enumerate scenarios, generate edge cases, or draft a coverage matrix before implementation.
testing
Use when the user asks to review, audit, score, or validate test sets for missed cases before execution or merge.
tools
Test harness plugins in isolation using tmux panes. Runs MCP servers, unit tests, typecheck, and Claude plugin loading. Use when user says "test plugin", "check plugin", "run plugin tests", "validate plugin", or names a specific plugin to test.
development
Guide for designing integration and e2e tests using BDD (Behavior-Driven Development) methodology with Cucumber-style Given/When/Then scenarios. Use when writing or reviewing tests for any service, API, or component. Language-agnostic — covers scenario structure, step notation, assertion principles, async patterns, and common anti-patterns.