
Guard
If you're running agent teams in Claude Code, this is essential. Without it, auto-compaction hits and your lead agent loses all team state (TeamCreate, SendMessage, the whole coordination layer). Guard runs a background daemon that monitors session size and auto-prunes at configurable thresholds before compaction triggers. Default setup checkpoints every 30 seconds, does a gentle prune at 30MB, and a full prune with auto-reload at 50MB while preserving team state. It's the difference between your agent team running continuously for hours versus getting wiped mid-task. For single-agent sessions it's optional, but for multi-agent work it prevents a specific, painful failure mode.
- GitHub stars
- 332
- last updated
- Jun 11, 2026
Install
$ npx -y skills add ruya-ai/cozempic --skill guard --agent claude-codeInstalls into .claude/skills of the current project.
Files
Start the cozempic guard daemon for continuous session protection.
Default (recommended)
cozempic guard --daemon --threshold 50 -rx standard --interval 30
This runs in the background and:
- Checkpoints team state every 30 seconds
- At 60% of threshold (30MB): applies gentle prune, no reload
- At threshold (50MB): applies full prescription + auto-reload with team state preserved
For agent teams
Guard mode is essential for sessions running agent teams. Without it, auto-compaction triggers and the lead agent loses team state (TeamCreate, SendMessage, tasks are discarded).
Options
--threshold N— hard threshold in MB (default: 50)--soft-threshold N— soft threshold in MB (default: 60% of hard)--threshold-tokens N— hard threshold in tokens (fires whichever hits first)--no-reload— prune without restarting Claude--no-reactive— disable kqueue/polling file watcher-rx NAME— prescription at hard threshold (default: standard)
Check status and stop
Sponsors
Details
- Repository
- github.com/ruya-ai/cozempic
- License
- MIT
- First seen
- Jun 11, 2026