What's New
Doctor: 3 new health checks with auto-fix
| Check | What it does |
|---|---|
claude-json-corruption
| Detects truncated JSON, missing auth keys, corruption cascades from concurrent sessions. Auto-restores from backup. |
orphaned-tool-results
| Finds tool_result blocks missing their matching tool_use (causes 400 errors on compact/resume). Strips orphans.
|
zombie-teams
| Detects stale team directories with idle/dead agents. Cleans up on --fix.
|
cozempic doctor # detect all issues
cozempic doctor --fix # auto-repair with backupGuard: process watchdog
The guard daemon now monitors the Claude process directly and runs a final checkpoint when it exits — even if the Stop hook doesn't fire (plugin bug workaround).
Post-treatment validation
Every treat, reload, and guard prune now validates all tool_use/tool_result pairs after pruning and removes orphaned blocks automatically. No more 400 errors after treatment.
Tokens as primary metric
All output now leads with tokens instead of bytes. Context bar shows % of the actual model's window (auto-detected from session data).
Model detection
Auto-detects model from session and uses the correct context window. Override with --context-window or COZEMPIC_CONTEXT_WINDOW env var.
Guard: explicit session targeting
--session <id> flag bypasses auto-detection for multi-instance environments. The SessionStart hook passes session_id automatically.
Full Changelog
- 0.8.0: Doctor checks for .claude.json corruption, zombie teams; guard watchdog
- 0.7.6: Orphaned tool_result fix — post-treatment validation + doctor check
- 0.7.5: Doctor check for corrupted tool_use blocks (name >200 chars)
- 0.7.4:
--sessionflag on guard, SessionStart hook passes session_id - 0.7.3: Opus-4-6 context window fixed to 200K,
--context-windowflag - 0.7.2: Auto-detect model + context window, tokens-first output
- 0.7.1: Tokens as primary metric in treat/guard/overflow/MCP
- 0.7.0: Claude Code plugin (MCP server, skills, marketplace)
Install
pip install --upgrade cozempic
cozempic init # update hooksPlugin: /plugin marketplace add Ruya-AI/cozempic