Context Hygiene
Practices for actively managing, pruning, and maintaining the quality of AI context throughout its lifecycle to prevent degradation.
Category: AI
Tags: ai, context-engineering, context-management, ai-context-patterns
Explanation
Context hygiene is the practice of actively managing, pruning, and maintaining the quality of AI context throughout its lifecycle. It is a key principle of context engineering: actively manage context throughout a conversation; clear, compact, or reset when context becomes bloated.
Without hygiene practices, AI context inevitably suffers from context bloat (accumulation without pruning), context drift (gradual misalignment with reality), and context rot (overall quality degradation over time).
## Concrete Hygiene Practices
- **Pruning**: regularly removing outdated, redundant, or contradictory entries from CLAUDE.md files, memory systems, and skills
- **Consolidating**: merging multiple entries that say similar things into a single, authoritative statement
- **Timestamping**: adding dates to context entries so staleness is visible
- **Validating**: periodically checking that referenced files, functions, tools, and conventions still exist
- **Scoping**: ensuring each context entry has a clear purpose and audience; removing vague or aspirational entries
- **Versioning**: keeping context in version control so changes are traceable and reversible
## An Ongoing Discipline
The key insight is that context maintenance is not a one-time setup task. It is ongoing work, similar to code maintenance or knowledge management. The higher the level of AI context management, the more surface area requires hygiene. Teams and enterprises face exponentially more context surface to maintain than individuals, making systematic hygiene practices essential at scale.
Related Concepts
← Back to all concepts