Day 11 · Reset the Loop When Context Decays
Day 8 made the loop the unit of work. Day 9 cut turns by planning the route. Day 10 cut turns by shaping the tool. Days 8–10 all worked on the same lever — fewer turns per task. This issue works on a different one. When the turns you do run carry more weight than they need to, the cost of each later turn climbs even when the work itself is not getting harder.
Here is the observation that opens it. An agent runs for fifteen turns to complete a task. Turn one costs around a thousand input tokens. By turn fifteen, the cost may be several times higher. The agent did not get harder questions along the way. It accumulated history. Most of that history is the agent’s prior reasoning, intermediate tool outputs, retracted plans, and temporary working notes that no later turn ever reads — but every later turn re-processes all of it, because the model has no way to know what is residue and what is signal.
A loop’s context is two different things sharing the same window. One is working memory — the small set of facts the next turn actually depends on. The other is residue — the by-products of getting here that no future turn will use. Both are re-processed on every turn. Telling them apart, and dropping the residue before it starts costing more than the work, is the lever this issue is about.
A document-analysis agent reviews a stack of contracts to flag clauses that need legal attention.
By turn five the agent was moving cleanly. By turn twelve, cost had tripled. By turn twenty, it had started revisiting clauses it already reviewed, while per-turn cost exceeded the first several turns combined.
Nothing changed about the task. What changed was the weight of the loop carrying the agent.
Three patterns showed up when the team looked at the trace.
The undecaying transcript. Every prior turn — including ones the agent itself had marked as wrong and corrected — was still in the window, getting re-read on every turn after it. The agent’s own retracted reasoning was being treated as input the same as the contract.
The stale anchor. An instruction set at turn one (“review every clause for renewal terms”) was still anchoring later turns at turn twenty, even though renewal terms had been fully covered by turn eight. The agent kept reaching for them anyway, because the instruction was still in front of it.
The compounding residue. Each tool call had returned a verbose payload. The agent had used three lines of each one and ignored the rest. All of it was still there, on every turn, paying for itself in tokens.
The fix was not a smarter agent. It was a fresh loop, started at turn nine, with a four-line summary of what the previous eight turns had concluded — the clauses already reviewed, the flags already raised, the remaining clauses to cover. That loop finished the work in seven more turns. The old loop, left to run, would have taken sixteen.
Context the loop will use on the next turn is memory. Context the loop won’t is weight.
The continuity question
The obvious objection: doesn’t resetting the loop break the agent’s coherence? Doesn’t it lose context the agent needs to keep the task on track?
The trade-off is simple — and the answer depends on what “context” is doing.
Most context is by-product, not memory. In a long loop, the majority of the window is intermediate reasoning, verbose payloads, and instructions the agent has already absorbed. None of it is being used on the next turn. All of it is being re-processed.
The signal is often paragraph-sized. What the next turn actually needs from the last ten is usually a short list of facts — what is done, what is pending, what was decided, what was ruled out. The full transcript is one way to carry it; a paragraph is the cheaper one, and once written, the better one.
Reset is not erase. The fresh loop starts with the distilled summary, not a blank slate. The agent picks up where the old loop left off, with the same goal and the same conclusions — just without the residue it was paying to drag along.
The simple rule: if a turn’s cost is climbing faster than the task is progressing, the loop is carrying weight that the task no longer needs. That is the moment a fresh loop is cheaper than another turn of the old one.
A loop that cannot reset is a loop that pays for its past, forever.
The operating ladder for context across a long loop has four rungs:
Detect → Distil → Reset → Resume.
Detect the decay before it has compounded. Two signals make it visible. The first is per-turn cost climbing while task progress is flat — every later turn is doing the same amount of work for more money. The second is the agent re-doing work it has already done — re-flagging a clause it already flagged, re-asking for a fact already retrieved, re-planning a step that was already settled. Both are symptoms of a window full of context the agent can no longer separate from the signal.
Distil what the next loop actually needs. The working set — the facts, decisions, and remaining steps the next turn actually depends on — is usually small enough to write in a paragraph. The move is to write it explicitly. The agent itself can be asked to produce it: what is done, what is pending, what was decided, what was ruled out. If you cannot say what the agent will use on the next turn, you are paying for context the loop is not using.
Reset the loop with the distilled summary as the new starting state. Drop the residue — the retracted reasoning, the verbose tool payloads, the early instructions that have already been satisfied. Start a fresh loop with only the summary, the goal, and the tools needed for what remains. A reset is not a restart. The work continues; the weight does not.
Resume the task inside the new loop. The agent should be unable to tell, by behaviour, that it was reset — same goal, same tools, same direction. The only difference is that turn one of the new loop costs what turn one of the old loop cost, instead of what turn fifteen would have. The savings are not in any single turn. They are in every turn the new loop runs that the old loop would have paid more for.
Five seats read this issue differently — and all five matter.
Engineering owns the trace. Per-turn input token counts should be charted across the life of every loop in production. The shape to look for is the cost curve rising while the task-completion curve is flat. That is the signature of context decay. Once it is visible, a “distil-and-reset” path is a small piece of code — a prompt that asks the agent to summarise its working state, plus the wiring to start a new loop with that summary as the only carry-forward.
Platform/Infrastructure makes the signal default, not opt-in. Context size per turn, turn-over-turn growth rate, and a decay indicator belong alongside turn count and total tokens on the platform’s standard loop dashboard. The reset path itself is best provided as a platform capability so every team gets it the same way — not reinvented per agent. Reset thresholds, like loop budgets in Day 8, are policy that should be set centrally and tuned per workload.
Architecture/CTO treats the loop’s memory as a distinct architectural layer with its own lifecycle. Working memory, full transcript, and tool-output history are three different things, even when they share the same context window today. Naming them separately — in design, in code, in reviews — is how reset becomes routine instead of heroic. As agent runtimes mature, memory layers will increasingly be handled natively. Teams that already separate working memory from transcript history will adapt faster.
Sustainability/ESG sees the lever most teams never reach for. Context re-processing in long loops is the kind of waste that does not show up as a slow request or a failed run — it shows up as a cloud bill that is bigger than it should be, and a compute footprint that is larger than the task warrants. Distilling and resetting reduces the same loop’s cost on every later turn, not just the one being fixed. Compounding savings, paid for once.
Business/Product gets the user-facing win. A fresh loop with the right summary is faster, cheaper, and often more accurate than a tired loop dragging twenty turns of residue. Users feel the speed. Finance feels the cost. Engineering feels the simpler trace. The same operational move serves all three.
Five seats, one reset path, one shared definition of when to take it.
Pick the longest-running agentic loop in your production stack. Pull the per-turn input token count for the last hundred runs and plot it against task progress. If the cost curve rises while the progress curve flattens, you have found a loop that is paying to carry context it no longer uses.
For that loop, define one threshold — a turn count, a context size, or a cost-per-turn ceiling — past which the loop distils its working state and resets. Wire the distil step as a small prompt the agent itself answers: what is done, what is pending, what was decided, what was ruled out. Start the new loop with that summary as the only context carried forward.
Compare end-to-end run cost against your pre-reset baseline. If it drops, you have just removed a recurring tax from every future long run of this agent — a saving that compounds, not a one-off.
One caution, so you do not over-correct. Not every loop needs a reset. Short loops complete before context decay starts. Loops that genuinely need the full transcript — multi-document reasoning, long-horizon planning where every earlier step truly informs the next — should keep it. Reset is for the loops where the agent is dragging residue, not signal. Tell the difference on the trace, not on intuition.
One trace, one threshold, one reset path. That is the work.
An old loop carries everything forward. A fresh loop carries only what matters.
Days 8–11 optimised the loop from four angles: visibility, planning, tool shape, and context reset. That closes the loop chapter. Next comes the platform underneath it — caching, batching, and placement so the same work costs less every time it runs. See you in the next issue.