Context Compaction
What must survive when an agent can no longer carry its whole history?
Start with the first report → See all reports ↓Overview
When an agent shortens its history, the next response still has to advance the same task. A summary can preserve many facts while losing the condition that determines which action is right. This pair asks what a compressed handoff must retain and how to inspect whether an implementation actually carries it forward.
The first report develops the continuation criterion: preserve the current request, constraints, completed work and reasons to recover displaced detail. The second follows that question into checkpoints, retained messages, cleared results and the caller that builds the next model request. Read the principle before the code, then use the code to ask exactly what survives the handoff.
A smaller input succeeds when the task can still continue
Preserve the next action
Retain the task, permissions, progress and reasons to recover detail.
Inspect the next request
Follow saved state and omitted detail into real callers.
The second report follows the first report’s preservation question into concrete implementation paths.
Reading order
A recommended path through the enquiry. Each report explains its part; continuation links preserve the original branches.
- Preserve the task across compressionWhat an Agent Must Keep When It Compresses Its History
Defines the continuation test: keep what determines the next action and make displaced detail recoverable when it matters.
Start here - Follow the checkpoint into codeHow memory compaction changes an agent’s next request
Examines how actual implementations rebuild the next request, making the preservation question inspectable at the caller boundary.
Further reading
Examines how advertised capacity differs from task-specific use, for readers who want the broader context-window evidence.