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.
git clone --depth 1 https://github.com/littlebearapps/contextdocsWrote 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.
[](https://agentmods.dev/commands/littlebearapps/contextdocs/context-guard)<a href="https://agentmods.dev/commands/littlebearapps/contextdocs/context-guard"><img src="https://agentmods.dev/badge/commands/littlebearapps/contextdocs/context-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.
<a href="https://agentmods.dev/commands/littlebearapps/contextdocs/context-guard"><img src="https://agentmods.dev/badge/commands/littlebearapps/contextdocs/context-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.01770 |
| Opus 5.5 | $0.00008 | $0.00708 |
| Sonnet 5.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 3mo 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.
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.
- 3mo ago 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 4mo ago), licensed MIT. It adds 21 tokens to every session and 1,770 once invoked, about $0.0001 per session on Opus 5.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.
context-guard compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| context-guardlittlebearapps/contextdocs | Command | 5 | 4mo ago | MIT | A | 21 | Claude Code |
| compact-prepsammcj/agentic-coding | Command | 174 | today | Apache-2.0 | A | 30 | Claude Code |
| checkdeepfusionlabs/deep-init | Command | 6 | 2mo ago | MIT | A | 36 | Claude Code |
| octo-pipelinenyldn/claude-octopus | Command | 4.5k | today | MIT | A | 15 | Claude Code, Cursor |
| init-workspace-flow-questionsgriddynamics/rosetta | Command | 382 | today | Apache-2.0 | A | 16 | Claude Code |
| recall-saveraiyanyahya/recall | Command | 770 | 2mo ago | MIT | A | 15 | Claude Code |
| captureconorbronsdon/agent-context-os | Command | 36 | 13d ago | MIT | A | 16 | Claude Code |