AI Agents · Memory · Reliability · Production

Resume or restart: what an agent writes down before it stops

Published · Updated

A maximum iteration count means your agent will stop mid-task by design. Whether that costs you a run or a few minutes depends on what was written at the last phase boundary.

Agents stop for ordinary reasons. A cap fires, a model call fails, a host restarts. Anthropic recommends including stopping conditions such as a maximum number of iterations to maintain control, which makes an interruption mid-task part of the design rather than an exception. So the question worth engineering is not how to avoid stopping. It is what state exists at the moment of the stop, and whether a fresh process can read it.

A stopping condition is a scheduled interruption

Workflows are systems where models and tools are orchestrated through predefined code paths. Agents are systems where the model dynamically directs its own processes and tool usage, keeping control over how the task gets done. That distinction has a storage consequence: when the path is not known in advance, the record of what happened cannot be derived from the code afterwards. It has to be written while the run is still going.

Memory is a write, not a recollection

Anthropic describes implementing patterns where agents summarise completed work phases and store essential information in external memory before proceeding to new tasks. The operative word is before. The summary is produced at the boundary, while the information is still in hand, not reconstructed later from whatever survived. Memory in this sense is an output of each phase, with the same status as the work product itself.

A resume record is not a log

The same team reports building systems that can resume from where the agent was when the errors occurred. A log answers a human question after the fact. A resume record answers the next process's question: which phase completed, which output stands, what remains to do. A useful test is whether a fresh process, given only the external store and no transcript, can continue. If it cannot, you have logging.

Cadence decides who reconstructs the state

Two published results set the stakes. On the Tatano Energy platform, SEO articles published every day: 8, and manual intervention required: 0. On the Matthieu Pesesse platform, articles publish autonomously daily with three model fallback levels and weekly content operations time of about zero hours. At that cadence nobody is standing by to rebuild an interrupted run by hand, so the write at the boundary is what separates an interruption from a lost day.

Deterministic safeguards around a non-deterministic middle

Anthropic describes combining the adaptability of agents with deterministic safeguards such as retry logic and regular checkpoints. Checkpoint cadence is code you control even when tool selection is not. Treat the phase boundaries as a predefined path in the workflow sense, and leave the dynamic behaviour inside a phase. The agent chooses how to do the step; your code decides where the step ends and what gets committed.

The token bill makes restarts expensive

Agents typically use about 4× more tokens than chat interactions, and multi-agent systems about 15× more. Those multipliers apply again to anything you redo, and the autonomous nature of agents also brings the potential for compounding errors. A checkpoint converts a restart into a resume and bounds how much of the run has to be paid for twice. That is a cost-control argument for memory, not only a reliability one.

What belongs in the record

Keep it small enough to write at every boundary: the phase identifier, the committed output and where it lives, which inputs were consumed, what remains, and the reason the run stopped. A summary of a completed phase is usually what the next phase needs, not the full transcript. Keep permission decisions out of it entirely: OWASP advises implementing authorisation in downstream systems rather than relying on a model to decide whether an action is allowed.

Design the phase boundary as a deliverable. Decide what a successor process must read to continue, write exactly that before moving on, and then prove it by starting a run from the store alone. Stopping conditions, retries and checkpoints are the deterministic parts you own around an adaptive middle, and under an unsupervised daily schedule they are the difference between a few minutes lost and a day lost.

Sources

Anthropic — Building effective agents — https://www.anthropic.com/engineering/building-effective-agents

Anthropic — How we built our multi-agent research system — https://www.anthropic.com/engineering/multi-agent-research-system

OWASP Gen AI Security Project — LLM06:2025 Excessive Agency — https://genai.owasp.org/llmrisk/llm062025-excessive-agency/

Neurolinks case study — Four markets, one codebase — https://neurolinks.be/work/tatano-energy

Neurolinks case study — A personal brand that publishes itself — https://neurolinks.be/work/matthieu-pesesse-media

Working on a project where these methods apply?