guard

guard is a skill for Claude Code from Ruya-AI/cozempic. It costs 64 tokens per session (435 once invoked), scanned A, original, MIT.

A background monitor for Claude Code sessions that watches session size and saves team state before the context becomes too large. Context is the information an agent can keep available while working.

In plain words
What is it for?
Use it during long sessions or agent-team work to checkpoint state, prune excess context, and optionally reload while preserving that state.
Why use it?
It reduces the risk of losing session or team information when automatic shortening or reloading occurs.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Part of the cozempic plugin — 5 skills shipped together

Good fit Use it during long sessions or agent-team work to checkpoint state, prune excess context, and optionally reload while preserving that state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ruya-ai/cozempic/guard
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Ruya-AI/cozempic --skill guard
Clone the repo
git clone --depth 1 https://github.com/Ruya-AI/cozempic

Made for: Claude Code.

Or install cozempic, the plugin that ships this one along with the rest of its 5 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/ruya-ai/cozempic/guard/github.svg)](https://agentmods.dev/skills/ruya-ai/cozempic/guard)
Your own site
<a href="https://agentmods.dev/skills/ruya-ai/cozempic/guard"><img src="https://agentmods.dev/badge/skills/ruya-ai/cozempic/guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/ruya-ai/cozempic/guard"><img src="https://agentmods.dev/badge/skills/ruya-ai/cozempic/guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 435 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.00435
Opus 5 $0.00032 $0.00217
Sonnet 5 $0.00013 $0.00087
Haiku 4.5 $0.00006 $0.00044

Measured 9d ago against content hash 3981ba0555d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

guard scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/skills/guard/SKILL.md · 47 lines

What it actually says

Start the cozempic guard daemon for continuous session protection.

cozempic guard --daemon --threshold 50 -rx standard --interval 30

This runs in the background and:

  1. Checkpoints team state every 30 seconds
  2. At 60% of threshold (30MB): applies gentle prune, no reload
  3. 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

The daemon writes to /tmp/cozempic_guard_*.log. Check with:

ls /tmp/cozempic_guard_*.pid 2>/dev/null        # is it running?
tail -20 /tmp/cozempic_guard_*.log 2>/dev/null   # recent activity
kill "$(cat /tmp/cozempic_guard_*.pid)"           # stop it
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 47 lines · 64 tokens per session scan A 3981ba0555d0

Subscribe to this mod's changes

guard is a skill published in the GitHub repository Ruya-AI/cozempic (404 stars, last pushed 2mo ago), licensed MIT. It adds 64 tokens to every session and 435 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.