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/ai-sdlc-framework/ai-sdlcWrote 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/ai-sdlc-framework/ai-sdlc/context-hygiene)<a href="https://agentmods.dev/commands/ai-sdlc-framework/ai-sdlc/context-hygiene"><img src="https://agentmods.dev/badge/commands/ai-sdlc-framework/ai-sdlc/context-hygiene/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/ai-sdlc-framework/ai-sdlc/context-hygiene"><img src="https://agentmods.dev/badge/commands/ai-sdlc-framework/ai-sdlc/context-hygiene.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.00037 | $0.00581 |
| Opus 5.5 | $0.00015 | $0.00232 |
| Sonnet 5.5 | $0.00007 | $0.00116 |
| Haiku 4.5 | $0.00004 | $0.00058 |
Grade A, and why
context-hygiene 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 — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hygiene pass for the context engine (RFC-0053). Adapted from the knowledge-hygiene mechanics of the data-room kit. Run it monthly (--monthly runs the full audit) or on demand.
Rules (hard)
- Never change authority. Promotion is the verifier's or a human's job; hygiene does not promote, demote or relabel.
- Never delete an entry. Hygiene only reads entries and reports. Corrections go through
/ai-sdlc context-captureas a superseding entry. - Stale means a question, not a fact. Freshness = 0.5^(age / half-life). An entry with freshness below 0.3 is reported under "Questions to re-verify", phrased as a question using its
reverify:note, never as a statement of fact. - Contradictions become Decision Catalog items. Detect pairs of entries joined by a
contradictsrelation or stating incompatible values for the same subject. Raise each with:node "$PIPELINE_CLI_BIN/cli-decisions.mjs" add \ --summary "Knowledge contradiction: <subject>" \ --body "<entry A id and value> conflicts with <entry B id and value>. Sources: <citations>." \ --scope workspace \ --source emergent-finding \ --option "keep-a:Keep <entry A id>" \ --option "keep-b:Keep <entry B id>" \ --option "neither:Supersede both with a corrected entry" - At most 3 contradictions are raised per run. Rank by effective confidence (confidence x freshness), raise the top 3, and list the remainder in the report as "deferred to next run".
- Running code outranks every written entry: when one side of a contradiction can be checked against the tree, say so in the body.
Steps
- Load all entries from both knowledge roots (skip nothing for scope; do not copy protected content into any tracked file or decision body, cite entry ids only for protected entries).
- Compute freshness per entry; collect stale entries (below 0.3).
- Detect contradictions; raise up to 3 per rule 4 and 5.
- Print the report: contradictions raised (with DEC ids), deferred contradictions, questions to re-verify, and entry counts by band.
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 · 37 lines · 37 tokens per session scan A 2b148cbe94bc
context-hygiene is a command published in the GitHub repository ai-sdlc-framework/ai-sdlc (428 stars, last pushed today), licensed Apache-2.0. It adds 37 tokens to every session and 581 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-11-01.
Other commands, from other repositories
compact
Replaces the built-in /compact command and runs automatically on every message.
discover
Discover runtime AI components and static AI dependencies with AIR Blackbox.
replay
Replay recorded AI traces to detect behavioral drift between model versions.
evidence
Export a signed compliance evidence package as JSON or PDF for regulatory handoff.
comply
Run a full EU AI Act compliance scan on your Python AI project.
ai-act-ask
Answer an EU AI Act question grounded in the bundled knowledge base — verbatim statute text, obligation paraphrases, and the compound-risk taxonomy. Offline and deterministic by default; cites the articles it relies on.