# Anthropic Workshop: Build Agents That Run for Hours — Ash Prabaker & Andrew Wilson
<!--
ref: @content/youtube/aie/2026-05-18-anthropic-workshop-build-agents-that-run-for-hours
version: 3
updated_at: 2026-10-31T21:05:35.135Z
-->

Ash Prabaker & Andrew Wilson (AI Engineer, 2026-05-18): Agents that run for hours fail on three things: finite and rotting context, weak planning, and — least intuitively — a model's inability to judge its own output.

*Synthesized from Ash Prabaker and Andrew Wilson on AI Engineer, 2026-05-18.*

Ash Prabaker and Andrew Wilson are engineers on Anthropic's Applied AI team — Wilson a solution architect based in London working with digital-native and industry customers — presenting the harness patterns behind Anthropic's internal five-to-six-hour autonomous build runs, following a blog post they published weeks earlier.

## Core Thesis

Agents that run for hours fail on three things: finite and rotting context, weak planning, and — least intuitively — a model's inability to judge its own output. Anthropic's answer is an adversarial harness borrowed from GANs: split planning, building, and evaluation into separate agents with separate context windows, let the builder and critic negotiate a testable contract before any code is written, and have the critic actually drive the app rather than read diffs. The harness never disappears as models improve; it moves, filling whatever gaps the current model still has.

## Key Insights

