Claude Code Wingman
Your multi-session orchestrator - manage multiple Claude Code instances working on different projects simultaneously, all from WhatsApp.
GitHub: https://github.com/yossiovadia/claude-code-orchestrator
⚡ CRITICAL: Handle Approval Commands First
When a user message matches these patterns, IMMEDIATELY run the corresponding command:
| User Message Pattern | Command to Run |
|---|
| INLINECODE0 | INLINECODE1 |
| INLINECODE2 |
~/code/claude-code-orchestrator/lib/handle-approval.sh always <session> |
|
deny <session> |
~/code/claude-code-orchestrator/lib/handle-approval.sh deny <session> |
Examples:
- - User: "approve vsr-bugfix" → Run: INLINECODE6
- User: "always heartbeat-test" → Run: INLINECODE7
- User: "deny proxy-refactor" → Run: INLINECODE8
After running, respond with the command output (e.g., "✓ Session 'vsr-bugfix' approved (once)")
Why this is critical: The master monitor daemon sends WhatsApp notifications when Claude Code sessions need approval. The user responds with these commands from their phone. Fast response = unblocked sessions.
Quick Status Commands
| User Message | Command to Run |
|---|
| INLINECODE9 or INLINECODE10 | INLINECODE11 |
| INLINECODE12 |
~/code/claude-code-orchestrator/lib/session-status.sh <session> --json |
Parse the JSON and respond with a human-readable summary.
What It Does
Orchestrates multiple Claude Code sessions in parallel, each working on different tasks in different directories. You monitor and control everything remotely via WhatsApp/chat.
The Vision:
- - Multiple tmux sessions running simultaneously
- Each session = one Claude Code instance in its own directory
- Different tasks happening in parallel (VSR fixes, Clawdbot features, proxy refactoring)
- You orchestrate everything via Clawdbot (this assistant) from WhatsApp
- Real-time dashboard showing all active sessions and their status
🎯 Real-World Example: Multi-Session Orchestration
Morning - You (via WhatsApp): "Start work on VSR issue #1131, Clawdbot authentication feature, and refactor the proxy"
Clawdbot spawns 3 sessions:
CODEBLOCK0
During lunch - You: "Show me the dashboard"
Clawdbot:
CODEBLOCK1
You: "How's the VSR issue going?"
Clawdbot captures session output:
"Almost done - fixed the schema validation bug, running tests now. 8/10 tests passing."
You: "Tell proxy-refactor to run tests next"
Clawdbot sends command to that specific session.
Result: 3 parallel tasks, full remote control from your phone. 🎯
Installation
Via Clawdbot (Recommended)
CODEBLOCK2
Or visit: https://clawdhub.com/skills/claude-code-wingman
Manual Installation
CODEBLOCK3
Requirements
- -
claude CLI (Claude Code) - INLINECODE15 (terminal multiplexer)
- INLINECODE16 (JSON processor)
Core Philosophy: Always Use the Wingman Script
CRITICAL: When interacting with Claude Code sessions, ALWAYS use the wingman script (claude-wingman.sh). Never run raw tmux commands directly.
Why:
- - ✅ Ensures proper Enter key handling (C-m)
- ✅ Consistent session management
- ✅ Future-proof for dashboard/tracking features
- ✅ Avoids bugs from manual tmux commands
Wrong (DON'T DO THIS):
CODEBLOCK4
Right (ALWAYS DO THIS):
~/code/claude-code-orchestrator/claude-wingman.sh \
--session my-session \
--workdir ~/code/myproject \
--prompt "Run tests"
Usage from Clawdbot
Start a New Session
When a user asks for coding work, spawn Claude Code:
CODEBLOCK6
Send Command to Existing Session
To send a new task to an already-running session:
CODEBLOCK7
Note: The script detects if the session exists and sends the command to it instead of creating a duplicate.
Check Session Status
CODEBLOCK8
Parse the output to determine if Claude Code is:
- - Working (showing tool calls/progress)
- Idle (showing prompt)
- Error state (showing errors)
- Waiting for approval (showing "Allow this tool call?")
Example Patterns
User: "Fix the bug in api.py"
Clawdbot:
CODEBLOCK9
User: "What's the status?"
Clawdbot:
CODEBLOCK10
Then summarize: "Claude Code is running tests now, 8/10 passing"
User: "Tell it to commit the changes"
Clawdbot:
CODEBLOCK11
Commands Reference
Start New Session
CODEBLOCK12
Send Command to Existing Session
CODEBLOCK13
Monitor Session Progress
CODEBLOCK14
List All Active Sessions
CODEBLOCK15
Filter for Claude Code sessions:
CODEBLOCK16
View Auto-Approver Log (if needed)
CODEBLOCK17
Kill Session When Done
CODEBLOCK18
Attach Manually (for user)
tmux attach -t <session-name>
# Detach: Ctrl+B, then D
Roadmap: Multi-Session Dashboard (Coming Soon)
Planned features:
wingman dashboard
Shows all active Claude Code sessions:
CODEBLOCK20
wingman status <session>
Detailed status for a specific session:
CODEBLOCK21
Session Registry
- - Persistent tracking (survives Clawdbot restarts)
- JSON file storing session metadata
- Auto-cleanup of dead sessions
For now: Use tmux commands directly, but always via the wingman script for sending commands!
Workflow
- 1. User requests coding work (fix bug, add feature, refactor, etc.)
- Clawdbot spawns Claude Code via orchestrator script
- Auto-approver handles permissions in background
- Clawdbot monitors and reports progress
- User can attach anytime to see/control directly
- Claude Code does the work autonomously ✅
Trust Prompt (First Time Only)
When running in a new directory, Claude Code asks:
"Do you trust the files in this folder?"
First run: User must attach and approve (press Enter). After that, it's automatic.
Handle it:
CODEBLOCK22
Best Practices
When to Use Orchestrator
✅ Use orchestrator for:
- - Heavy code generation/refactoring
- Multi-file changes
- Long-running tasks
- Repetitive coding work
❌ Don't use orchestrator for:
- - Quick file reads
- Simple edits
- When conversation is needed
- Planning/design discussions
Session Naming
Use descriptive names:
- -
vsr-issue-1131 - specific issue work - INLINECODE21 - feature development
- INLINECODE22 - bug fixes
Troubleshooting
Prompt Not Submitting
The orchestrator sends Enter twice with delays. If stuck, user can attach and press Enter manually.
Auto-Approver Not Working
Check logs: INLINECODE23
Should see: "Approval prompt detected! Navigating to option 2..."
Session Already Exists
Kill it: INLINECODE24
Advanced: Update Memory
After successful tasks, update TOOLS.md:
CODEBLOCK23
Pro Tips
- - Parallel sessions: Run multiple tasks simultaneously in different sessions
- Name consistently: Use project prefixes (vsr-, myapp-, etc.)
- Monitor periodically: Check progress every few minutes
- Let it finish: Don't kill sessions early, let Claude Code complete
🔔 Approval Handling (WhatsApp Integration)
The master monitor daemon sends WhatsApp notifications when sessions need approval. Handle them with these commands:
Approve Commands (from WhatsApp)
When you receive an approval notification, respond with:
Clawdbot parses your message and runs:
CODEBLOCK24
Example WhatsApp Flow
Notification received:
CODEBLOCK25
You reply: "approve vsr-bugfix"
Clawdbot:
CODEBLOCK26
Response: "✓ Session 'vsr-bugfix' approved (once)"
Start the Monitor Daemon
CODEBLOCK27
No environment variables needed - phone and webhook token are read from Clawdbot config.
Claude Code 助手
您的多会话协调器——通过 WhatsApp 管理同时在多个不同项目上运行的多个 Claude Code 实例。
GitHub: https://github.com/yossiovadia/claude-code-orchestrator
⚡ 关键:优先处理审批命令
当用户消息匹配以下模式时,立即运行相应命令:
| 用户消息模式 | 要运行的命令 |
|---|
| approve <会话> | ~/code/claude-code-orchestrator/lib/handle-approval.sh approve <会话> |
| always <会话> |
~/code/claude-code-orchestrator/lib/handle-approval.sh always <会话> |
| deny <会话> | ~/code/claude-code-orchestrator/lib/handle-approval.sh deny <会话> |
示例:
- - 用户:approve vsr-bugfix → 运行:~/code/claude-code-orchestrator/lib/handle-approval.sh approve vsr-bugfix
- 用户:always heartbeat-test → 运行:~/code/claude-code-orchestrator/lib/handle-approval.sh always heartbeat-test
- 用户:deny proxy-refactor → 运行:~/code/claude-code-orchestrator/lib/handle-approval.sh deny proxy-refactor
运行后,返回命令输出(例如:✓ 会话 vsr-bugfix 已批准(单次))
为什么这很关键: 主监控守护进程会在 Claude Code 会话需要审批时发送 WhatsApp 通知。用户通过手机回复这些命令。快速响应 = 会话不被阻塞。
快速状态命令
| 用户消息 | 要运行的命令 |
|---|
| sessions 或 status | ~/code/claude-code-orchestrator/lib/session-status.sh --all --json |
| status <会话> |
~/code/claude-code-orchestrator/lib/session-status.sh <会话> --json |
解析 JSON 并以人类可读的摘要形式回复。
功能说明
并行协调多个 Claude Code 会话,每个会话在不同目录中处理不同任务。您通过 WhatsApp/聊天远程监控和控制一切。
愿景:
- - 多个 tmux 会话同时运行
- 每个会话 = 一个 Claude Code 实例,位于各自目录中
- 不同任务并行进行(VSR 修复、Clawdbot 功能、代理重构)
- 您通过 Clawdbot(本助手)从 WhatsApp 协调一切
- 实时仪表板显示所有活动会话及其状态
🎯 真实示例:多会话协调
早上 - 您(通过 WhatsApp): 开始处理 VSR issue #1131、Clawdbot 认证功能,并重构代理
Clawdbot 生成 3 个会话:
✅ 会话:vsr-issue-1131 (~/code/semantic-router)
✅ 会话:clawdbot-auth (~/code/clawdbot)
✅ 会话:proxy-refactor (~/code/claude-code-proxy)
午餐时 - 您: 显示仪表板
Clawdbot:
┌─────────────────────────────────────────────────────────┐
│ 活跃的 Claude Code 会话 │
├─────────────────┬──────────────────────┬────────────────┤
│ vsr-issue-1131 │ semantic-router │ ✅ 工作中 │
│ clawdbot-auth │ clawdbot │ ✅ 工作中 │
│ proxy-refactor │ claude-code-proxy │ ⏳ 等待审批 │
└─────────────────┴──────────────────────┴────────────────┘
您: VSR issue 进展如何?
Clawdbot 捕获会话输出:
快完成了——修复了 schema 验证错误,正在运行测试。8/10 测试通过。
您: 告诉 proxy-refactor 接下来运行测试
Clawdbot 向该特定会话发送命令。
结果: 3 个并行任务,从手机完全远程控制。🎯
安装
通过 Clawdbot(推荐)
bash
clawdbot skill install claude-code-wingman
或访问:https://clawdhub.com/skills/claude-code-wingman
手动安装
bash
cd ~/code
git clone https://github.com/yossiovadia/claude-code-orchestrator.git
cd claude-code-orchestrator
chmod +x .sh lib/.sh
要求
- - claude CLI(Claude Code)
- tmux(终端复用器)
- jq(JSON 处理器)
核心理念:始终使用 Wingman 脚本
关键: 与 Claude Code 会话交互时,始终使用 wingman 脚本(claude-wingman.sh)。切勿直接运行原始 tmux 命令。
原因:
- - ✅ 确保正确处理 Enter 键(C-m)
- ✅ 一致的会话管理
- ✅ 为仪表板/跟踪功能提供未来保障
- ✅ 避免手动 tmux 命令导致的错误
错误做法(不要这样做):
bash
tmux send-keys -t my-session Run tests
^ 可能忘记 C-m,不会在仪表板中跟踪
正确做法(始终这样做):
bash
~/code/claude-code-orchestrator/claude-wingman.sh \
--session my-session \
--workdir ~/code/myproject \
--prompt Run tests
从 Clawdbot 使用
启动新会话
当用户请求编码工作时,生成 Claude Code:
bash
~/code/claude-code-orchestrator/claude-wingman.sh \
--session <会话名称> \
--workdir <项目目录> \
--prompt <任务描述>
向现有会话发送命令
向已在运行的会话发送新任务:
bash
~/code/claude-code-orchestrator/claude-wingman.sh \
--session <现有会话名称> \
--workdir <相同目录> \
--prompt <新任务>
注意: 脚本会检测会话是否存在,如果存在则向其发送命令,而不是创建重复会话。
检查会话状态
bash
tmux capture-pane -t <会话名称> -p -S -50
解析输出以确定 Claude Code 是否:
- - 工作中(显示工具调用/进度)
- 空闲(显示提示符)
- 错误状态(显示错误)
- 等待审批(显示允许此工具调用?)
示例模式
用户: 修复 api.py 中的错误
Clawdbot:
正在为此生成 Claude Code 会话...
[运行 wingman 脚本]
✅ 会话已启动:vsr-bug-fix
📂 目录:~/code/semantic-router
🎯 任务:修复 api.py 中的错误
用户: 状态如何?
Clawdbot:
bash
tmux capture-pane -t vsr-bug-fix -p -S -50
然后总结:Claude Code 正在运行测试,8/10 通过
用户: 告诉它提交更改
Clawdbot:
bash
~/code/claude-code-orchestrator/claude-wingman.sh \
--session vsr-bug-fix \
--workdir ~/code/semantic-router \
--prompt 使用描述性消息提交更改
命令参考
启动新会话
bash
~/code/claude-code-orchestrator/claude-wingman.sh \
--session <名称> \
--workdir <目录> \
--prompt <任务>
向现有会话发送命令
bash
~/code/claude-code-orchestrator/claude-wingman.sh \
--session <现有会话> \
--workdir <相同目录> \
--prompt <新命令>
监控会话进度
bash
tmux capture-pane -t <会话名称> -p -S -100
列出所有活动会话
bash
tmux ls
过滤 Claude Code 会话:
bash
tmux ls | grep -E (vsr|clawdbot|proxy|claude)
查看自动审批日志(如果需要)
bash
cat /tmp/auto-approver-<会话名称>.log
完成后终止会话
bash
tmux kill-session -t <会话名称>
手动附加(供用户使用)
bash
tmux attach -t <会话名称>
分离:Ctrl+B,然后 D
路线图:多会话仪表板(即将推出)
计划功能:
wingman dashboard
显示所有活跃的 Claude Code 会话:
┌─────────────────────────────────────────────────────────┐
│ 活跃的 Claude Code 会话