context-hygiene-kit

Installation
SKILL.md

Context Hygiene Kit

The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY in this skill are to be interpreted as described in BCP 14 (RFC 2119, RFC 8174) when, and only when, they appear in all capitals.

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:

Installs
31
GitHub Stars
3
First Seen
Jun 17, 2026