Always-on agents are
mostly asleep
The experience is continuous; the runtime is not. The agent sleeps, wakes on an event or a timer, does a short stretch of work, writes what must persist to external storage, and sleeps again. Anthropic’s guide breaks the architecture around that cycle into an event inbox, timers, memory, permissions and an outbox.
The experience is always on; the agent is mostly asleep
An always-on agent feels continuously present: it works in the background and acts without direct supervision. Yet it spends most of its time asleep. William Hu's Anthropic guide, "Building always-on agents," explains the architecture behind that experience: what survives between runs, what wakes the agent, and how it takes action and delivers results while unattended.
Anthropic attributes the resurgence of always-on agents largely to two model advances. Newer models are better at understanding user intent and judging when to check in. Intelligence is also becoming cheaper, especially for long-horizon tasks. On one long-horizon coding benchmark, Opus 5.5 cost 78% less per solved task than Opus 5, compared with 40% less on typical workloads. The two are successive generations of Anthropic's flagship model, with Opus 5.5 the newer one. Customers have begun asking how to bring this experience into their products, whether by making existing agents more proactive or building from scratch.
Always-on agents are both stateful and proactive. Stateful means managing context across sessions; proactive means acting without direct supervision. The core loop is the same as in other agents: think, call a tool, read the result, and repeat until the task is done. The difference lies in the architecture around that loop.
The guide makes the distinction explicit: 'An always-on agent is not actually "always on." This is just a description of the user experience.' It continues: "In reality, the agent spends most of its time asleep, waking up periodically to do work." Each stretch of work is a run: the agent receives an event, completes its task, and saves information about what happened. A run takes place in a session, which records messages and tool calls. The session can be new or resumed; when the run ends, the agent sleeps again.
The article's opening diagram shows long stretches of sleep, with no tokens spent, interrupted by brief runs: receive an event, start a session, execute the agent loop, and write state back to storage. Five building blocks support this cycle: an event inbox, timers, memory, permissions, and an outbox.
Event inbox
Receives events waiting to be handled
Timers
Record when the agent should wake later
Memory
Keeps information across runs
Permissions
Decide which actions can proceed
Outbox
Delivers messages to the user
Events enter an inbox; one worker handles them
Most agents run only when a user sends a message. Always-on agents can also be triggered by webhooks, scheduled tasks, and background jobs. A webhook is an HTTP request an external system sends when something happens. These events all need somewhere to wait before a run begins.
The guide warns against the most direct approach: "One tempting approach is to have each event source call the agent directly, but that has a few failure modes." Simultaneous events can start competing runs; a crash can lose an event entirely. An inbox changes the path: every source sends its event to durable storage, and a worker picks it up rather than letting the source call the agent.
The simplest inbox has three components: a durable event list, usually a database table; a handler, usually an HTTP endpoint, that writes to the list; and a worker, usually a background service, that reads it and starts runs. The inbox should track each event's status and can use source-provided identifiers to remove duplicates. A relational database works well, with each event appended as a row. Anthropic recommends starting with one inbox per user; the inbox can be split further if more parallelism is needed.
When an event arrives, the handler writes it to the inbox and wakes the worker. The worker reads the pending events and starts a run. An event that continues earlier work, such as a user's reply, resumes the existing session; other events start a new one. The worker passes the events to the agent loop, waits for the run to finish, and marks them done.
Implementation can get tricky, so the guide offers four practices. First, the handler should acknowledge events quickly: some webhook providers treat slow responses as failures. Lightweight checks can happen there, but deeper verification belongs in the run. This includes checking for prompt injection, where content the agent reads contains text disguised as instructions.
Second, "The inbox should be the source of truth." On waking, the worker should retrieve the latest events from it. If the worker dies mid-run, a replacement can find the same event and retry.
Third, "An inbox should only have one active worker at a time." This prevents runs from duplicating work or overwriting each other. An event arriving mid-run can wait for the next run, join the current one, or interrupt it and trigger a restart.
Fourth, the worker should batch pending events. Several messages sent in succession can become a single run and receive a single reply. Together, these practices address the earlier failure modes: one active worker prevents competing runs, while a durable inbox keeps events recoverable after a crash.
| Failure mode of direct calls | The arrangement that addresses it |
|---|---|
| Two events arrive at once and start competing runs | One active worker per inbox at a time |
| A crash loses an event | The inbox as the source of truth, so a replacement worker can retry the same event |
Pairs the article’s failure modes with its later practices.
A scheduler turns due timers into inbox events
The inbox receives events; timers arrange work for later. Together, they let the agent be proactive. Timers generally fall into two categories: follow-ups, deadlines the agent sets for itself, such as checking for a reply; and schedules, recurring tasks on a known cadence, such as a daily newsletter.
Timers have their own durable store, usually another database table, separate from the inbox. The inbox should contain only events ready for work; timers record work that is not yet due. Follow-ups and schedules can use similar records, but schedules also need recurrence rules to determine the next due time.
"A timer doesn't initiate a run on its own." A scheduler, usually a background service, polls the store at a fixed interval. Each pass has three steps: find due timers; update them by category; then add events to the inbox and wake the worker. Follow-ups should be marked done, while schedules should have their due time updated to the next occurrence.
Teams can build the scheduler or use a durable execution engine, which saves the state of multi-step work so it can resume after a failure. Either way, due timers become inbox events and go through the worker like other incoming work.
Memory holds only what can't be looked up again
Memory connects otherwise separate runs by retaining information for later work. It should have its own store, like events and timers. Claude Code's auto memory and the Messages API's memory tool organize it as a directory of files. For always-on agents, those directories should map to durable storage, usually a database or an object store, so memories survive even when the worker exits.
The rule of thumb is that "memory should only hold what the agent can't look up again". If information already exists in another system, such as an issue tracker, memory should retain a pointer rather than another copy.
The guide distinguishes four types of memory. First, user instructions describe how the agent should behave. They should have their own file, loaded at the start of every run, because the user will not always be present to steer the agent.
Second, user notes record what the agent has learned about the user's role, preferences, and corrections. They can start in one file and split into smaller files as they grow. Once split, only an index, or table of contents, loads at the start of each run; the agent reads individual files when it needs the details.
Third, past messages track what the agent has already told the user to avoid repetition. They can live in a separate file loaded at the start of each run, or the worker can load the last few messages exchanged with the user.
Fourth, task progress records what has been done and what remains for each ongoing task. A new run can read the progress file and continue where the previous one stopped. As with user notes, only an index loads initially; details are read as needed.
In one example setup, instructions.md, index.md, and reported.md load at the start of every run. The notes/ and progress/ folders are read as needed, and the agent writes to memory during the run.
| File | What it holds | When it is read |
|---|---|---|
instructions.md | Instructions from the user | Every run |
index.md | Index of notes/ and progress/ | Every run |
reported.md | What it has already told the user | Every run |
notes/ | What it has learned about the user; small, focused files | When needed |
progress/ | Progress on ongoing tasks; one file per task | When needed |
Figure 4 · One example setup from the source. The three files load at the start of every run, the two folders are read when needed, and the agent writes to memory during the run · source figure rearranged as a table
An optional process called dreaming reviews past sessions to curate these memories. It can replace outdated entries and find patterns that emerge only across many runs. The guide links to a separate Anthropic article for more detail.
Memory and session history both use context
The context window is everything the model can see at once. Before work begins, the agent loads its system prompt, tool definitions, and memory files. This initial overhead appears in every run. Anthropic recommends keeping it lean and using prompt caching to reuse an unchanged prompt prefix and lower costs.
A new session starts with this overhead and the triggering events. A resumed session also brings back messages and tool calls from earlier runs. The article's diagram shows the fixed overhead alongside a growing transcript, then shows older messages compressed into a summary.
If a session becomes too long, the agent can compact older messages or start a new session. Both approaches lose detail, so information needed later should be saved to memory along the way, not left only in the transcript.
Permissions carry the most risk
"Permissions are where always-on agents carry the most risk." A run holds the user's access while operating unattended. Each tool call requires a choice: proceed independently, block the call, or wait for approval.
The components are the same as in other agents. The guide covers three: credential storage, auto mode, and deferred tool calls. They govern access, review higher-risk actions, and let the agent wait for input without keeping a run open.
Useful work often requires sensitive credentials, such as passwords or access tokens. The recommended pattern puts a credential proxy outside the agent's environment. The agent sends a request without credentials; the proxy adds them before forwarding it. The agent can therefore make requests without holding the credentials itself.
Always-on agents should be able to work without constant user input. Claude Code's auto mode addresses a version of this problem: classifiers review higher-risk actions and block those identified as dangerous, allowing Claude to find a safer approach. But autonomy has limits: "User review, however, is still necessary for the most important decisions."
When clarification or approval is needed, a tool call can be deferred. In Claude Code, a hook is a script that runs at a defined point, such as before a tool call. It can defer the call until the user supplies more input. Always-on agents can use the same pattern.
Deferring a call ends the current run and saves the session mid-call. The request is shown to the user, for example as an interactive card rendered by MCP Apps. MCP is an open protocol for connecting agents to tools; MCP Apps extends it with interactive interfaces.
The user's answer returns as an inbox event. The worker picks it up, starts a new run, and resumes the saved session with the user's input. Meanwhile, it can process other events: the deferred call is saved, and the run that asked the question has already ended. Waiting for the user does not keep that run open or block other work.
Defer the call
The current run ends and the session is saved mid-call.
Show the request
The request is shown to the user, for example as an interactive card built with MCP Apps.
The answer returns to the inbox
The user’s answer arrives as a new event in the inbox.
A new run resumes
The worker starts a new run that resumes the saved session with the answer; while waiting, the worker can handle other events.
Most agents don't need a formal outbox
Most AI agents stream responses as they generate them, letting the user follow Claude's reasoning, tool calls, and answer. Always-on agents do most of their work in the background. The user receives the outcome and a few details, not the full sequence of work.
A run can end by sending a message to the outbox, deciding there is nothing to send, or deferring a tool call to request permission or input. Finishing a run does not always mean notifying the user; it can also mean waiting for an answer.
Most always-on agents need only a "send" tool that delivers messages directly to the user. The guide is explicit about when to add more: "You only need a formal outbox when you want to pace your agent's messages or allow your agent to recover from errors."
A formal outbox mirrors the inbox: a table of outgoing messages and a dispatcher, usually a background service, corresponding to the inbox's worker. The dispatcher reads pending messages, decides what to deliver, and sends them to the user. Deferred tool-call requests can go through the outbox or appear directly in the interface.
Message volume needs tuning too. Too many messages become noise; too few can leave out information the user needs. Anthropic recommends evals to find the balance. Its advice is to build up gradually: "it's better for the agent to start quiet and then earn more of the user's attention over time".
Five building blocks, one continuous cycle
A run begins with an inbox event: a user message, a webhook, or a timer coming due. The worker picks it up and wakes the agent in a new or existing session. The agent reads memory, acts within its permissions, and saves what it learns. In the full cycle illustrated by the guide, the finished run writes a message to the outbox, and the dispatcher delivers it to the user.
A run can set a timer to wake the agent later. A user's reply also returns as an inbox event and starts further work. Between runs, events and memory remain in durable storage while the agent sleeps. The guide's closing line captures the experience: "Each run is brief, but the cycle keeps going indefinitely, and that's what makes the agent feel like it's always on."