context-hygiene · activeKeeping its own context clean
Agents fill their working context with re-read files, restated notes, and excess documentation until quality degrades.
Also called: context management, over-documentation, context bloat
Tags: autonomous-agent, coding-agent, context
Over a long task, a capable agent keeps only relevant material in its working context, summarizes what it has learned instead of re-reading it, and writes notes and documentation in proportion to their value.
Claims
- mechanismsingle paperAdding irrelevant tokens alone degrades reasoning, which is the mechanism by which a bloated context hurts an agent.
- observationsingle paperHanding an agent context-editing tools (delete, summarize, note, fold) by prompt alone makes mid-size models worse than leaving their context untouched — Qwen3-8B, Qwen3-14B and Gemma4-E4B all scored lower on long-context QA with the tools than without them; only after fine-tuning on trajectories that use the tools does the toolset become a gain.
- mechanismsingle paperManaging context explicitly, paging information in and out of a bounded window, sustains performance on tasks that exceed the window.
- observationsingle paperGuardrail instructions written to stop older models doing the wrong thing — blanket prohibitions, repeated warnings, defensive defaults — became dead weight in the Claude 5 generation: Anthropic removed over 80% of Claude Code's system prompt for Opus 5 and Fable 5 with no measurable loss on its own coding evaluations, on the reading that the constraints now conflict with each other and with user intent more often than they prevent harm.
Techniques
- Keep a guide file of past failuresprocessA versioned instruction file the agent reads before acting, where every line is a past failure converted into a permanent rule.
- Tiered memory managed by the modelarchitectureKeep a small working context and let the model page facts in and out of external storage.
Capabilities are a way of carving up the subject, and carvings are arguable. Say so if this one is wrong — especially a proposed one, which a pipeline added because several papers used the same framing, not because anyone decided it was right.