- **Three failure modes.** *Context*: a fresh session is amnesia, context rot degrades coherence deeper into a window, and models exhibit "context anxiety" — rushing to wrap up as they approach the limit. *Planning*: models try to one-shot everything, or build half a feature and stop. *Self-judgment*: the sycophancy everyone knows from chat also applies to code — a model will look at a half-implemented feature, or a button with no backend behind it, and call it done.
- Wilson opens with Boris, Claude Code's creator, marking the tool's one-year anniversary: a year prior, Claude struggled with bash commands and string escaping and could run maybe 20 minutes; now nearly all of Claude Code is written by Claude Code and it can run for days.
- **The two levers are the weights and the harness, and they co-evolve.** On a minimal scaffold at 50% task completion, the horizon moved from roughly 1 hour with Sonnet 3.7 to 12 hours with Opus 4.6 in a year — a jump from about 4 hours at the prior generation. Every model release has shipped with harness changes alongside it.
- **The history is a list of gaps being filled and then absorbed.** Pre-Claude Code: Sonnet 3.5 in Artifacts could verify and iterate on what it built; computer use let it click and screenshot; MCP standardized tools. Feb 2025: Sonnet 3.7 plus Claude Code in research preview — explicitly framed as an experiment to learn how developers code with Claude in order to improve the base model. May 2025: Opus 4 and Sonnet 4, Claude Code GA, and the Claude Code SDK. Sonnet 4.5: the model became token-aware and could manage its own context; Claude Code 2.0 added checkpoints and session rewind; the SDK was renamed the **Agent SDK** on the recognition that it was general-purpose, not coding-specific. Haiku 4.5 and Opus 4.5 made running many sub-agents economical and made Opus strong enough at planning to pair Opus-plans-with-Sonnet-executes. Then skills (progressive disclosure — only frontmatter loads up front, the body on instantiation, references beyond that) and programmatic tool calling (write code that chains tool calls and return only the final result, rather than dumping every intermediate into context). Opus 4.6 and Sonnet 4.6 brought agent teams, server-side compaction, and 1M context GA.
- **Agent teams' innovation is peer communication**: sub-agents coordinate directly with each other and report to the main agent only when required, rather than funneling everything back through the orchestrator.
- On the Ralph Wiggum loop: Geoffrey Huntley published it in July, but it only caught fire around December when people started running it themselves. Wilson stresses it is deeper than "loop a prompt" — there is a planning phase that decomposes the prompt into features, then each task starts a *new session with a fresh context window*. Its appeal is Huntley's framing that it is deterministically bad in an undeterministic world: better to fail predictably than to succeed unpredictably. Anthropic's own Claude Code plugin version deliberately differs — it stays in one session and relies on compaction, with max iterations, a safe word, and a stop hook that intercepts the model's attempt to stop and continues until an exit criterion fires.
- The November long-running-agents harness, in detail: an initializer agent turns a vague prompt ("build me a browser," "a Slack clone") into persistent artifacts — a `featurelist.json`, a progress file, a git repo, an init script, and a per-feature completion flag. **JSON, not markdown, deliberately: models will overwrite markdown files but are much less likely to overwrite JSON.** The loop then re-orients in a fresh context window (working directory, progress file), runs the init script as a smoke test so it never re-derives startup, picks exactly one incomplete feature, implements it, verifies it with Puppeteer the way a human would, commits on green, and repeats.
- **The generator/evaluator split exploits a real asymmetry.** If the evaluator is also an LLM, why doesn't it rubber-stamp? Because *tuning a standalone critic to be harsh is tractable; tuning a builder to be self-critical is not*. Prabaker's analogy: it is easy to critique a painting or a meal, much harder to produce one. Crucially the evaluator does not read diffs — it opens live pages with Playwright, clicks around, and hands back a critique.
- **Taste is gradable if you have an opinion and write it down.** Their rubric has four criteria — design, originality, craft, functionality — weighted toward design and originality, with weights shifted per model (Opus 4.6 is already strong on functionality, so the live problem is preventing purple gradients and generic AI-slop aesthetics). They calibrate with few-shot examples on reference sites so the evaluator's taste converges on the team's.
- **The pivot behavior is what a single loop cannot do.** If the generator keeps scoring low on originality, the adversarial harness will throw the whole thing out and restart from scratch; a single-pass generation or a Ralph loop keeps patching the same artifact. Prabaker notes the 4.6-generation models were surprisingly willing to discard ten passes of work and restart — a behavior never observed when the generator judged itself, because it takes pride in its own work.
- **The planner is deliberately vague.** It decomposes a one-line prompt into sprints at a high level and specifically does *not* plan granular technical details, because an early technical error cascades and magnifies across every subsequent sprint over a multi-hour horizon. Prabaker's summary: this is a PM / IC / QA org chart, not invented here — the innovation is giving each role its own context window.
- **The contract negotiation is the key innovation over the Ralph loop.** Before writing a line, generator and evaluator negotiate what "done" means, via markdown files on disk: the generator proposes a feature and its verification tests, the evaluator pushes back that the scope is too big, the tests too weak, an edge case missed. They iterate until both agree, and then the evaluator grades against *that contract*, not the planner's original one-shot spec. This converts user stories into testable assertions without forcing the planner to over-specify. The Ralph loop had a fixed `plan.md` with nobody on the other side arguing with it.
- **Granularity of the contract is load-bearing**: the retro game maker settled on **27 contract criteria**. Vague criteria produce vague critiques and the generator shrugs; granular criteria tell it exactly which line to fix.
- **The retro game maker A/B.** Prompt: "build a retro game maker," nothing more. Solo loop: a decent opening screen, a workable sprite editor with cramped layout and black-swatch color picker — then play mode rendered entities, score, and health, and *arrow keys and space did nothing*. It looked done and broke at the only thing that mattered. Same prompt, same model, with the harness: ~$200 and 6 hours produced "Retro Forge" (it named itself), a new-project dialog, a 54-color palette with the 8-bit preset flowing through from that dialog, sprites shown at actual game scale, a working physics loop with collisions, and a live debug HUD clearly built for the evaluator's benefit. The planner's vague "AI features" line became a full in-app AI level assistant — a work item a solo run would never have created. Prabaker is explicit that this is neither cost-effective nor efficient; the point is that things work that otherwise didn't.
- The bugs the evaluator caught were unglamorous and only findable by using the app: FastAPI route ordering that passes every unit test but breaks in production, and a boolean logic bug on the delete key. These are exactly what slips through CI in a Ralph loop.
- **Out of the box, Claude is a bad QA agent.** Early runs had the QA agent finding a bug and writing "fix it later, might take 2 weeks" — the same generosity and sycophancy bias that afflicts LLM-as-judge everywhere. There was no trick; the fix was an exorbitant amount of time tuning prompts against small layout bugs and edge cases. **The primary debugging loop was reading traces, not running more experiments** — finding where the model's judgment diverged from a human's and tuning for that, the same muscle as reading a stack trace. Tooling tip: pipe agent transcripts to files and have another agent grep or replay them and propose prompt updates.
- **Adapting the harness as models improve, concretely.** Context resetting between sessions: dropped — Opus 4.5 had bad context anxiety, Opus 4.6 doesn't, so a single continuous session with compaction suffices. Sprint decomposition: critical for Opus 4.5, unnecessary for Opus 4.6, which holds a coherent 2-hour continuous build without being force-fed one feature at a time. Evaluator cadence: moved from every sprint to once at the end of a one-shot generation. The framing Prabaker insists on — *the harness wasn't wrong, it was right for 4.5, and the frontier moved*. The simplified version runs at roughly half the cost.
- The DAW (music app) build shows the current edge and its limit: the agent set tempo and key, laid down a melody, built drum tracks, and the evaluator tested the app. The app was genuinely fleshed out; the music was bad, because Claude cannot hear.
- **Don't give the critic the generator's traces.** They tried it and back off: mixing the two thought streams lets the model talk itself into believing something works. Far more effective for the evaluator to state "this is an issue" and let the generator reflect on its own work to find the cause.
- **For handing a long run back to humans, leave breadcrumbs on disk.** Prabaker prompts the harness throughout to write learnings and state into a JSON file (again, less likely to be overwritten) shaped as a timestamped log — tried this, evaluated, found this bug, implemented this fix, worked yes — plus a live-updating high-level doc of the file structure. Those two files are enough for Claude Code and a human to pick the project up cold.
- On whether agent teams supersede the generator/evaluator pattern: Prabaker sees generator/evaluator as a *subset* of team design rather than a competitor — a front-end, back-end, and integration team each plausibly deserves its own paired critic. The practical difference Wilson raises is deployment: Claude Code runs on your machine (needing `caffeinate`), while the Agent SDK runs in a cloud sandbox for long periods. Claude Code is the testing ground; the SDK is where it becomes an application.
- **This pattern is greenfield-shaped and opinionated** — it presumes a stack (React, Postgres, Node) and a design rubric that may not match an existing codebase. For brownfield, they point instead at automating other parts of the SDLC: autonomous monitoring producing issues, an agent producing the PR, review happening before a human merges. To start the loop on an existing codebase, point the evaluator at it, establish where it is against your criteria, give it the target spec, and let it hill-climb.
- Their measurement approach is not one eval at the end: define detailed rubrics per dimension (design taste, API design, code quality), record where the model started and ended against them, and let the generator/evaluator pair produce the tests. Comparable within a product or run, not across them.
- On empathizing with the model: when building the Claude for Chrome harness, the team ran an exercise navigating web pages with their eyes closed, opening them for a static glimpse every ten seconds. That is the model's actual situation, and building the intuition required spending the time.

