Supervise Claude Code sessions running in tmux. Uses Claude Code hooks with bash pre-filtering (Option D) and fast LLM triage to detect errors, stuck agents, and task completion. Harness-agnostic — works with OpenClaw, webhooks, ntfy, or any notification backend. Use when: (1) launching long-running Claude Code tasks that need monitoring, (2) setting up automatic nudging for API errors or premature stops, (3) getting progress reports from background coding agents, (4) continuing work after session/context limits reset. Requires: tmux, claude CLI.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install claude-code-supervisor或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install claude-code-supervisor⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/claude-code-supervisor/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: claude-code-supervisor description: > Supervise Claude Code sessions running in tmux. Uses Claude Code hooks with bash pre-filtering (Option D) and fast LLM triage to detect errors, stuck agents, and task completion. Harness-agnostic — works with OpenClaw, webhooks, ntfy, or any notification backend. Use when: (1) launching long-running Claude Code tasks that need monitoring, (2) setting up automatic nudging for API errors or premature stops, (3) getting progress reports from background coding agents, (4) continuing work after session/context limits reset. Requires: tmux, claude CLI. metadata: { "openclaw": { "emoji": "👷", "os": ["darwin", "linux"], "requires": { "bins": ["tmux"], "anyBins": ["claude"] }, }, } ---
Bridge between Claude Code's lifecycle hooks and your agent harness.
Claude Code (in tmux)
│ Stop / Error / Notification
▼
Bash pre-filter (Option D)
│ obvious cases handled directly
│ ambiguous cases pass through
▼
Fast LLM triage (claude -p with Haiku, or local LLM)
│ classifies: FINE | NEEDS_NUDGE | STUCK | DONE | ESCALATE
│ FINE → logged silently
▼
Notify command (configurable)
│ openclaw wake, webhook, ntfy, script, etc.
▼
Agent harness decides + acts
│ nudge (send-keys to tmux), wait, escalate to human
{baseDir}/scripts/install-hooks.sh /path/to/your/project
Creates:
.claude/hooks/supervisor/ — hook scripts + triage.claude/settings.json — wired into Claude Code lifecycle.claude-code-supervisor.yml — configuration (edit this)Edit .claude-code-supervisor.yml:
triage:
command: "claude -p --no-session-persistence" # or: ollama run llama3.2
model: "claude-haiku-4-20250414"
notify:
command: "openclaw gateway call wake --params" # or: curl, ntfy, script
Create ~/.openclaw/workspace/supervisor-state.json (or wherever your harness keeps state):
{
"sessions": {
"my-task": {
"socket": "/tmp/openclaw-tmux-sockets/openclaw.sock",
"tmuxSession": "my-task",
"projectDir": "/path/to/project",
"goal": "Fix issue #42",
"successCriteria": "Tests pass, committed",
"maxNudges": 5,
"escalateAfterMin": 60,
"status": "running"
}
}
}
SOCKET="/tmp/openclaw-tmux-sockets/openclaw.sock"
tmux -S "$SOCKET" new -d -s my-task
tmux -S "$SOCKET" send-keys -t my-task "cd /path/to/project && claude 'Fix issue #42'" Enter
Hooks fire automatically. Triage assesses. You get notified only when it matters.
Not every hook event needs an LLM call. Bash catches the obvious cases first:
| Signal | Bash decision | LLM triage? | |--------|--------------|-------------| | max_tokens | Always needs attention | ✅ Yes | | end_turn + shell prompt back | Agent might be done | ✅ Yes | | end_turn + no prompt | Agent is mid-work | ❌ Skip | | stop_sequence | Normal | ❌ Skip |
| Signal | Bash decision | LLM triage? | |--------|--------------|-------------| | API 429 / rate limit | Transient, will resolve | ❌ Log only | | API 500 | Agent likely stuck | ✅ Yes | | Other tool error | Unknown severity | ✅ Yes |
| Signal | Bash decision | LLM triage? | |--------|--------------|-------------| | auth_* | Internal, transient | ❌ Skip | | permission_prompt | Needs decision | ✅ Yes | | idle_prompt | Agent waiting | ✅ Yes |
The LLM returns one of:
| Verdict | Meaning | Typical action | |---------|---------|----------------| | FINE | Agent is working normally | Log silently, no notification | | NEEDS_NUDGE | Transient error, should continue | Send "continue" to tmux | | STUCK | Looping or not progressing | Try different approach or escalate | | DONE | Task completed successfully | Report to human | | ESCALATE | Needs human judgment | Notify human with context |
Wake events arrive with the prefix cc-supervisor: followed by the classification:
cc-supervisor: NEEDS_NUDGE | error:api_500 | cwd=/home/user/project | ...
cc-supervisor: DONE | stopped:end_turn:prompt_back | cwd=/home/user/project | ...
tmux -S "$SOCKET" send-keys -t "$SESSION" "continue — the API error was transient" Enter
See references/escalation-rules.md for when to nudge vs escalate and quiet hours.
Hooks depend on Claude Code being alive. If the session hard-crashes, hits account limits, or the process gets OOM-killed, no hooks fire. The watchdog catches this.
scripts/watchdog.sh is a pure bash script (no LLM, no Claude Code dependency) that:
supervisor-state.json for all "running" sessionslastWatchdogAt in state for trackingRun it on a timer. Choose your poison:
System cron:
*/15 * * * * /path/to/claude-code-supervisor/scripts/watchdog.sh
OpenClaw cron:
{
"schedule": { "kind": "every", "everyMs": 900000 },
"payload": { "kind": "systemEvent", "text": "cc-supervisor: watchdog — run /path/to/scripts/watchdog.sh and report" },
"sessionTarget": "main"
}
systemd timer, launchd, or whatever runs periodically on your box.
The watchdog is deliberately dumb — no LLM, no complex logic, just "is the process still there?" This means it works even when the triage model is down, the API is melting, or your account hit its limit. Belts and suspenders.
scripts/install-hooks.sh — one-command setup per projectscripts/hooks/on-stop.sh — Stop event handler with bash pre-filterscripts/hooks/on-error.sh — PostToolUseFailure handler with bash pre-filterscripts/hooks/on-notify.sh — Notification handler with bash pre-filterscripts/triage.sh — LLM triage (called by hooks for ambiguous cases)scripts/lib.sh — shared config loading and notification functionsscripts/watchdog.sh — dead session detector (pure bash, no LLM dependency)references/state-patterns.md — terminal output pattern matching guidereferences/escalation-rules.md — when to nudge vs escalate vs waitsupervisor.yml.example — example configuration安装 Claude Code Supervisor 后,可以对 AI 说这些话来触发它
Help me get started with Claude Code Supervisor
Explains what Claude Code Supervisor does, walks through the setup, and runs a quick demo based on your current project
Use Claude Code Supervisor to supervise Claude Code sessions running in tmux
Invokes Claude Code Supervisor with the right parameters and returns the result directly in the conversation
What can I do with Claude Code Supervisor in my developer & devops workflow?
Lists the top use cases for Claude Code Supervisor, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/claude-code-supervisor/ 目录(个人级,所有项目可用),或 .claude/skills/claude-code-supervisor/(项目级)。重启 AI 客户端后,用 /claude-code-supervisor 主动调用,或让 AI 根据上下文自动发现并使用。
Claude Code Supervisor 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Claude Code Supervisor 可免费安装使用。请查阅仓库了解许可证信息。
Supervise Claude Code sessions running in tmux. Uses Claude Code hooks with bash pre-filtering (Option D) and fast LLM triage to detect errors, stuck agents, and task completion. Harness-agnostic — works with OpenClaw, webhooks, ntfy, or any notification backend. Use when: (1) launching long-running Claude Code tasks that need monitoring, (2) setting up automatic nudging for API errors or premature stops, (3) getting progress reports from background coding agents, (4) continuing work after session/context limits reset. Requires: tmux, claude CLI.
Automate my developer & devops tasks using Claude Code Supervisor
Identifies repetitive steps in your workflow and sets up Claude Code Supervisor to handle them automatically
Claude Code Supervisor 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。