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.
npx agentmods add commands/littlebearapps/contextdocs/context-guardgit clone --depth 1 https://github.com/littlebearapps/contextdocsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00021 | $0.01770 |
| Opus 5 | $0.00010 | $0.00885 |
| Sonnet 5 | $0.00004 | $0.00354 |
| Haiku 4.5 | $0.00002 | $0.00177 |
Grade A, and why
context-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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/context-guard
Install opt-in hooks that detect stale AI context files, remind you to update them, and prevent content filter errors when generating standard OSS files. Claude Code only — these hooks use Claude Code's PreToolUse, PostToolUse, and Stop hook system, which is not supported by OpenCode, Codex CLI, or other AI coding tools.
Context Guard has two enforcement tiers:
- Tier 1 — Nudge (default): Advisory. A Stop hook suggests updating context docs before the session ends. Claude can still stop if context docs genuinely don't need changes.
- Tier 2 — Guard (opt-in): Blocking. A PreToolUse hook blocks
git commitwhen structural files are staged without context doc updates.
Behaviour
- Load the
context-guardskill for reference - Execute the requested action:
install,install strict,uninstall, orstatus
Arguments
-
install: Install Context Guard (Tier 1) into the current project:- Create
.claude/hooks/directory if it does not exist - Copy
context-drift-check.sh,context-structural-change.sh,content-filter-guard.sh,context-guard-stop.sh,context-session-start.sh, andcontext-forced-eval.shfrom the plugin'shooks/directory to.claude/hooks/ - Make the scripts executable (
chmod +x) - Create
.claude/agents/directory if it does not exist - Copy
context-updater.mdfrom the plugin's.claude/agents/directory to.claude/agents/context-updater.md - Merge PreToolUse, PostToolUse, SessionStart, UserPromptSubmit, and Stop hook entries into
.claude/settings.json(create the file if needed; if entries already exist, append without overwriting). Useif: "Bash(git commit*)"forcontext-drift-check.shso it only fires aftergit commit(Claude Code v2.1.85+); older versions fall back to the in-script substring guard. - Copy
context-quality.mdto.claude/rules/context-quality.md(create directory if needed) - Report what was installed
- Create
-
install strict: Install Context Guard (Tier 1 + Tier 2) into the current project:- Perform all steps from
installabove - Additionally copy
context-commit-guard.shfrom the plugin'shooks/directory to.claude/hooks/ - Add a PreToolUse hook entry for
context-commit-guard.shto.claude/settings.jsonusingif: "Bash(git commit*)"so it only fires ongit commit(v2.1.85+); older Claude Code versions fall back to the in-script guard - Report what was installed, noting Tier 2 is active
- Perform all steps from
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.
- yesterday First seen · 115 lines · 21 tokens per session scan A 5a09ea177219
context-guard is a command published in the GitHub repository littlebearapps/contextdocs (5 stars, last pushed 1mo ago), licensed MIT. It adds 21 tokens to every session and 1,770 once invoked, about $0.0001 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-31.
Other commands, from other repositories
compact-prep
Ask the agent to prepare for conversation compaction by updating any relevant state and providing guidance for the compaction agent and to kick off the session there after.
score
Run bun-sticky on the current directory to check FAF score.
test
Run the championship-grade test suite and report results.
save
Save this conversation as a new or existing reusable context.
brownfield-map
Run a complete brownfield analysis on the codebase and generate MASTER.md, summaries, risk scores, and all derived analytics.
checklist
Generate a custom checklist for the current feature based on user requirements.