# hermes-cc-bridge Hermes ↔ Claude Code SDK Bridge — hook-driven progress tracking with crash recovery. ## Features - **Hook-driven completion**: Stop event = done signal, no timeout guessing - **Real-time progress**: PostToolUse events → tool breakdown, elapsed time - **Heartbeat detection** (v3.2): 120s no tool calls → check process alive → auto-recover - **Crash recovery**: CC process dead without Stop event → recover from hook state files - **Session ID tracking** (v3.2): hook_monitor dynamically tracks session_id (was broken when None at startup) ## Usage ```bash python3 cc_sdk.py "fix the bug" --cwd ~/project --max-turns 8 --timeout 180 --json python3 cc_sdk.py --progress ``` ## Files - `cc_sdk.py` — SDK bridge (v3.2) - `hermes_hook.py` — Hook script for Claude Code settings.json ## Hook Setup In `~/.claude/settings.json`: ```json { "hooks": { "Stop": [{"matcher": "", "hooks": [{"type": "command", "command": "python3 /path/to/hermes_hook.py", "timeout": 10}]}], "PostToolUse": [{"matcher": "", "hooks": [{"type": "command", "command": "python3 /path/to/hermes_hook.py", "timeout": 5}]}], "Notification": [{"matcher": "", "hooks": [{"type": "command", "command": "python3 /path/to/hermes_hook.py", "timeout": 10}]}] } } ``` ## License MIT