Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/wrg32786/aigent-osnpx agentmods add skills/wrg32786/aigent-os/context-hygieneWrote 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/skills/wrg32786/aigent-os/context-hygiene)<a href="https://agentmods.dev/skills/wrg32786/aigent-os/context-hygiene"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/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/skills/wrg32786/aigent-os/context-hygiene"><img src="https://agentmods.dev/badge/skills/wrg32786/aigent-os/context-hygiene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Anti-Refusal · line 55 Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.Fix: Remove instructions that suppress warnings, disclaimers, or ethical commentary. Let the agent surface safety-relevant caveats to the user.
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.00033 | $0.00750 |
| Opus 5.5 | $0.00013 | $0.00300 |
| Sonnet 5.5 | $0.00007 | $0.00150 |
| Haiku 4.5 | $0.00003 | $0.00075 |
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 4d 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 — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/context-hygiene
This is the sole bounded compaction exception to the Session Log chronicle. It runs only when invoked, never while the framework is being installed or tested against a real vault.
Precondition
- Read
vault/memory/SESSION_LOG.mdandvault/memory/ACTIVE_PRIORITIES.md. - Hash both exact byte streams with SHA-256.
- Run:
node daemons/nightly-context-hygiene.mjs --root <aigent-root>
Green means no edit is needed. Red permits only the bounded archive below. Unreadable or unfamiliar content is a failure, not permission to rewrite.
Session Log archive
Live entries appear newest first by date. A capsule entry is one line in the
form - YYYY-MM-DD capsule-id: summary. The date must be a real calendar
date. The capsule id and its optional preceding short name are each one token
without whitespace. The summary must have text on the same line.
Capsule lines go above the dated blocks, and a dated line inside a block is part of that block.
The checker treats frontmatter as ordinary text, so keep lines starting with a dash and a date or with ## and a date out of it, and keep fence markers balanced.
A dated H2 block starts with ## YYYY-MM-DD - title and contains one
nonempty occurrence of each bold field listed below.
ObjectiveCompletedDecisionsOpen threadsNext action
Archival rules:
- Keep the newest five entries across both formats.
- Move older entries as whole lines or whole blocks to
vault/memory/SESSION_LOG_ARCHIVE_<YYYY-MM-DD>.md. - Preserve source text and order.
- Preserve frontmatter, title, schema guidance, and archive links.
- Dedupe one-line entries by exact line and blocks by exact dated heading plus block hash.
- Refuse a block whose boundary cannot be determined without judgment.
Active Priorities archive
The mechanically checkable live shape contains:
- exactly one
## Operating Mode: <mode>heading; - one to five live bullet priorities under
## Tier 1,## Tier 2, or## Tier 3headings; - no placeholder priority;
- one valid
Last reviewed: YYYY-MM-DDline; and - no embedded
## Archivedsection.
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.
- 4d ago Changed · +6 lines 39817a9161bc
- 23d ago Changed · -6 tokens per session 555687e99f0f
- 3mo ago First seen · 82 lines · 39 tokens per session scan A 7672f45c749b
context-hygiene is a skill published in the GitHub repository wrg32786/aigent-os (26 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 750 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-09-01.
context-hygiene compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| context-hygienewrg32786/aigent-os | Skill | 26 | today | MIT | A | 33 | Claude Code |
| distillhiphapis/loopcraft | Skill | 2 | 4mo ago | none | A | 80 | Claude Code |
| memory-to-skillzilliztech/memsearch | Skill | 3.0k | 3d ago | MIT | A | 82 | Claude Code, Codex |
| memory-recallzilliztech/memsearch | Skill | 3.0k | 3d ago | MIT | A | 152 | Claude Code |
| learnAgentToolkit/altk-evolve | Skill | 143 | 4d ago | Apache-2.0 | A | 40 | Claude Code, Codex |
| evolve-lite:retentionAgentToolkit/altk-evolve | Skill | 143 | 4d ago | Apache-2.0 | A | 34 | Claude Code, Codex |
| adapt-memoryAgentToolkit/altk-evolve | Skill | 143 | 4d ago | Apache-2.0 | A | 23 | Claude Code |