Glossary
Agent ArchitectureEmerging

Context Hygiene

The monthly practice of auditing the Context Index for staleness, redundancy, and gaps to maintain the quality of agent-consumed knowledge.

Definition

Context Hygiene is the monthly practice of auditing the Context Index for staleness, redundancy, and gaps. Agent output quality degrades when the knowledge base they consume contains outdated information — deprecated API schemas, superseded architectural decisions, or stale domain documentation. Context Hygiene prevents this degradation through systematic review.

The ceremony is owned by the Context Architect and typically runs two to four hours depending on the size of the Context Index.

Activities include:

  1. Remove deprecated content — identify and archive API schemas for retired endpoints, outdated library documentation, superseded architectural decision records, and code samples that reference deprecated patterns. Leaving deprecated content in the Context Index risks agents generating code against interfaces that no longer exist.
  2. Add context for new systems — when new services, APIs, or modules have been introduced since the last review, add their schemas, documentation, and relevant Golden Samples to the Context Index. Gaps in coverage force agents to infer behavior rather than reference documentation, increasing the Correction Ratio.
  3. Validate Live Spec references — check that active Live Specs reference current sources in the Context Index. A spec that references a stale API schema will produce agent output that compiles against the wrong interface. This cross-referencing catches broken links between specs and the knowledge they depend on.
  4. Deduplicate and consolidate — identify redundant entries that cover the same information in different formats or at different granularities. Redundancy wastes Token Budget when agents retrieve overlapping content and increases the risk of conflicting information.

The cadence is monthly because Context Index drift is gradual — individual entries do not go stale overnight, but over weeks the cumulative effect is measurable. Teams with rapidly evolving codebases or frequent API changes may benefit from biweekly reviews.

Context Hygiene sits within the broader monthly ceremony cadence alongside the Boundary Audit and the FinOps Review.

Last updated: 3/11/2026