How to Build Agents That Run for Hours: Anthropic's Planner, Generator and Evaluator Harness

AI Engineer 2026: Anthropic Talks
21 parts- 1Claude for Long-Horizon Tasks: Lance Martin's Four Rules for Agents That Run for Hours
- 2Inside the Claude Managed Agents Workshop: Pets, Cattle, Outcomes and Dreaming
- 3How Anthropic Builds: Mike Krieger on Being Unreasonable With Claude
- 4How Jarred Sumner Ships Millions of Lines of Agent-Written Code
- 5A Field Guide to Fable: Thariq Shihipar on Unhobbling Claude and Finding Your Unknowns
- 6Claude Tag Lands 65% of Anthropic's Product PRs: Takeaways From Cat Wu and Thariq Shihipar
- 71,000 Claude Agents, Git and a Database: How Fable 5.2 Formalized Fermat Without a Custom Harness
- 8Your Old Prompts Are Making Claude Worse: Lance Martin's Checklist for Frontier Models
- 9Why One Agent Isn't Enough: Anthropic on Flows, UltraCode and Running 1,000 Agents
- 10Tokens Should Have Jobs: Anthropic's Case for Advisors, Graders and Dreamers
- 11Give the Agent a Budget, Not a Token: Anthropic's CI Team on Safe Agent Permissions
- 12Rethinking Claude Code Best Practices: Lydia Hallie on Getting Out of the Loop Safely
- 13How Anthropic Merges 30,000 Code Changes a Day: Addy Osmani on Verifying the Software Factory
- 14Using LLMs to Secure Source Code: Eugene Yan's Six-Step Pipeline From Anthropic
- 15From Messages API to Managed Agents: Anthropic's Applied AI Team on Harnesses That Go Stale
- 16Forward Deployed Engineering 101: When Your AI Startup Needs FDEs, From Palantir to Anthropic
- 17The Enterprise Tech Stack for AI Agents: Why Your POC Stalls and How to Design Past It
- 18The Claude Certified Architect Exam as a Field Guide to Agentic Engineering
- 19The Future of MCP: David Soria Parra on Connectivity, Progressive Discovery and Skills Over MCP
- 20Gateways Are All You Need: How Anthropic Thinks About MCP in the Enterprise
- 21How to Build Agents That Run for Hours: Anthropic's Planner, Generator and Evaluator HarnessCurrent
TL;DR
Anthropic Applied AI's Ash Prabaker and Andrew Wilson trace how Claude went from 20-minute runs to multi-hour builds, and the GAN-style planner, generator and evaluator harness behind their one-shot apps.
Ash Prabaker and Andrew Wilson are engineers on Anthropic's Applied AI team in London. Their AI Engineer Europe 2026 session, the first of the conference, explains what actually goes into those "we one-shotted a whole app" demos: not a secret model, but a harness. Wilson covers how Claude's primitives evolved to make long runs possible; Prabaker covers the experimental harness they use today.
Source: How to Build Agents That Run for Hours (Without Losing the Plot), Ash Prabaker and Andrew Wilson, Anthropic, AI Engineer Europe 2026. Costs and durations are as reported in the talk.
Why Long Runs Fail#
Wilson groups the failure modes into three buckets:
- Context. Every new session starts with amnesia, so the agent needs memory. Deep into a session, coherence drops (context rot), and some models showed "context anxiety," rushing to finish as the window filled.
- Planning. Out of the box, models try to do everything at once, build half a feature and stop, or run out of context mid-app.
- Self-judgment. The least intuitive one: models are bad at grading their own work. They will call a half-built feature done, or ship a button with no backend behind it.
There are two levers: the model weights and the harness around them. On the model side they pointed to METR's time-horizon measurements, which rose from about an hour for Sonnet 3.7 to around twelve hours for Opus 4.6 with a minimal scaffold. On the harness side, Anthropic tends to ship harness changes alongside each model, and the two co-evolve.
A Year of Harness History#
Wilson's tour of what shipped, compressed:
- Claude Code research preview (Feb 2025), explicitly an experiment to learn how developers use Claude so the models could improve.
- Claude Code GA and the SDK, with models better at managing their own context.
- The Ralph loop. Geoffrey Huntley's technique of feeding a prompt to a coding agent on repeat until tasks are done, with a planning phase and a fresh context per task. Anthropic's own Ralph plugin runs inside one session instead, using a stop hook, a max-iteration count and a completion phrase, and relies on compaction rather than fresh windows.
- Sonnet 4.5 and Claude Code 2.0, with context awareness, checkpoints, and the SDK renamed to the Agent SDK because it was useful far beyond coding.
- Opus 4.5 and Haiku 4.5, which made many sub-agents economical and made planning-with-Opus, executing-with-Sonnet practical. Skills arrived with progressive disclosure, and programmatic tool calling cut context use further.
- The first long-running harness post, with an initializer agent that writes a
feature_list.json, a progress file, a git repo and an init script, then a loop that picks one failing feature per fresh session, implements it, verifies it in a browser and commits. A small detail they noted: models were less likely to overwrite a JSON feature list than a Markdown one.
Wilson's summary: the harness does not disappear as models improve. You find a gap, fill it with harness, train the model on it, and eventually delete that piece.
The Core Idea: Do Not Let the Builder Grade Itself#
Prabaker's harness borrows from GANs. A generator builds; a separate evaluator grades. They have separate context windows, separate system prompts and separate jobs. The evaluator does not just read diffs. It uses Playwright to open the live app, click around and try things, then writes a critique back to the generator.
The obvious objection is that the evaluator is also an LLM, so why would it not rubber-stamp too? The answer: tuning a standalone critic to be harsh is tractable; tuning a builder to be self-critical is not. It is the same for people. Critiquing a meal is far easier than cooking it.
Honesty point: out of the box, Claude is a poor QA agent. Early evaluators found bugs and then excused them. Most of the work was tuning the evaluator prompt.
Grading Taste With a Rubric#
For front-end quality, "most people say you can't grade taste," but Prabaker argues you can if you write your opinion down. Their rubric has four criteria:
- Design
- Originality
- Craft
- Functionality
They weight design and originality highest, since recent models already handle functionality well, and they calibrate the evaluator with a few reference sites so its taste converges on theirs. The target is avoiding generic AI aesthetics.
One behavior only this setup produced: pivoting. If the generator kept scoring low on one criterion, the harness would throw the design away and start fresh, where a single-agent loop keeps patching the same thing.
Adding a Planner and a Contract#
To go from nice pages to working apps, they added a third role, a planner, that turns a one-line prompt into a deliberately high-level spec broken into sprints. It specifies product scope, not technical detail, because a wrong technical decision early cascades through every sprint.
Squint and it is a PM, an engineer and QA, each with its own context. The glue is the interesting part: before building, the generator and evaluator negotiate what done means. The generator proposes a feature and how to verify it; the evaluator pushes back on scope, weak tests and missed edge cases. They trade Markdown files on disk until both agree, and the evaluator then grades against that contract rather than the original spec.
That contract is what Prabaker calls the key thing the Ralph loop never had: someone on the other side arguing with the main loop.
%% title: Planner, generator and evaluator with a negotiated contract
flowchart TD
U[One-line prompt] --> P[Planner: high-level spec and sprints]
P --> N[Generator and evaluator negotiate a contract]:::emphasis
N --> G[Generator builds]
G --> E[Evaluator tests the live app with Playwright]
E -->|critique| G
E -->|contract met| D[Done]The Retro Game Maker#
The demo prompt was just "build a retro game maker." A solo loop produced an app that looked finished: an opening screen, a sprite editor, a play mode. But in play mode the arrow keys and space bar did nothing. It looked done on the surface and failed the moment you used it.
The same prompt and model through the harness ran about six hours and cost about $200. It named itself, added a project dialog, a full palette, and an AI level assistant inside the app, which came from one vague line in the planner's spec. Play mode had a live debug HUD (clearly added to make the evaluator's job easier), working physics and collisions. The contract for that app had 27 criteria. Vague criteria give vague critiques; granular ones tell the generator exactly what to fix.
The bugs the evaluator caught were the kind that pass CI: a route-ordering bug that passed every unit test, and a delete key with a boolean logic error. Both were only found because the evaluator actually used the app.
Simplify as the Frontier Moves#
The last section is about removing harness. With Opus 4.6 they:
- Dropped context resets. Context anxiety was largely gone, so one continuous session with compaction was enough.
- Relaxed sprint decomposition, since the model could hold a two-hour build coherently.
- Ran the evaluator at the end of a generation rather than after every sprint.
The planner, generator and evaluator loop remains the core, with the file system as shared state. A DAW (music app) built with the simplified harness on a newer model cost roughly half as much as earlier runs. The music was bad because Claude cannot hear, but the app worked.
The lesson in their words: the harness was right for 4.5, the frontier moved, and they ran a simpler version to see what still mattered.
Build It Yourself Today#
You do not need Anthropic's internal harness. The pieces are in Claude Code:
- Auto mode instead of skipping permissions.
- Custom sub-agents for the evaluator, with a harsh system prompt and a detailed rubric.
- Playwright MCP or Claude in Chrome for web apps, or computer use for native apps.
- Skills to package grading rubrics.
Our Take#
Prabaker's five takeaways are worth copying verbatim into a team doc: self-evaluation is a trap, so use an adversarial evaluator; compaction is not coherence, so prefer structured handoffs and clean context; subjective quality is gradable if you write the opinion down; read the traces; and re-check which scaffolding to delete with each model.
"Read the traces" was their answer to almost every Q&A question too. The way they tuned the evaluator was reading what the agent did line by line, not running more experiments. Lance Martin's long-horizon tasks talk covers the same ground from the memory and context side, and CJ Avilla and Harrison's stall-free fleet of 1,000 agents covers it at scale.
FAQ#
What is a generator-evaluator harness?#
A long-running agent setup where one agent builds and a separate agent, with its own context and a harsh rubric, tests the live result and sends critiques back. It avoids the self-grading bias of a single agent checking its own work.
How is this different from a Ralph loop?#
A Ralph loop repeats a prompt against a fixed plan. Anthropic's harness adds a planner and, crucially, a contract the generator and evaluator negotiate before each build, so an independent agent is arguing with the main loop about what done means.
How long and how much did the retro game maker run take?#
About six hours and roughly $200, per the talk. A later simplified harness on a newer model cost about half as much for a comparable app.
Sources#
- How to Build Agents That Run for Hours - video
- Harness design for long-running application development
- Effective harnesses for long-running agents
- METR task-completion time horizons
- Geoffrey Huntley: Ralph
- Claude Code Ralph Wiggum plugin
- Playwright MCP
The Full Series#
This post is part of our coverage of Anthropic's talks at AI Engineer 2026:
- Claude for Long-Horizon Tasks: Lance Martin's Four Rules for Agents That Run for Hours
- Inside the Claude Managed Agents Workshop: Pets, Cattle, Outcomes and Dreaming
- How Anthropic Builds: Mike Krieger on Being Unreasonable With Claude
- How Jarred Sumner Ships Millions of Lines of Agent-Written Code
- A Field Guide to Fable: Thariq Shihipar on Unhobbling Claude and Finding Your Unknowns
- Claude Tag Lands 65% of Anthropic's Product PRs: Takeaways From Cat Wu and Thariq Shihipar
- 1,000 Claude Agents, Git and a Database: How Fable 5.2 Formalized Fermat Without a Custom Harness
- Your Old Prompts Are Making Claude Worse: Lance Martin's Checklist for Frontier Models
- Why One Agent Isn't Enough: Anthropic on Flows, UltraCode and Running 1,000 Agents
- Tokens Should Have Jobs: Anthropic's Case for Advisors, Graders and Dreamers
- Give the Agent a Budget, Not a Token: Anthropic's CI Team on Safe Agent Permissions
- Rethinking Claude Code Best Practices: Lydia Hallie on Getting Out of the Loop Safely
- How Anthropic Merges 30,000 Code Changes a Day: Addy Osmani on Verifying the Software Factory
- Using LLMs to Secure Source Code: Eugene Yan's Six-Step Pipeline From Anthropic
- From Messages API to Managed Agents: Anthropic's Applied AI Team on Harnesses That Go Stale
- Forward Deployed Engineering 101: When Your AI Startup Needs FDEs, From Palantir to Anthropic
- The Enterprise Tech Stack for AI Agents: Why Your POC Stalls and How to Design Past It
- The Claude Certified Architect Exam as a Field Guide to Agentic Engineering
- The Future of MCP: David Soria Parra on Connectivity, Progressive Discovery and Skills Over MCP
- Gateways Are All You Need: How Anthropic Thinks About MCP in the Enterprise
Continue Reading#
Get the next deep dive like this in your inbox
One email a week on Anthropic and the rest of the AI dev stack. Free.
Read next on Claude Code
Claude for Long-Horizon Tasks: Lance Martin's Four Rules for Agents That Run for Hours
Lance Martin of Anthropic on building long-horizon agents: decouple the brain from the hands, verify in a separate context, dream to fix memory, and go org-level.
9 min readLong-Running Agents Need Harnesses, Not Hope
Long-running coding agents need a harness: task contracts, scoped workspaces, logs, checkpoints, verification gates, and cost limits to recover from failure.
9 min readWhy One Agent Isn't Enough: Anthropic on Flows, UltraCode and Running 1,000 Agents
CJ Avilla and Harrison Stall of Anthropic on multi-agent topologies: lessons from Unix, OS/360 and Linux, Dynamic Workflows in Managed Agents, and when to use Flows vs UltraCode.
9 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.






