← Back to library

Run parallel coding agents for days on one large build

An Anthropic researcher kept sixteen Claude agents restarting nonstop, each in its own container pushing to one git repo, to write a Rust C compiler. Nearly 2,000 sessions and $20,000 of API spend later, the 100,000-line result could build the Linux kernel. The write-up details the harness and test design that made it work.

  • OutcomeKeep many coding agent sessions making autonomous progress on one big codebase by investing in tests, logs and task locks instead of supervision.
  • SetupAn afternoon+
  • LevelAdvanced
  • CreditNicholas Carlini (Anthropic)
View original
Works with
Claude Code

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • A large engineering job can be checked by a strong automated test suite
  • You can run agents in isolated containers
  • Budget allows many long sessions

Not for: Projects without a reliable way to judge correctness; Running agents with skipped permissions on your own machine

What do you need, and what do you get?

You need

  • A high-quality test suite or reference implementation to compare against
  • Containers with a shared upstream git repo
  • A standing agent prompt describing the goal and working habits

You get

  • Continuous progress through many short agent sessions
  • Task lock files showing who works on what
  • Progress notes and READMEs that orient each fresh session

How does it work, step by step?

  1. Loop the agent in a sandboxRun a script that restarts a non-interactive session with the same prompt whenever one ends, inside a container.
  2. Coordinate with lock filesEach agent claims a task by committing a file to a tasks folder; git conflicts push the second claimant to other work.
  3. Make the tests nearly perfectThe agent solves whatever the checker rewards, so add tests whenever you see a new failure mode and gate commits in CI.
  4. Design output for an agentPrint a few lines, log details to files with greppable error lines, and offer a fast sampled test mode.
  5. Split monolithic work with an oracleWhen everyone hits the same bug, compile most of the job with a known-good tool and only part with the agent's work to isolate faults.

The prompt

Our own prompt, inspired by Nicholas Carlini (Anthropic) and written to work in Claude Code. Values in lime are placeholders.

Prompt0 variables
You are one of several agents working on [project] in this repo. Before starting, read PROGRESS.md and the tasks/ folder. Claim one unclaimed task by committing tasks/[task].txt; if the push conflicts, pick another. Work in small steps, run the fast test sample, log details to files and print only short summaries with ERROR lines for failures. When done, pull, merge, run the full checks, push, delete your lock and update PROGRESS.md with status and failed approaches.

Inspired by Nicholas Carlini (Anthropic): Building a C compiler with parallel Claudes. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • Without CI enforcement, new features kept breaking existing ones late in the project.
  • Agents are time-blind and will run tests for hours; default to a small deterministic sample per agent.

Our take

Nicholas Carlini at Anthropic kept sixteen Claude agents restarting nonstop, each in its own container pushing to one git repo, to write a Rust C compiler. Nearly two thousand sessions and twenty thousand dollars of API spend later, the hundred-thousand-line result could build the Linux kernel. Few teams will build a compiler, but the lessons apply to any long agent job: the verifier is the real manager, logs must be written for a reader with a small context window, and fresh sessions need progress files to orient. The lock-file trick is a cheap way to keep parallel agents from colliding. Heed the warning to run looped agents in a container rather than your actual machine, and treat the cost figure as a reminder to budget before scaling out. Design tests that are nearly perfect before multiplying agents. Split monolithic work with an oracle when possible. Cap spend in the billing console, not only in prompts. Review merges yourself no matter how green the harness looks.

Where the time goes back: One supervised session stalls waiting for input; a looped, test-guided team keeps working, with humans improving the environment rather than steering each step.

FAQ

Was there an orchestrator agent?
No. Each agent picked whatever looked like the clearest next task; some were given specialist roles such as removing duplicate code or improving performance.
Is this a recipe for production work?
The author calls it an early research prototype; the transferable parts are the harness and test design.

Source and credit

Inspired by Nicholas Carlini (Anthropic). We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
Building a C compiler with parallel Claudes
Creator
Nicholas Carlini (Anthropic)
Published on
anthropic.com
Original date
Feb 5, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Claude Code
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; nothing was sent, filed, purchased or published.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Operations & Admin

All 203 Operations & Admin playbooks →

Related playbooks

Operations & AdminWorkflow✓ AI dry run

Add a merge check for every way coding agents break code

Keep a running list of the specific ways coding agents have damaged your repository, from hollow tests and invented fake responses to deleted files and silenced type errors, and turn each one into an automated gate that blocks the merge, so the same mistake cannot slip through review twice.

Credit: u/alexmarquardt on r/ClaudeCode

An afternoon+
Operations & AdminWorkflow✓ AI dry run

Ask Reddit's experience before you pick a library

Let your coding agent search Reddit for long-term user reports on a library, an error message or a competitor before you commit to a choice.

Credit: u/karanb192 on r/ClaudeCode

Minutes