ClawClau
Async Claude Code task dispatcher via tmux. Use when ACP protocol fails or hangs. Spawns Claude Code in isolated tmux sessions, monitors completion, and retr...
Like a lobster shell, security has layers — review code before you run it.
License
Runtime requirements
Install
SKILL.md
ClawClau — Async Claude Code via tmux
Dispatch Claude Code tasks asynchronously through tmux. Bypasses ACP protocol deadlocks.
When to Use
Use ClawClau instead of sessions_spawn with runtime: "acp" when:
- ACP initialization hangs (common with custom API proxies)
- You need non-blocking task dispatch
- You want to check results later without waiting
Do NOT use for:
- Simple one-liner commands (use
execdirectly) - Tasks requiring real-time streaming output
- Environments without tmux, jq, or Claude Code
First-Time Setup
# Set up the working directory
export CLAWCLAU_HOME="$HOME/.clawclau"
mkdir -p "$CLAWCLAU_HOME/logs"
echo '[]' > "$CLAWCLAU_HOME/active-tasks.json"
Add to shell profile for persistence:
echo 'export CLAWCLAU_HOME="$HOME/.clawclau"' >> ~/.zshrc
Configuration
| Variable | Default | Description |
|---|---|---|
CLAWCLAU_HOME | ~/.openclaw/workspace/.clawdbot | Base directory for registry and logs |
CLAWCLAU_SHELL | bash | Shell for launching Claude Code in tmux |
Scripts
All scripts are in scripts/ relative to this skill directory. Set CLAWCLAU_HOME before calling.
Spawn a task
CLAWCLAU_HOME="$HOME/.clawclau" ./scripts/claude-spawn.sh <task-id> "<prompt>" [workdir] [timeout-seconds]
<task-id>: alphanumeric + dash/underscore only<prompt>: the task for Claude Code[workdir]: defaults to current directory[timeout-seconds]: defaults to 600 (10 min)
Example:
CLAWCLAU_HOME="$HOME/.clawclau" ./scripts/claude-spawn.sh "refactor-auth" \
"Refactor src/auth.ts to use JWT tokens instead of sessions" \
"$HOME/my-project" 300
Check task status
CLAWCLAU_HOME="$HOME/.clawclau" ./scripts/claude-check.sh [task-id]
Without argument: lists all tasks. With argument: shows details + last output.
Get results
CLAWCLAU_HOME="$HOME/.clawclau" ./scripts/claude-result.sh <task-id>
Monitor (auto-detect completion)
CLAWCLAU_HOME="$HOME/.clawclau" ./scripts/claude-monitor.sh
Set up cron for automatic monitoring:
# crontab -e
*/2 * * * * CLAWCLAU_HOME="$HOME/.clawclau" /path/to/skills/clawclau/scripts/claude-monitor.sh
Kill a task
CLAWCLAU_HOME="$HOME/.clawclau" ./scripts/claude-kill.sh <task-id>
Steer a running task
CLAWCLAU_HOME="$HOME/.clawclau" ./scripts/claude-steer.sh <task-id> "<message>"
Note: steering only works with interactive Claude Code sessions, not claude -p.
Task Lifecycle
running → done (tmux ended, log has content)
running → failed (tmux ended, log empty)
running → timeout (exceeded timeout)
running → killed (manually terminated)
Security
claude-spawn.sh uses --dangerously-skip-permissions. Only use in trusted environments.
Files
7 totalComments
Loading comments…
