home / skills / openclaw / skills / claude-code-wingman

This skill spawns Claude Code sessions in tmux to automate coding tasks while preserving budget by using work API.

npx playbooks add skill openclaw/skills --skill claude-code-wingman

Review the files below or copy the command above to add this skill to your agents.

Files (28)
SKILL.md
13.0 KB
---
name: claude-code-wingman
description: Your Claude Code wingman - dispatch coding tasks via tmux for free/work-paid coding while keeping Clawdbot API costs minimal
metadata: {"clawdbot":{"emoji":"🎯","requires":{"anyBins":["claude","tmux"]}}}
---

# Claude Code Wingman

Automate Claude Code sessions from Clawdbot - leverage free/work Claude Code API while keeping your Anthropic budget for conversations.

**GitHub:** https://github.com/yossiovadia/claude-code-wingman

## What It Does

Spawns Claude Code in tmux sessions with automatic approval of permission prompts. Perfect for when you have free/work Claude Code access but limited Anthropic API budget.

**Cost Comparison:**
- **Without:** Clawdbot does all coding β†’ uses your $20/month API
- **With:** Clawdbot spawns Claude Code β†’ uses work's free API βœ…

## Installation

The skill references the standalone repo. Install it once:

```bash
cd ~/code
git clone https://github.com/yossiovadia/claude-code-wingman.git
cd claude-code-wingman
chmod +x *.sh
```

## Usage from Clawdbot

When a user asks for coding work, spawn Claude Code:

```bash
~/code/claude-code-wingman/claude-wingman.sh \
  --session <session-name> \
  --workdir <project-directory> \
  --prompt "<task description>"
```

### Example Patterns

**User:** "Fix the bug in api.py"

**Clawdbot Response:**
```
Spawning Claude Code for this...

bash:~/code/claude-code-wingman/claude-wingman.sh \
  --session vsr-bug-fix \
  --workdir ~/code/semantic-router \
  --prompt "Fix the bug in src/api.py - add proper error handling for null responses"
```

Then report:
- Session name (so user can attach)
- Monitor command
- Auto-approver is running

**User:** "What's the status?"

**Clawdbot:** Capture tmux output and summarize:
```bash
tmux capture-pane -t vsr-bug-fix -p -S -50
```

## Commands

### Spawn Session
```bash
~/code/claude-code-wingman/claude-wingman.sh \
  --session <name> \
  --workdir <dir> \
  --prompt "<task>"
```

### Monitor Progress
```bash
tmux capture-pane -t <session-name> -p -S -100
```

### View Auto-Approver Log
```bash
cat /tmp/auto-approver-<session-name>.log
```

### Kill Session
```bash
tmux kill-session -t <session-name>
```

### List All Sessions
```bash
tmux ls | grep claude-auto
```

## Workflow

1. **User requests coding work** (fix bug, add feature, refactor, etc.)
2. **Clawdbot spawns Claude Code** via wingman script
3. **Auto-approver handles permissions** in background
4. **Clawdbot monitors and reports** progress
5. **User can attach anytime** to see/control directly
6. **Claude Code does the work** on work's API βœ…

## 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:**
```
User, Claude Code needs you to approve the folder trust (one-time). Please run:
tmux attach -t <session-name>

Press Enter to approve, then Ctrl+B followed by D to detach.
```

## Best Practices

### When to Use Wingman

βœ… **Use wingman for:**
- Heavy code generation/refactoring
- Multi-file changes
- Long-running tasks
- Repetitive coding work

❌ **Don't use wingman for:**
- Quick file reads
- Simple edits
- When conversation is needed
- Planning/design discussions

### Session Naming

Use descriptive names:
- `vsr-issue-1131` - specific issue work
- `vsr-feature-auth` - feature development
- `project-bugfix-X` - bug fixes

## Troubleshooting

### Prompt Not Submitting
The wingman sends Enter twice with delays. If stuck, user can attach and press Enter manually.

### Auto-Approver Not Working
Check logs: `cat /tmp/auto-approver-<session-name>.log`

Should see: "Approval prompt detected! Navigating to option 2..."

### Session Already Exists
Kill it: `tmux kill-session -t <name>`

## Advanced: Update Memory

After successful tasks, update `TOOLS.md`:

```markdown
### Recent Claude Code Sessions
- 2026-01-26: VSR AWS check - verified vLLM server running βœ…
- Session pattern: vsr-* for semantic-router work
```

## 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

---

**Remember:** This skill saves API costs by using free work Claude Code for heavy lifting, keeping your Anthropic budget for conversations.

Overview

This skill automates spawning and managing Claude Code sessions inside tmux so you can dispatch coding tasks to a free/work Claude Code instance while minimizing Anthropic API spend. It launches sessions, auto-approves folder trust prompts, and provides simple monitoring and control commands so the coding work runs unattended where appropriate.

How this skill works

The wingman script creates a tmux session, starts Claude Code in the specified work directory, and runs an auto-approver that answers the initial trust prompt automatically after the first manual approval. Clawdbot sends the spawn command with session name, directory, and prompt; you can attach, monitor tmux output, view auto-approver logs, or kill sessions as needed. This offloads heavy code generation to the work API while conserving your paid Anthropic budget for conversational tasks.

When to use it

  • Long-running code generation, refactors, or multi-file changes
  • Parallel tasks that benefit from separate tmux sessions
  • Repetitive coding jobs where manual interaction is minimal
  • Heavy edits or feature implementations that would consume API budget
  • When you want to let Claude Code run unattended after initial trust approval

Best practices

  • Use descriptive session names with project prefixes (e.g., vsr-feature-auth)
  • Attach once to approve folder trust on first run, then detach
  • Monitor session output periodically via tmux capture-pane instead of attaching constantly
  • Keep tasks focused and self-contained to avoid unnecessary conversation API use
  • Let sessions complete; avoid killing them early unless they hang

Example use cases

  • Spawn a session to fix a bug across multiple files and report back the diffs
  • Run a large refactor or codebase-wide lint/fix task without using paid API credits
  • Parallelize feature development by running separate sessions per feature branch
  • Automate repetitive scaffolding or tests generation on the work API
  • Offload long-running build or verification steps while monitoring progress

FAQ

Do I need to approve anything manually?

Yes β€” the first time Claude Code runs in a new folder you must attach, press Enter to approve trust, then detach. After that the auto-approver handles prompts.

How do I see progress without attaching?

Use tmux capture-pane to fetch recent output (e.g., tmux capture-pane -t <session-name> -p -S -100) and summarize the results.

What if a session gets stuck or already exists?

Check the auto-approver log at /tmp/auto-approver-<session-name>.log, and kill a stale session with tmux kill-session -t <session-name>.