Launch independent Claude sub-agents in tmux sessions with isolated configurations, custom tool permissions, and real-time monitoring.
- Parallel Execution: Run multiple Claude instances simultaneously
- Tool Isolation: Configure allowed/denied tools per sub-agent
- Plugin Isolation: Install plugins without affecting your main session
- Configuration Inheritance: Sub-agents inherit your project's
.claude/config - iTerm Integration: Automatically opens macOS iTerm tabs attached to sessions
- Real-time Monitoring: View output, send messages, and manage sessions
See Installation Guide for all installation methods.
# Via marketplace (recommended)
# Follow marketplace setup: ../../docs/manual-installation.md
# Or via GitHub
claude plugins install github:nsheaps/ai-mktpl/plugins/tmux-subagent
# Or locally for testing
cc --plugin-dir /path/to/plugins/tmux-subagent- tmux: Must be installed (
brew install tmuxon macOS) - jq: Recommended for config file parsing (
brew install jq) - iTerm2: Optional, for automatic tab attachment on macOS
/subagent Refactor the authentication module to use async/await
/subagent Review src/api/ for security issues --readonly
/subagent --list
/subagent --output my-session
/subagent --kill my-session
# Basic launch
./scripts/launch-subagent.sh --name "my-task" --prompt "Your task here"
# With tool restrictions
./scripts/launch-subagent.sh \
--name "read-only-review" \
--denied-tools "Write,Edit,Bash" \
--prompt "Review the codebase for issues"
# With additional plugins
./scripts/launch-subagent.sh \
--name "with-plugins" \
--plugins "/path/to/plugin1,/path/to/plugin2" \
--prompt "Use custom plugins for this task"- Workspace Creation: Creates
/tmp/claude-subagent/<session-name>/ - Config Copy: Copies your project's
.claude/configuration - Permission Setup: Adds original project as allowed directory
- Tool Config: Applies specified tool restrictions
- Plugin Install: Symlinks additional plugins to temp workspace
- Session Launch: Starts Claude in detached tmux session
- iTerm Tab: Opens attached iTerm tab (macOS only)
| Option | Description | Default |
|---|---|---|
--name |
Session name | subagent-<timestamp> |
--work-dir |
Working directory | Current directory |
--prompt |
Initial prompt | None |
--prompt-file |
File containing prompt | None |
--allowed-tools |
Comma-separated allowed tools | All standard tools |
--denied-tools |
Comma-separated denied tools | None |
--plugins |
Comma-separated plugin paths | None |
--permission-mode |
allowedTools or dontAsk |
allowedTools |
--model |
Model to use | Inherited |
--no-iterm |
Don't open iTerm tab | Opens tab |
--attach |
Attach after creation | Detached |
--config |
JSON config file | None |
# Source helpers
source ./scripts/tmux-helpers.sh
# List sessions
subagent_list
# View output
subagent_output my-session 50
# Send message
subagent_send my-session "Please also update the tests"
# Kill session
subagent_kill my-session# List all sessions
tmux list-sessions
# View pane content
tmux capture-pane -t my-session -p
# Attach interactively
tmux attach -t my-session
# Send keys
tmux send-keys -t my-session "message" Entertmux-subagent/
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── commands/
│ └── subagent.md # /subagent slash command
├── skills/
│ └── tmux-subagent/
│ └── SKILL.md # Comprehensive skill docs
├── scripts/
│ ├── launch-subagent.sh # Main launch script
│ ├── attach-iterm.applescript # iTerm integration
│ └── tmux-helpers.sh # Management utilities
└── README.md
for module in auth api database; do
./scripts/launch-subagent.sh \
--name "refactor-$module" \
--prompt "Refactor src/$module/ to use TypeScript strict mode" \
--no-iterm
done./scripts/launch-subagent.sh \
--name "security-review" \
--denied-tools "Write,Edit,Bash" \
--prompt "Review all files for security vulnerabilities"./scripts/launch-subagent.sh \
--name "test-new-plugin" \
--work-dir /tmp/test-project \
--plugins "/path/to/experimental-plugin" \
--prompt "Test the new plugin features"- Permission Mode: Use
dontAskonly for trusted, well-defined tasks - Tool Restrictions: Always limit tools to what's actually needed
- Work Directory: Sub-agents only access the specified directory
- Workspace: Each session has isolated config in
/tmp/ - Cleanup: Kill sessions and remove workspaces when done
# macOS
brew install tmux
# Ubuntu/Debian
sudo apt install tmux- Check iTerm2 is running
- Verify AppleScript permissions in System Preferences > Security > Privacy > Automation
- Use
--no-itermand attach manually:tmux attach -t session-name
If a teammate agent is stuck mid-turn and not processing messages, send the ESC key via tmux to interrupt its current turn and allow pending messages to propagate:
tmux send-keys -t <pane-id> EscapeCheck the workspace settings:
cat /tmp/claude-subagent/session-name/.claude/settings.json | jq '.permissions'# Check existing sessions
tmux list-sessions
# Use unique name
./scripts/launch-subagent.sh --name "unique-name-$(date +%s)" --prompt "..."MIT