Glossary · Phase 10 · Agent harnesses
Compaction
Replacing the older part of a conversation with a summary, keeping recent turns, so a long task fits in the context window.
Try it now
The cut starts on a user message of tool results, so it steps back once, to the assistant message that made those calls.
Learn it properly
Managing the context window · Budgets, clearing old tool results, compaction and a cacheable prefix. About 40 minutes.
Other terms from the same lesson
- context editing: Removing or shrinking parts of a conversation, such as old tool results, to save space. The Claude API can do it on the server.
- context rot: The drop in a model's accuracy as its context fills with old or irrelevant material.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.