An Agent Doesn’t Need to Stay Awake All the Time—It Needs to Know Where It Left Off Every Time It Wakes Up
Reading Anthropic’s six Agent Infra engineering articles together: the hard part of long-running agents is not model inference, but the four dirty jobs of the event inbox, checkpoints, memory, and evaluation. It also clarifies three concepts that are often conflated.
LofiSu on X has woven Anthropic’s engineering blogs, research, and Cookbook posts on Agent Infra into a reading path, split into six directions: Agent Runtime, Context Engineering, Memory, Multi-Agent, Tool, and Eval & Security.
After reading through it, one impression stands out: this path has an implicit premise—treat the Agent as a distributed system, not as a single model call. For those “autonomous agents running all day” in the hype, almost none of the real engineering effort is in calling the model. Anthropic itself writes quite candidly: there are more failure cases than success cases.
Always online—actually always asleep
“Building always-on agents” dismantles the premise right at the start: an always-on agent is not actually always on; that is only a description at the user-experience level.
What actually runs is a loop. It sleeps for a long time, wakes up when an event arrives, runs one round, writes the state back, and goes back to sleep. This round is called a run, and the messages and tool calls recorded within a run are called a session.

Five primitives hold this loop together.
Event inbox. Don’t let each event source call the Agent directly; write events into a table first. Concurrent events won’t collide, and if a worker crashes it can reread them. Only one active worker is attached to an inbox at a time; this rule saves a lot of trouble.
Timers. They come in two types: follow-up is an alarm the Agent sets for itself, and schedule is a recurring task set by the user. Store timers in a separate table; don’t stuff them into the inbox. The inbox should only hold events waiting to be processed.
Memory. The directory structure maps to persistent storage. Anthropic’s experience is to store only things the Agent cannot look up again; for content that already exists in other systems, just store a pointer.
Permissions. The riskiest part. A run holds the user’s access permissions, and no one is watching. Credentials are injected through a proxy, high-risk actions are intercepted by classifiers, uncertain tool calls can be suspended pending user confirmation, and when the run ends but the session is saved, the user’s reply is picked up as a new event.
Outbox. A run has three possible exits when it ends: send a message, send nothing, or get stuck on a call that needs confirmation.

One detail is worth remembering. The article suggests that an Agent should first stay quiet and then slowly earn the user’s attention. An Agent that sends too many messages gets muted; this failure is more common than missing a report.
Four ways long-running Agents crash and burn
“Effective harnesses for long-running agents” is more like a medical record.
The premise is a very concrete analogy: in a software project, engineers work in shifts, and every newcomer doesn’t remember what the previous shift did. The context window is limited, a complex project can’t be finished in one go, and the Agent has to carry on in this state of amnesia.
Anthropic documented four typical failures: trying to write the whole application in one go, running out of context halfway through, and leaving behind half-finished features and zero documentation; in a later round, seeing that there is progress and directly declaring the project complete; leaving bugs and unrecorded changes in the environment; and marking features as complete without testing them.
The solution is a two-stage setup: an initializer plus a coding agent. The first run is dedicated to setting up the environment, writing the feature list, the progress file, and the initial git commit. After that, each round picks only one feature to work on, commits when done, and writes progress.
The feature list uses JSON rather than Markdown, because models are less likely to mess with JSON. This detail says a lot: constraining a model relies on the friction of the file format itself; begging repeatedly in the prompt doesn’t work.

Three easily confused concepts
In the Context Engineering articles, the easiest things to get wrong are compaction, tool-result clearing, and memory.
Compaction compresses the current context, clearing removes tool return results that are no longer needed, and memory saves information across sessions. These are three different problems. Replacing all of them with one Memory Store saves effort in the short term but will cause trouble in the long term.
The same batch of articles also mentions Code execution with MCP. Once the number of tools grows, how to dynamically discover tools and how to reduce the tokens occupied by tool definitions are themselves part of context engineering.
Memory is not a vector database
The real trouble with long-term memory lies in the formation, merging, correction, and updating of information; retrieval is actually a later concern.
Anthropic discusses Memory Formation, Consolidation, Correction, and Dreaming separately. Dreaming is looking back over historical sessions, cleaning up expired entries, and finding patterns that only emerge across multiple rounds.
Contextual Retrieval is another line: add context to each chunk, then layer on Embedding, BM25, and Reranking. Retrieval over long documents gets somewhat better.
Multi-Agent is not necessarily faster
Anthropic’s Multi-Agent Research System uses an orchestrator-workers structure: the main Agent splits tasks, sub-Agents run in parallel, and finally the results are aggregated.
The article explicitly warns that parallelism does not equal high efficiency. Task decomposition, context isolation, inter-Agent communication, result aggregation, and error handling are all extra costs.
There is also a point that is often misread: this system demonstrates experience with task division among multiple Agents; it has nothing to do with a general A2A communication protocol. If you really want to build distributed Agents, message protocols, Mailbox, identity authentication, state synchronization, and reliable delivery are all indispensable.
Tools and Skills are two different things
A Tool provides specific execution capabilities; a Skill encapsulates the processes, knowledge, and resources needed to complete a certain type of task. Mixing them together will make tool definitions balloon quickly.
As the tool ecosystem grows, Tool Registry, Dynamic Discovery, Progressive Disclosure, and Programmatic Tool Calling will become important.
Evaluation needs to look at trajectories
Agent Eval cannot just look at whether the final answer is correct. The execution trajectory, tool selection, task state changes, and whether it can recover after an interruption all need to be examined.
Security is the same. Writing a few rules in a prompt is not security; Permission, Sandbox, Trust Boundary, and Policy Enforcement need to be implemented in code.
Final thoughts
There is a passage in “Harness design for long-running application development” worth pulling out separately.
The author uses a GAN-like idea to create a loop between generator and evaluator, letting the evaluation Agent open pages with Playwright and click around itself. With the same prompt, a single Agent runs for 20 minutes and costs $9, while the full harness runs for 6 hours and costs $200. It is 20 times more expensive, but what that buys is that the single-Agent version’s game is completely unplayable—the character doesn’t respond to input—while the harness version can at least jump and walk.
Later iterations illustrate the point even better. After Opus 4.6 came out, the author deleted the sprint structure and changed per-round evaluation to one final evaluation. The reason is plain: the model itself got stronger, so some scaffolding no longer bears weight.
He wrote a sentence that I think is the landing point of this entire reading path: every harness component encodes an assumption about what the model cannot do, and model progress makes those assumptions expire.
So what needs maintaining is not some particular architecture, but regularly going back and dismantling what you have built.
Original list: https://x.com/mrbleem_eth/status/2127969130674606117
Main references in the article:
- Building always-on agents
- Effective harnesses for long-running agents
- Harness design for long-running application development
- Scaling Managed Agents
- Effective context engineering for AI agents
- Code execution with MCP
- Introducing Contextual Retrieval
- How we built our multi-agent research system
- Building effective agents
发布时间: 2026-12-02 12:28