guard — Session Context Protection Daemon
Runs a background daemon that watches your Claude Code session size and prunes context before auto-compaction wipes your state.
UtilitiesIntermediate★ 375⑂ 37AI score 9/10Last updated: Jul 3, 2026
What it does
- Launches the
cozempic guarddaemon in the background to continuously monitor session size in MB or tokens. - At the soft threshold (default 60% of hard) it applies a gentle prune with no reload; at the hard threshold (default 50MB) it applies the full prescription and auto-reloads while preserving team state.
- Checkpoints agent team state (TeamCreate, SendMessage, tasks) every 30 seconds so auto-compaction can't silently discard it.
- Writes logs and a PID file to
/tmp/cozempic_guard_*so you can check status or stop the daemon at any time.
Who it's for
- Anyone whose long sessions keep hitting compaction and losing context.
- Teams running multi-agent orchestration where losing team state is costly.
- Developers doing multi-hour refactors or debugging inside one session.
Examples
- Say "turn on guard" → the daemon starts with the recommended
--threshold 50 -rx standard --interval 30. - Prune earlier without restarting Claude:
cozempic guard --daemon --threshold 30 --no-reload. - Check status with
ls /tmp/cozempic_guard_*.pid, review activity withtail -20 /tmp/cozempic_guard_*.log, and stop withkill "$(cat /tmp/cozempic_guard_*.pid)".
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/Ruya-AI/cozempic/HEAD/plugin/skills/guard/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the plugin/skills/guard folder from the GitHub repo Ruya-AI/cozempic into my ~/.claude/skills/guard/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/Ruya-AI/cozempic.git && mkdir -p ~/.claude/skills && cp -r cozempic/plugin/skills/guard ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/Ruya-AI/cozempic.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy the skill in:
cp -r cozempic/plugin/skills/guard ~/.claude/skills/ - This skill requires the
cozempicCLI. Follow the repo README to install it, then verify withcozempic --help. - Restart Claude Code and ask it to "turn on guard" to start the daemon.
- Confirm it's running with
ls /tmp/cozempic_guard_*.pid; stop it later withkill "$(cat /tmp/cozempic_guard_*.pid)".
View source on GitHub ↗License: MIT