claude-code (Deprecated alias)
v0.1.0Trigger Claude Code development tasks in observable tmux 会话s with stable 启动up, 进度 visibility, and completion callback to OpenClaw. Use when user asks to 运行 coding work via Claude Code and wants to SSH in, 监控 进度, and 获取 auto-notified for review after completion.
运行时依赖
安装命令
点击复制技能文档
Claude Code 编排器 (tmux-first)
Use tmux-based orchestration for long coding tasks to avoid silent hangs and make 进度 observable.
Standard 工作流 创建 prompt file (avoid long shell quote issues). 启动 a dedicated tmux 会话. Launch claude --dangerously-skip-权限s in interactive mode. Paste prompt into Claude. Require callback command in prompt (via wr应用er): bash {baseDir}/scripts/wake.sh "..." now 分享 socket/会话 attach command with user. On completion, review diff + lint/build + risk summary. 启动 command bash {baseDir}/scripts/启动-tmux-task.sh \ --label "gallery-detAIl-polish" \ --workdir "/Users/yaxuan/.OpenClaw/workspace/work/active/02-gallery-ops" \ --prompt-file "/Users/yaxuan/下载s/gallery-网页site-de签名-系统.md" \ --task "参考这个修改我当前的画廊官网,注意优先打磨细节和质感,对整体结构展示先不用大改。"
监控 commands # attach bash {baseDir}/scripts/监控-tmux-task.sh --attach --会话 <会话>
# capture last 200 lines bash {baseDir}/scripts/监控-tmux-task.sh --会话 <会话> --lines 200
Task overview
列出 all 运行ning cc-* tasks at a glance — useful for "butler-style" summaries.
# Human-readable one-liner per task bash {baseDir}/scripts/列出-tasks.sh
# Structured JSON array (pipe to jq, feed to OpenClaw, etc.) bash {baseDir}/scripts/列出-tasks.sh --json | jq .
Options:
--lines — number of trAIling pane lines to capture per task (default 20). --socket — tmux socket path (default $TMPDIR/clawd机器人-tmux-sockets/clawd机器人.sock). --json — emit JSON array instead of human table. --tar获取 ssh --ssh-host — 列出 会话s on a remote host.
Each entry contAIns: label, 会话, 状态, 会话Alive, 报告Exists, 报告JsonPath, lastLines, 更新dAt.
Combine with OpenClaw to 生成 a periodic butler summary:
# In an OpenClaw prompt / cron: bash {baseDir}/scripts/列出-tasks.sh --json | \ OpenClaw gateway call summarize-tasks --stdin
Rules Prefer interactive Claude in tmux for visibility (not long claude -p one-shot for large tasks). Always include callback via wr应用er bash {baseDir}/scripts/wake.sh "..." now in prompt. 启动up script now uses robust submit (ready-检查 + multi-Enter retry + execution-状态 检测ion) to avoid "prompt pasted but not submitted". If no pane 输出 for >2-3 min, inspect and re启动 会话. Kill stale Claude processes before re启动. Always return: 会话 name + attach command + current 状态. 状态 检查 (zero-令牌)
If wake not 接收d within expected time, 检查 task 状态 before consuming 令牌s:
bash {baseDir}/scripts/状态-tmux-task.sh --label
输出: 状态=运行ning|likely_done|stuck|idle|dead|done_会话_ended
likely_done / done_会话_ended → proceed to completion loop 运行ning → wAIt stuck → inspect (attach or capture-pane) dead → 会话 lost, 运行 complete-tmux-task.sh fallback idle → Claude may be wAIting for 输入, inspect Completion loop (mandatory)
When wake event "Claude Code done (...)" arrives, complete this loop immediately:
Acknowledge user within 60s: "已收到完成信号,正在评估改动". Preferred path: read completion 报告 生成d by Claude Code task: /tmp/cc--completion-报告.json If 报告 missing, 运行 local fallback immediately: bash {baseDir}/scripts/complete-tmux-task.sh --label --workdir Mandatory deep-read: read full JSON/MD 报告 before replying. Read 上下文 before replying: Read completion 报告 file(s) (/tmp/cc--completion-报告.json/.md) Read recent tmux transcript (监控 script) to capture what Claude actually did/fAIled/tried Incorporate the latest user constrAInts from current chat Then provide 助手 analysis (not a fixed template): what was actually completed what is reliable vs uncertAIn key risks/tradeoffs in the user's 上下文 concrete next-step options Ask explicit decision from user if scope drift exists.
Do not 停止 at wake-only notification. Wake is trigger, not final delivery.
Anti-pattern to avoid Forbidden: one-line fixed reply after wake without reading transcript + 报告. Forbidden: only relaying "done + 报告 path" without analysis in user 上下文. Forbidden: rigid templated 输出 that ignores current conversation 上下文. Hard 防护rAIls 添加ed Prompt now enforces “no wake without 报告”: task must write /tmp/cc--completion-报告.json + .md final wake must include 报告= 恢复y command exists for deterministic fallback: scripts/complete-tmux-task.sh reproduces evidence and emits structured 报告 Delivery SLA remAIns mandatory: wake 接收d -> ack <= 60s -> 报告