Protocol
Keep the decision; make the transcript recoverable
A long-running agent can produce thousands of lines while the next useful action depends on five facts. Compaction is the handoff between those two scales. The handoff should say what was decided, why, what remains open, where the current artifacts live and how to check the next move. Its quality is measured by whether work can resume accurately, not by how short the summary looks.
Before you use it
- Use when
- A long context contains large raw tool outputs and repeated discussion that crowd out current task state.
Keep this limit in mind
- Over-aggressive compaction can silently remove a detail that matters later; favor recall before token efficiency.
Current editorial reading
Save the state that changes the next action
Imagine an agent preparing a site release. It tested the new page, found a broken link, fixed it and then stopped before deployment. A useful handoff names the tested commit, the fixed route, the test result, the remaining deployment step and the reason the work stopped. It does not need the full console log in the next prompt. Anthropic describes a similar approach in its context-engineering guidance: preserve decisions, unresolved problems and implementation details while clearing redundant tool output. That is an engineering pattern, not a guarantee that every automated summary keeps the right details.
Leave a route back to what you removed
A short note cannot anticipate every future question. Keep stable paths, commit IDs, report names or other references that let the next agent reopen the original evidence when a consequential detail matters. A decision without its reason may be reopened; a reason without its source can become an invented fact. Separate the current working summary from a durable record of events or artifacts. Anthropic's later account of managed agents makes the cost of deletion explicit: once compacted messages leave the active context, they can be recovered only if the system stored them elsewhere.
Test a handoff by resuming the work
Give the compacted state to a fresh agent or reviewer and ask three questions: What has already been verified? What is still uncertain? What action is allowed next? Compare the answers with the durable artifacts. If the new agent repeats a completed step, invents an approval or misses a stop condition, the handoff failed even if it reads smoothly. Start with generous recall on difficult traces, then remove details shown to be redundant. This is a proposed quality check for the workflow, not a measured claim that one summary format improves all agents.
When a summary is the wrong store
Do not use the next context window as the only copy of a decision, an exact source excerpt needed for audit, or a result that cannot be reproduced cheaply. Keep those in an appropriate durable system and point to them from the handoff. Limit what the agent can save: secrets, private customer data and irrelevant raw logs should not be copied into a broad shared note. When the original material is unavailable, say that the summary is incomplete and recheck the fact before acting on it.
Take it with you
Compress the working view, not the evidence trail. Record decisions with reasons, unresolved work, exact artifact references and the next permitted action. Keep important originals recoverable, then test whether a fresh reader can resume without guessing. If an irreversible step depends on a detail absent from the handoff, reopen the source before proceeding.
Sources and evidence (2)
What we checked
Anthropic describes a compaction approach that preserves architectural decisions, unresolved bugs and implementation details while discarding redundant tool outputs or messages.
This is a first-party account of an engineering practice, not a controlled estimate of its effect across agents or tasks.
Effective context engineering for AI agents · Context engineering for long-horizon tasks, Compaction
Anthropic warns that aggressive compaction can lose subtle context whose importance becomes apparent later, and advises testing on complex traces with recall before brevity.
This limits any advice to delete old context merely to reduce tokens; the proposed resume check is an editorial operationalization, not a validated intervention.
Effective context engineering for AI agents · Context engineering for long-horizon tasks, Compaction
Anthropic's managed-agent design treats the event session as durable storage because discarded context can cause failures and compacted messages are recoverable only when stored elsewhere.
This challenges treating a compact summary as a complete archive. It is a vendor design account, not evidence that every product needs the same storage architecture.
Scaling Managed Agents: Decoupling the brain from the hands · The session is not Claude's context window
Editorial sources (2)
- Effective context engineering for AI agents — Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, Jeremy Hadfield
- Scaling Managed Agents: Decoupling the brain from the hands — Lance Martin, Gabe Cemaj, Michael Cohen
Save and practise this idea
My learning
Read. Recall. Repeat.
Save this idea and return to it on any device.
Keep exploring
Connected ideas
You are readingKeep the decision; make the transcript recoverable
Ideas that link here
These ideas link to this one. Check their conditions and limits before use.
Useful with this ideaTreat context as a budget, not a transcript
More from this collection
Make the agent loop finish, recover and stay inspectable
Retrieve context just in time instead of preloading the whole projectOriginal edition evidence and sources
These records belong to the original released edition. The current editorial reading has its own evidence above; neither set silently replaces the other.
Anthropic recommends compaction that preserves key decisions, unresolved work and implementation details while removing redundant tool outputs.
Over-aggressive compaction can silently remove a detail that matters later; favor recall before token efficiency.
Effective context engineering for AI agents · See source record
All sources (1)
Original edition, downloads and provenance
The reading above is editorial version 1.0.0, bound to this exact source edition. The original data and saved downloads retain that edition and the separate editorial layer. They may contain earlier wording; use the current reading above when interpreting it.
Version 0.1.0
No review details are supplied for this edition.
Read the original edition and overlay as JSON · Release details