context-hygiene-kit
Installation
SKILL.md
Context Hygiene Kit
Two failure modes of long agent sessions, one mechanism:
| Failure | What it is | Fix |
|---|---|---|
| Bloat | context grows unbounded as a session runs until responses degrade | a token-budget-bounded scored cache — eviction caps the window forever |
| Rot | compaction summarizes away the specific facts that mattered (decisions, constraints, file:line refs) and keeps vague narrative | lossless verbatim preservation of high-salience kinds into a durable digest, refreshed before compaction |
The whole kit is one data structure — a ContextLedger (bounded scored cache + tiered persistence) — plus the hooks that feed and flush it. It is itself a self-prompting loop (autonomous family); the 10-slot loop spec lives in references/loop-spec.md. The deep design rationale is in references/architecture.md; the capture rules and trust boundary are in references/capture.md. Read those when you need detail — the summary below is enough to install and operate it.
Install
This is a one-time setup. Ask the user which scope they want, then run the installer once:
scripts/install.sh /path/to/project # PROJECT scope — just this repo (default: cwd)
scripts/install.sh --global # GLOBAL scope — every project, via ~/.claude