Compaction
also called Summarisation, Context compression
Replacing old context with a shorter summary of it.
Compressing a long conversation or tool history into a summary that preserves what matters, freeing window space while keeping continuity. Usually a model call in itself.
Compaction is lossy and it compounds — compact a compacted history and detail erodes. Summarise conservatively, and keep original artifacts on disk so they can be re-read.
Compaction is lossy and it is a model call, so it is neither free nor guaranteed faithful. Treat it as a managed trade: you are buying headroom at the cost of detail, and the summary has to be checked against the goal rather than trusted.
Compaction that dropped the constraint
Work continues correctly after compaction but a requirement is silently violated.
The summariser kept the narrative and dropped the constraint list. Keep hard constraints pinned outside the compacted region — in the system prompt, in a file, or in the task list — so they cannot be summarised away.
- blogEffective context engineering for AI agents ↗
Defines context engineering as curating everything supplied at inference, names context rot, and covers just-in-time retrieval, compaction and keeping the window high-signal.
- docsContext windows ↗
What actually consumes the window — input, tools, thinking and output — plus context rot and compaction. Authoritative for this product, not for models generally.
- docsAgents ↗
Compares a managed hosted agent, an in-app SDK loop, and the raw Responses API, including sessions, handoffs, approvals, sandboxing and compaction.
Autocompact
Compaction that fires automatically as the window fills.
Clearing · Context reset
Deliberately throwing away the context to get a clean head.
Handoff
Passing work to a fresh context, deliberately and with a written brief.
Context Window
The hard ceiling on how much the model can see at once.
Session
One continuous run of work with the agent, with its own accumulated history.