Always-On Agents: Anthropic's Five Primitives, Shown Working

An always-on agent mostly sleeps. Anthropic's five primitives wake it, carry its memory, guard its actions and deliver its work. Costs and limits included.

Published

Always-On Agents: Anthropic's Five Primitives, Shown Working

An always-on agent is not a program that runs all day: it sleeps, wakes when something happens, does one short run, saves what it learned and sleeps again. Anthropic's guide Building always-on agents, published 13 November 2026, names the five primitives behind that cycle: an event inbox, timers, memory, permissions and an outbox. Here is each one in the guide's order, shown working, with what it costs and where it stops as of November 2026.

Anthropic's article Building always-on agents on claude.com
Anthropic's guide Building always-on agents, published 13 November 2026.

What an always-on agent is

Anthropic calls always-on agents stateful and proactive: they manage context across sessions and take actions without direct supervision. Underneath, they run the same core loop as other agents. The difference is the architecture around that loop: pieces that decide when the agent wakes up, what carries over between runs, and how its work reaches you.

The name describes the experience, not the machine. In the guide's words, an always-on agent "is not actually 'always on.'" It spends most of its time asleep. Each stretch of work is a run: the agent receives an event, completes its task and saves what happened. A run works inside a session, the transcript of messages and tool calls. Then the agent sleeps again, and the cycle repeats indefinitely.

How it differs from one long session

One long sessionAn always-on agent
What starts the workYou send a messageAny event: your message, a webhook, a schedule, a background job, a timer the agent set itself
What carries overThe transcript in front of itMemory kept outside the session, plus the transcript of a session it resumes
How you see the workStreamed as it happensThe outcome and a few details, when there is something to say
While nothing happensNothing runs until you typeIt sleeps; the guide's timeline shows no tokens spent while asleep
When context runs longCompact it or start overThe same, so anything that must last is written to memory as it goes

Why now

