Umbrella concept page. A long-running agent keeps making forward progress on a goal across many sessions, many sandboxes, possibly many days or weeks — recovering from failure, leaving structured artifacts behind, and resuming where it left off. The chat-window-with-a-loop paradigm has a ceiling: the model forgets, declares “task complete” when it isn’t, and re-introduces a bug it fixed nine turns ago. Long-running agents are what comes next.

This page is the synthesis. The detailed patterns live on their own pages — see Patterns and architectures below.

The three definitions

Following Addy Osmani’s taxonomy: “long-running” gets used to mean at least three different things, and they have different engineering problems.

SenseWhat it isWhat solves it
Long-horizon reasoningPlan and execute over many dependent steps; recover from a wrong turn ten steps agoMostly model quality (METR’s time horizon metric tracks this — doubling ~every 7 months)
Long-running executionThe agent’s process runs for hours or days; thousands of model invocationsMostly a harness story: persistence, checkpointing, session logs
Persistent agencyAn identity that outlives any single task — accumulated memory, user preferences, always-availableMemory layer (e.g. Google’s [[Gemini Enterprise Agent Platform

A real production agent does long-horizon reasoning inside a long-running execution backed by persistent agency. But the engineering is different in each, and so are the products that solve them.

The three walls every long-running agent hits

Every write-up converges on the same three problems:

  1. Finite context. Even a 1M-token window fills, and context rot kicks in well before the hard limit. A 24-hour run will not fit in any context window on the field’s roadmap.
  2. No persistent state. A new session starts blank. Anthropic’s framing: “imagine a software project staffed by engineers working in shifts, where each new engineer arrives with no memory of what happened on the previous shift.”
  3. No self-verification. Models reliably skew positive when grading their own work. Asked “are you done?” they answer “yes” more often than they should — yielding the agent that ships at 30% complete with full confidence.

Every long-running agent design is an answer to these three. The major labs have converged on similar answers with very different surface area.

The convergent architecture

Google, Anthropic, and Cursor have converged on roughly the same shape:

What differs is surface area. Google’s Gemini Enterprise Agent Platform is the enterprise-stack version (identity + audit trail baked in). Claude Managed Agents is “Anthropic’s harness, hosted.” Cursor’s background agents are “long-running coding, pulled out of the IDE and into the cloud.”

Key

“Every component in a harness encodes an assumption about what the model can’t do on its own.” (Anthropic)
When the harness is coupled, an assumption that goes stale (e.g. the model used to need an explicit planner and now plans natively) requires rewriting everything at once. Decoupling the brain, hands, and session is what lets the harness evolve without throwing it away.

Why this matters now

Two reasons:

A phase change in what’s economically delegable. A 10-minute agent answers a question. A 10-hour agent owns a feature, finishes a migration, runs an overnight research sweep. Anthropic’s Sonnet announcements report 30+ hours of autonomous coding in internal tests; one run produced an 11,000-line Slack-style app. That’s already past the threshold where “should I delegate this?” is no longer obvious.

Persistence changes what the agent is. A stateless agent answers and disappears. A long-running one accumulates context: which competitor moved which way last week, which test flaked twice on Tuesday, what you usually mean by “the dashboard.” Anthropic’s Project Vend (a Claude instance running an actual office vending business for a month) was the public early demonstration: it failed in informative ways, and the point wasn’t profitability but watching what kinds of weird coherence problems appear when an agent has to maintain identity across weeks instead of turns.

Patterns and architectures (covered in detail elsewhere)

  • Long-Running Agents - Initializer + Coding Pattern — Anthropic’s two-prompt blueprint: initializer agent + coding agent; four artifacts (init.sh, claude-progress.txt, feature_list.json, git history); session bootstrap routine
  • Brain Hands Session Split — Anthropic’s Managed Agents architecture: independently replaceable model/loop, sandbox, and append-only event log; sandboxes as cattle-not-pets; wake(sessionId) recovery
  • Cursor Planner Worker Judge — Cursor’s three-role architecture (planners explore + emit tasks, workers execute, judges decide done); model-per-role matching; background cloud agents and isolated git worktrees
  • Gemini Enterprise Agent Platform — Google’s productized long-running stack: Agent Runtime, Sessions, Memory Bank, Sandbox, Identity, Gateway, Registry, Observability
  • Ralph Loop — the simplest practitioner version: a bash for loop that re-prompts the agent until done; state lives outside the agent, on the filesystem
  • Five Patterns for Long-Running Agents in Production — checkpoint-and-resume, delegated approval, memory-layered context, ambient processing, fleet orchestration

Practical advice (regardless of platform)

Four moves that matter on any path:

  • Write down the done-condition before the agent starts. External file with explicit, testable completion criteria. Anthropic’s feature_list.json, Cursor’s planner task spec — same thing. Exists so the agent can’t quietly redefine done mid-run. (See Evaluation-First Prompting.)
  • Separate the evaluator from the generator. Self-grading is the failure mode. Even the same model in different roles with different prompts works.
  • Invest in the session log, not just the prompt. If you can’t reconstruct what the agent did in the last 24 hours from durable storage, what you have is a long-running shell script that happens to call an LLM, not a long-running agent. (See Session Observability and Replay.)
  • Treat compaction and context resets as first-class. Summarization-as-compaction isn’t enough for very long jobs — sometimes you need full context resets where the harness tears the session down and rebuilds it from a structured handoff file. (See Context Window Management Strategies.)

Real limitations (still unsolved)

  • Cost. A 24-hour run with a frontier model and a few tools is not cheap. Without budgets, circuit breakers, and tool-spend caps, an agent can quietly burn a week’s API budget in an afternoon.
  • Security. A long-running agent with API keys, cloud access, and shell access has a much larger attack surface than a chat session. The brain/hands separation matters precisely here: credentials should be unreachable from the sandbox where model-generated code runs.
  • Alignment drift. Over many context windows, the original goal gets summarized, re-summarized, and loses fidelity. The most common reason for “the agent went off and did something I didn’t ask for.”
  • Verification. Auditing 24 hours of autonomous activity is a real human-time problem. Structured artifacts (PRs, commits, briefings, test runs) are how you make it tractable.
  • The human role. Defining work crisply enough that an agent can run for a day on it is harder than doing the work yourself. The appreciating skill isn’t writing code; it’s writing specs that survive contact with an autonomous executor.

Three deployment paths today

You are…Use this
A developer wanting long-running coding work on your own repoClaude Code (see Claude Code Internals), Cursor, Codex, Antigravity. Treat AGENTS.md like a pilot’s checklist; use a worktree so a closed laptop doesn’t kill the run. This is the path most people should take.
Building a hosted agent productPick a managed runtime: Google’s Agent Platform, Claude Managed Agents, or roll on top of ADK / Claude Agent SDK / Codex SDK. Don’t build the runtime.
Doing autonomous operational work (monitoring, research, ops)ADK + Memory Bank + Cloud Run + Cloud Scheduler is the cleanest stack for “agent runs every N hours, accumulates state, alerts on a threshold.” Cursor’s planner/worker/judge split starts to matter more here than in IDE coding.

Where this is going

The harder problems for the next year aren’t in any single layer. They’re in the coordination above them: many long-running agents on a shared codebase; agents that read their own traces and patch their own harnesses; harnesses that assemble tools and context just-in-time for a task rather than being pre-configured at startup. That’s where the agent stops looking like a smarter chat window and starts looking like a colleague who’s been on the project longer than you have.

The model is still load-bearing. But the gap between a chat window and an agent you can leave running overnight is mostly in the state, sessions, and structured handoffs wrapped around it.

Sources

  • Long-Running AI Agents — Addy Osmani, Long-Running AI Agents (2026); the canonical practitioner-facing survey of the landscape
  • Building long-running agents — Justin Young, Anthropic, Building long-running agents (2025); the initializer + coding agent pattern