Definition
What is Context Pruning?
Last updated
The practice of removing or masking older, low-signal content, usually stale tool observations, from an AI agent's context window as a trajectory grows.
Context pruning keeps a long-running agent's window focused by dropping observations it has likely stopped attending to, but its value is regime-dependent: it helps when a strong retriever feeds a mid-capacity model and hurts once the model is accurate enough to filter its own context. Unlike context compression, which rewrites content into fewer tokens in place, pruning evicts content outright, so it trades a leaner window against the risk of losing evidence the agent later needs.
Further reading
Articles about Context Pruning
Pruning context made agents more accurate, not just cheaper
Pruning an agent's tool history raised task completion from 71% to 91.6%. What the summary rescued was not content but the agent's place in its own work.
Context pruning helps agents, until it doesn't
Context pruning helps AI agents in one regime and hurts in another. A 2026 study of models from 4B to 284B maps when to prune stale context and when not to.
All terms
View full glossaryPut context into practice
Create your first context container and connect it to your AI tools in minutes.
Create Your First Container