The guide gives two reasons. The latest models judge better: they are more reliable at understanding what the user wants and at knowing when to check in. And intelligence is getting cheaper, with long-horizon tasks gaining most. On a subset of the SWE-bench Pro coding benchmark, Claude Opus 5.5 cost 78% less per solved task than Claude Opus 5 at about the same score, against 40% less on typical workloads (Anthropic's cost guide).

Here is the cycle from the user's side. The agent wakes four times; you only see what it decides to tell you.

Illustration: one always-on agent across four runs
08:00 · run 1

wake · schedule fired · new session · memory read

Agent

Morning brief: one item needs you. The supplier contract is still unsigned, day 3.

You · 09:10

Chase them for the signed copy.

09:10 · run 2

wake · your reply · session resumed · email drafted · send deferred for your OK

You · 09:12

Approve.

09:12 · run 3

wake · your answer · email sent · follow-up timer set for 14:00

14:00 · run 4

wake · follow-up due · progress/contract.md read

Agent

Signed copy received and filed. Nothing else needs you today.

Every line in that scene is one of the five primitives at work. The rest of this page takes them one at a time.

The five primitives, in the guide's order

Each primitive is a small, durable piece that lives outside the model. Three of them are usually database tables. None of them is exotic; the craft is in how they hand work to each other.

1. Event inbox: one door for everything that wakes the agent

Most agents run only when you send a message. An always-on agent can also be woken by webhooks, scheduled tasks and background jobs. The tempting design lets each source call the agent directly. The guide names two ways that fails: two events arriving at the same time start competing runs, and a crash can lose an event entirely.

The answer is an inbox. Every source sends its event there, and a worker picks it up. The simplest version has three parts:

  • a durable list of events, usually a database table;
  • a handler, usually an HTTP endpoint, that writes events to the list;
  • a worker, usually a background service, that reads from it.

The inbox tracks each event's status and drops duplicates using the source's own IDs. Anthropic recommends one inbox per user to start, split further only when you need more parallelism. An event that continues earlier work, such as your reply, resumes the existing session. Anything else starts a new one.

The same events, with and without an inbox
Each source calls the agent

A webhook and your message arrive together: two runs start and compete.

The process crashes mid-run: the event is gone.

You send three messages in a row: three calls to the agent.

Every source writes to the inbox

Both land as rows. The one worker takes them into a single run.

The worker dies mid-run: a new worker pulls the same event and retries.

The worker batches them into one run, so the agent replies once.

The guide's four rules for the inbox:

  • Answer fast. Some sources, such as webhook providers, treat a slow response as a failure. The handler can run light checks; deeper ones, such as checking for prompt injection, belong in the run.
  • The inbox is the source of truth. A woken worker pulls the latest events from the inbox first, so a replacement can retry what a dead worker left.
  • One active worker per inbox. Two runs would duplicate or overwrite each other's work. When an event lands mid-run, push it to the next run, fold it into this one, or interrupt and restart.
  • Batch what is pending. Several messages in a row become one run and one reply.

2. Timers: how the agent becomes proactive

The inbox lets the agent react. Timers let it start things on its own. They come in two kinds:

Follow-upSchedule
Who sets itThe agent, for itselfYou
The guide's exampleChecking in on a replyA daily newsletter
After it firesMarked doneMoved to its next occurrence

Timers live in their own durable store, usually another table, kept apart from the inbox: the inbox holds only events ready to be worked on. A timer never starts a run by itself. A scheduler, usually a background service, polls the store at a fixed interval, and on each pass it:

  1. finds the timers that are due;
  2. marks a follow-up done, or moves a schedule to its next occurrence;
  3. adds an event to the inbox and wakes the worker.

You can build the scheduler yourself or use a durable execution engine. If you rent it, Claude Managed Agents has scheduled deployments: a cron expression, an IANA time zone, minute-level granularity, and a new session each time it fires. That page describes recurring schedules; a follow-up the agent sets for itself mid-run is still yours to build.

3. Memory: what carries over between runs

Runs are disjointed, so memory is what holds the agent's continuity. It gets its own store too. Anthropic's products implement memory as a directory of files: Claude Code's auto memory and the Messages API's memory tool. For an always-on agent, that directory should map to durable storage, usually a database or an object store, so memory outlives the worker.

The guide's rule of thumb: memory holds only what the agent can't look up again. If something already lives in another system, such as an issue tracker, save a pointer to it. Four kinds earn a place:

  • User instructions. How the agent should behave, in their own file, loaded at the start of every run. You won't always be there to steer.
  • User notes. Your role, preferences and corrections. Start with one file; as it grows, split it into small files and load only an index.
  • Past messages. What the agent has already told you, so it never repeats itself. Either a file loaded every run, or the worker loads the last few messages.
  • Task progress. One file per open task: what is done and what is left. The next run reads it and picks up where the last one stopped.

The guide's example setup, as a directory:

Text
instructions.md   loaded at the start of every run
index.md          loaded at the start of every run
reported.md       loaded at the start of every run
notes/            read when needed
progress/         read when needed

On the Messages API, the memory tool is one entry in your request, {"type": "memory_20250818", "name": "memory"}. It runs client-side: Claude asks for file operations under /memories, and your application performs them against storage you choose. That also makes the safety checks yours: the docs say to restrict every operation to the /memories directory.

You can add dreaming: a pass that reviews past sessions to curate memory, replace outdated entries and find patterns that only show across many runs. In Anthropic's research on agent memory, Claude checked a wrong note against the original session transcript, caught the error and rewrote it.

Inside the context window

Before any work, every run loads the system prompt, the tool definitions and the memory files. That overhead is paid on every run, so the guide says to keep it lean and use prompt caching. A new session starts with only that overhead and the events that triggered the run. A resumed session also brings back its earlier messages and tool calls.

When a session grows too long, compact the older messages or start a new session. Both lose detail, so anything that must last goes into memory along the way. Claude Code keeps its own loaded layer small in the same spirit: auto memory loads only the first 200 lines or 25 KB of MEMORY.md, which works as an index.

4. Permissions: what it may do while you are away

This is where the risk sits. A run holds the user's access and, by design, works unattended. For every tool call, the agent must proceed on its own, block it, or wait for approval. The guide names three components.

A credential store. The recommended pattern is a proxy outside the agent's environment. The agent sends requests without credentials; the proxy adds the real ones and forwards them. Anthropic's secure deployment guide lists what that buys you: the agent never sees the credentials, the proxy can enforce an allowlist of endpoints and log every request, and the credentials live in one place.

Auto mode. Claude Code's auto mode uses classifiers to review higher-risk actions and block the dangerous ones, so Claude looks for a safer approach. The guide still keeps your review for the most important decisions, and Anthropic's write-up of auto mode shows why. On 52 real overeager actions, the full pipeline let 17% through; on 10,000 real internal tool calls, its false-positive rate was 0.4%. A session that collects 3 denials in a row, or 20 in total, is stopped; in a headless claude -p run, the process ends. Anthropic's own words: "It is not a drop-in replacement for careful human review on high-stakes infrastructure."

For a run with nobody to answer, Claude Code's headless docs give this command. The classifier reviews each action, and anything that would have needed a person is denied:

Bash
claude -p "Update the dependency pins and run the tests" --permission-mode auto --permission-prompts none

Deferred tool calls. When an action does need a person, a hook can defer the call. The run ends and the session is saved mid-call. The request reaches the user, for example as an interactive card built with MCP Apps, and the answer comes back as an event in the inbox. That event starts a new run, which resumes the saved session with the answer. While the call waits, the worker can take other events, so the agent is never stuck.

Claude Code's documented defer round trip: pause at a tool call, resume with the answer

claude -p "$TASK" --output-format json --permission-prompt-tool "$HOST_TOOL"

"stop_reason": "tool_deferred",

"session_id": "abc123",

"deferred_tool_use": { "id": "toolu_01abc", "name": "AskUserQuestion", ... }

claude -p --resume abc123 --permission-prompt-tool "$HOST_TOOL"

Between the two runs, the hook returned "defer", so the tool did not run and the pending call stayed in the transcript. Your process read deferred_tool_use and showed the question in its own interface. On resume, the same call fires the hook again; this time it returns "allow" with the answer in updatedInput, and Claude carries on.

Know its edges. Claude Code honors "defer" only in non-interactive -p runs, and only when Claude makes a single tool call in the turn. There is no timeout: the session waits on disk until the retention sweep deletes it, after 30 days by default.

The two commands above are opposite answers to one question. --permission-prompts none says nobody is there, so deny, and it removes tools that need a person, such as AskUserQuestion. A deferred call says somebody will answer later, so wait.

5. Outbox: how the work reaches you

A normal agent streams its work as it goes. An always-on agent works in the background, so you get the outcome and a few details instead. A run ends in one of three ways:

  1. it sends a message to the outbox;
  2. it decides nothing needs sending;
  3. it defers a tool call to ask for permission or more input.

Most always-on agents can get by with a single "send" tool that delivers straight to the user. You need a formal outbox only to pace the agent's messages or to recover from errors. It mirrors the inbox: a table of outgoing messages, and a dispatcher, usually a background service, that reads what is pending, decides what to deliver and sends it. A deferred request can go through the outbox or appear directly in your own interface.

The harder part is volume. An agent that sends too much becomes noise; one that sends too little misses what you needed to know. Anthropic recommends building evals to find the balance, and says it is better for the agent to start quiet and earn more of your attention over time.

Anthropic's reference daily-brief agent shows the delivery discipline. It counts a Slack post as sent only when Slack returns "ok": true and a message timestamp, updates its records only after that, and marks an unclear result "maybe posted", so nothing is lost and nothing goes out twice.

How the pieces fit into one loop

  1. An event arrives

    A user message, a webhook or a due timer lands in the inbox.

  2. The worker starts a run

    It wakes the agent in a new session, or resumes the existing one when the event continues earlier work.

  3. The agent reads its memory

    Its instructions, the index of its notes and what it has already reported give it a baseline.

  4. It acts within its permissions

    Safe calls run, dangerous ones are blocked, and the ones that need you are deferred.

  5. It writes back what it learned

    Notes and progress files are updated before the run ends.

  6. It pushes a row to the outbox

    The dispatcher delivers the message. The run may also set a timer, and your reply comes back as a new event.

Each run is brief. The cycle keeps going.One run of an always-on agent, and what wakes the next one
One run
1 · InboxAn event arrivesA message, a webhook or a due timer
2 · WorkerA run startsIn a new session or an existing one
3 · MemoryThe agent reads its memoryInstructions, notes, past messages
4 · PermissionsIt actsSafe calls run, dangerous ones are blocked, the rest wait for you
5 · MemoryIt writes back what it learnedNotes and progress files, before the run ends
6 · OutboxThe run endsIt sends a message, sends nothing, or defers a call to ask you
Then it sleeps, until one of these arrives
Your replyIt comes back as an event and resumes the saved session
A follow-upA timer the agent set for itself, to check on a reply
A scheduleA recurring timer you set, such as a daily newsletter
A webhook or a background jobAny other event starts a new session

As of Nov 19, 2026 · Source: Anthropic, “Building always-on agents”

As the guide puts it: "Each run is brief, but the cycle keeps going indefinitely, and that's what makes the agent feel like it's always on."

Three uses for a business

These come from Anthropic's own pages, as Anthropic reports them. Each leans on a different mix of the primitives.

The jobWho runs it, as Anthropic reportsThe primitives it leans on
A morning brief from Slack and GitHub, posted to one Slack channelAnthropic's reference implementation on Claude Managed AgentsA schedule; memory of what it read and reported; read-only credentials; one destination
Watching sales and hiring processes, following up when next steps are due, sending meeting remindersAndo, on scheduled deploymentsSchedules and follow-ups; memory of open items; messages to the right people
Flagging usage surges as they happen; reading production logs and metrics so product managers see an app's health without a dashboardKERNEL and Rakuten, on Claude Managed AgentsA schedule; read access to data; a quiet outbox that speaks only when something changes

The brief is the one to copy first. Anthropic published its code and six rules from building it: read each source from a bookmark, not a fixed window; report a failed read as unreadable, never as a quiet day; re-check every item right before posting; count a post as sent only when Slack confirms it; re-read your preferences every run from a store the agent can't edit; and give it read-only access wherever it only reads, with a spending cap per run.

Follow-through is where follow-up timers pay. A person forgets to chase a reply; an agent with a follow-up timer and a progress file does not. Keep anything that goes out to another person behind a deferred call until you trust it.

Watching is where a quiet outbox matters most. The guide's warning applies in full here: an agent that sends too much becomes noise. Let it speak when the numbers move.

A plain test before you build: the work recurs or waits on events, its inputs are reachable without you, and a missed or wrong message costs less than checking by hand. If one of the three fails, a scheduled task or a script is the better tool.

How to start

Three routes, from least to most building.

No code: a scheduled task in Claude

If you want the behavior and not the build, "hand off and schedule tasks" is part of Claude's Pro, Max and Ultra plans on Anthropic's pricing page. Our Claude Cowork guide covers how scheduled tasks work and which inputs they can reach. You get the schedule and the delivery; you do not design the inbox, the memory or the permissions.

Rented: Claude Managed Agents

Anthropic hosts the loop. A scheduled deployment is your timer, memory stores are your memory, vaults are your credential proxy, and a budget caps each run. These are Anthropic's commands from its reference implementation.

  1. Let Claude Code set it up

    Update Claude Code, then run Anthropic's onboarding. The claude-api skill reads Anthropic's post, proposes a setup, writes the files to an agents/ folder and creates the resources with ant apply.

    Bash
    claude update
    Text
    /claude-api managed-agents-onboard https://claude.dev/blog/building-effective-agent-automations/
  2. Or apply the files by hand

    Create the vault that holds the credentials, add each credential, then create the deployment with its agent, environment and memory stores. Our guide to ant apply explains the lockfile it writes.

    Bash
    ant apply vault.yaml
    ant apply deployment.md
  3. Run it once without waiting for the schedule

    Use the deployment ID that ant apply recorded in claude-lock.json.

    Bash
    ant beta:deployments run --deployment-id <id>
  4. Set the budget from real runs

    Start the cap at three to five times the cost of a normal run, then tighten it. A run that hits the cap pauses with budget_reached, so a cap set too low looks like a brief that went quiet.

The reference deployment file shows a schedule and two memory stores side by side: your preferences, which the agent may only read, and its own state.

YAML
---
name: Daily brief
agent: ./agent.md
environment_id: ./environment.yaml
schedule:
  type: cron
  expression: "32 7 * * 1-5"
  timezone: America/New_York
vault_ids: [vlt_...]
resources:
  - path: ./memory_store_preferences.yaml
    access: read_only
    instructions: The reader's preferences. Re-read them every run. Never write here.
  - path: ./memory_store_state.yaml
    access: read_write
    instructions: Your state. Bookmarks, ledger, notes, proposals, and run records.
---

Write today's brief.

Built: your own loop on the Agent SDK or the Messages API

Build it yourself when the agent is your product. Our Agent SDK guide covers installing it and hosting it. Then add the primitives, each in the smallest version the guide describes:

  1. An inbox table, a handler and one worker, with one inbox per user.
  2. A timers table and a scheduler that writes due timers into the inbox.
  3. A memory directory on durable storage: an instructions file, one notes file, and a progress file per task. The memory tool gives you the file interface.
  4. A credential proxy outside the agent's environment. Claude Code and the Agent SDK can route through one with ANTHROPIC_BASE_URL or HTTPS_PROXY.
  5. A send tool. Add a formal outbox and a dispatcher only when you need pacing or recovery.
  6. Deferred calls for anything that needs your yes.

What it costs and where it stops

What it costs

What you pay forWhat Anthropic's pages say, as of November 2026
SleepingNothing: the guide's timeline shows no tokens spent while the agent is asleep.
Each run's starting contextThe system prompt, tools and memory files are paid on every run. Keep them lean and cached.
Model tokensPer million tokens, in the table below.
The cacheLasts 5 minutes by default and refreshes free each time it is used. A 1-hour cache costs 2x the base input price to write. Cache hits on Opus 5.5 and Sonnet 5.5 cost 0.05x the base input price.
Claude Managed AgentsStandard token rates, plus $0.08 per session-hour of active runtime.
A runaway runOn Managed Agents, capped by a per-run budget: a deployment with a "2000" cap can spend up to about $20 on every run.
ModelInputOutputCache hits5-minute cache write1-hour cache write
Claude Opus 5.5$4$20$0.20$5$8
Claude Sonnet 5.5$2$10$0.10$2.50$4
Claude Haiku 5.5 (prompts up to 100,000 tokens)$0.10$0.50$0.01$0.125$0.20

For a real number per run, Anthropic's daily-brief README reports its own tests: on a busy day, with two channels and two repositories holding around 140 messages and 25 pull requests, a run cost about $1.50 on Claude Opus 5 and about $1.00 on Claude Sonnet 5. A run that found every source unreadable cost $0.15 to $0.30. Those tests predate the move of its default model to Claude Sonnet 5.5, and its deployment caps each run at $5.00.

The cache rule that matters for an agent that sleeps: a cache only saves money if the next run starts before it expires. Anthropic's caching page recommends the 1-hour cache for prompts used less often than every 5 minutes but more often than every hour. An agent that wakes every few hours finds both expired and writes its overhead again, which is one more reason to keep that overhead small.

Where it stops

  • Managed schedules are in beta. Scheduled deployments run on cron at minute-level granularity, with jitter of up to 15% of the interval between runs (at least 5 seconds, at most 9 minutes). An organization can have up to 1,000 of them.
  • Missed runs stay missed. Unpausing a deployment resumes from the next occurrence; missed triggers are not backfilled. A start refused by a rate limit is recorded as a failed run and tried again only at the next occurrence.
  • Data rules. Managed Agents is not eligible for zero data retention, except self-hosted Managed Agents, and not eligible for HIPAA. Session transcripts persist until you delete them.
  • A budget is per run, not per month. The deployment copies its cap onto each session it starts.
  • Defer has narrow conditions. It works only in claude -p runs with a single tool call in the turn, and a waiting session is deleted after 30 days by default.
  • Auto mode misses some things. In Anthropic's own test it let 17% of real overeager actions through. Keep your review for what cannot be undone.
  • Compaction forgets. Compacting a session or starting a new one loses detail; only what was written to memory survives.
  • The memory tool's storage is yours. It runs client-side, so path checks, size limits and expiry are your code.

What people get wrong about always-on agents

  • That "always on" means always running. It mostly sleeps. The value is in what wakes it and what it remembers, not in uptime.
  • Wiring every source straight to the agent. It works in a demo and fails on the first two simultaneous events or the first crash. One inbox, one worker.
  • Reading "the last 24 hours". A late run leaves a gap and an early one repeats items. Keep a bookmark per source.
  • Treating a failed read as a quiet day. When a source is down, the agent sees nothing and can report "nothing new". Have it say what it could not read.
  • Baking preferences into the prompt. The prompt keeps applying rules you have already changed. Have the agent re-read them every run from a file it cannot edit.
  • Remembering everything. In Anthropic's memory research, Claude Sonnet 3.7 wrote 413 memory files across 225 folders and earned one badge in Pokémon; Claude Fable 5 wrote nine files in two folders, plus one global.md, and earned four. Store only what cannot be looked up again.
  • Reading auto mode as review. It is a filter that catches most dangerous actions. The guide still keeps you in the loop for the decisions that matter most.
  • Sending more to look useful. Start quiet and earn attention.
What is an always-on agent?

An AI agent that is stateful and proactive: it keeps context across sessions and acts without direct supervision. It wakes on events such as messages, webhooks and timers, does a short run, saves what it learned and sleeps again.

Does an always-on agent run all the time?

No. Anthropic's guide says it "is not actually 'always on.'" It spends most of its time asleep and spends no tokens while it sleeps. The cycle of short runs is what makes it feel always on.

What are the five primitives of an always-on agent?

An event inbox for everything that wakes it, timers for follow-ups and schedules, memory for what carries over, permissions for what it may do unattended, and an outbox for how its work reaches you.

Do I need Claude Managed Agents to build one?

No. You can build every primitive yourself with the Agent SDK or the Messages API and a database. Managed Agents rents you some of them: scheduled deployments, memory stores, vaults and a budget per run. It is in beta.

How much does an always-on agent cost to run?

Model tokens for each run, plus $0.08 per session-hour of active runtime if you use Claude Managed Agents. Asleep, it spends no tokens. Every run pays for its starting context, so a lean, cached prompt is the main lever, and a per-run budget caps the worst case.

Where to go next

Published
Category
AI
Related Articles
Gemini 4 Neon: What It Does, What It Costs and How to Start

Gemini 4 Neon: What It Does, What It Costs and How to Start

Where Gemini 4 Neon fits beside Carbon, Hydrogen and Argon, who can use it, and how to compare it with your current model on a real coding task.Nov 19, 2026AI
Claude Cowork Pricing: What One Seat or a Team Costs

Claude Cowork Pricing: What One Seat or a Team Costs

Which Claude plans include Cowork? Compare US prices, usage limits, and worked budgets for one person, five seats, or twenty seats.Nov 19, 2026AI
QuillBot Review

QuillBot Review

When does QuillBot earn a seat beside your AI assistant? Compare its editing tools, US prices, team controls and privacy terms for client work.Nov 19, 2026AI
GPT-6.2 Astra vs Sol

GPT-6.2 Astra vs Sol

Choose a GPT-6.2 default by job. Compare Astra and Sol for agent runs, code review and writing, with worked examples and Ultrafast access by plan.Nov 18, 2026AI
GPT-6.2 Explained: Astra, Sol and Who Gets Access

GPT-6.2 Explained: Astra, Sol and Who Gets Access

Find GPT-6.2 Astra and Sol in ChatGPT Work, Codex and the API. See who gets Ultrafast and which jobs justify switching models.Nov 18, 2026AI
Kimi vs Qwen

Kimi vs Qwen

Kimi K3.1 Pro vs Qwen4-Max for coding agents and products: current access, long context, open weights, API tradeoffs and US deployment choices.Nov 17, 2026AI
Qwen 4: Qwen4-Max Explained

Qwen 4: Qwen4-Max Explained

Qwen4-Max explained: production versus preview access, context and output limits, open-model promises, and when to move from Qwen3.8-Max.Nov 17, 2026AI
Perplexity Alternatives 2026: ChatGPT, Gemini, Claude, Consensus, Kagi, You.com and Perplexica

Perplexity Alternatives 2026: ChatGPT, Gemini, Claude, Consensus, Kagi, You.com and Perplexica

Compare ChatGPT, Gemini, Claude, Consensus, Kagi, You.com and Perplexica by research job, source access and practical limits.Nov 16, 2026AI
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.