## Actionable Takeaways

1. Never let the builder grade itself. Stand up a separate evaluator agent with its own context window and a harsh system prompt, and have it drive the running app (Playwright MCP, Claude for Chrome MCP, or computer use for native) rather than read diffs.
2. Make the generator and evaluator negotiate a written contract on disk before any code is written — proposed feature, proposed tests, evaluator pushback on scope and edge cases — and grade against that contract, not the original spec.
3. Aim for contract granularity around the scale they landed on (27 criteria for a mid-sized app). Vague criteria produce critiques the generator can shrug off.
4. Keep the planner deliberately high-level — sprints, not technical detail. Granular up-front plans cascade their errors across every downstream sprint.
5. Write your taste down as a weighted rubric (they use design, originality, craft, functionality, weighted toward the first two) and calibrate it with few-shot reference sites, including negative examples of AI slop.
6. Persist state in JSON, not markdown — models overwrite markdown files and largely leave JSON alone. Keep a timestamped tried/found/fixed log plus a live file-structure doc so a human or a fresh session can resume.
7. Use the file system as shared state for long runs rather than leaning on context windows.
8. Debug the harness by reading traces line by line, not by running more experiments. Pipe transcripts to files and point a second agent at them for a first pass, then read them yourself.
9. Re-audit your harness on every model release and delete the parts the model has absorbed — Anthropic dropped session resetting and sprint decomposition when moving from Opus 4.5 to 4.6, halving cost.
10. Use auto mode rather than running with permissions disabled, and package grading rubrics as skills so they load into the normal development flow.
11. If you want a human checkpoint, implement it as a hook that intercepts a stop condition and hands back for input — but treat needing one as a prompt-tuning signal rather than a permanent feature.

## Notable Quotes

> "Tuning a standalone critic to be harsh is very tractable. Tuning a builder to be self-critical is not." — Ash Prabaker

> "It's very easy for me to critique a lovely piece of artwork or a fine meal, much harder to actually paint or cook it." — Ash Prabaker

> "Most people say you can't grade taste. You can, if you have a strong enough opinion and you write it down." — Ash Prabaker

> "The lesson isn't that our harness was wrong — it was right for 4.5. The frontier moved." — Ash Prabaker

> "The primary debugging loop was reading what the agent actually did, not running more experiments." — Ash Prabaker

> "Compaction does not equal coherence. Lossy summaries drift." — Ash Prabaker

> "Better to fail predictably than to succeed unpredictably." — Geoffrey Huntley, quoted by Andrew Wilson

> "The frontier doesn't shrink, it moves." — Ash Prabaker

> "You've got to read the whole thing. Empathize with the model." — Ash Prabaker

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*