Building a C compiler with a team of parallel Claudes
by Anthropic
How 16 Claude agents running in parallel wrote a 100,000-line C compiler in two weeks, and what the harness needed to make that work.
Overview
Published on February 5, 2026 by Nicholas Carlini, a researcher on Anthropic's Safeguards team, this post documents a two-week experiment in which 16 Claude agents built a clean-room C compiler in Rust. It is organised into sections on enabling long-running Claudes, running Claude in parallel, lessons from programming with agent teams, stress testing the limits of agent teams, and a forward look. The harness is deliberately simple: a bash loop that feeds each Claude Code session its next task from a prompt file, one Docker container per agent with the repo mounted at /workspace, and lockfiles in a current_tasks/ directory so agents claim work and sync through git, resolving their own merge conflicts. There is no orchestration agent. The project ran nearly 2,000 Claude Code sessions, consumed 2 billion input tokens and 140 million output tokens, cost about $20,000 in API usage and produced roughly 100,000 lines of code with a 99% pass rate on its compiler test suites. The result compiles QEMU, FFmpeg, SQLite, PostgreSQL and Redis, passes the GCC torture tests and boots Linux 6.9 on x86, ARM and RISC-V. Carlini lists the limits plainly: no 16-bit real-mode code generation, output less efficient than GCC with optimisations off, and Rust that an expert would not write. The code is public at anthropics/claudes-c-compiler.
At a Glance
- Topic
- Agentic
- Level
- Advanced
- Format
- Guide
- Cost
- Free
- Duration
- ~30 min read, plus optional time in the companion GitHub repo
- Provider
- Anthropic
- Hands-on
- No
- Certificate
- None
What You’ll Learn
- ✓Build a bash loop that keeps a Claude Code agent working through tasks without human prompts
- ✓Coordinate parallel agents with Docker containers, a shared git upstream and lockfiles in a task directory
- ✓Write near-perfect tests and verifiers, because autonomous agents optimise for whatever the verifier checks
- ✓Keep agent context clean by printing minimal output, logging details to greppable files and precomputing statistics
- ✓Use a known-good reference such as GCC as an oracle to split one monolithic task across agents
- ✓Assign specialised agent roles for deduplication, performance work, design critique and documentation upkeep
- ✓Recognise where agent teams stall, with the compiler limits and failure modes the author reports
Highlights
- •Concrete cost and scale numbers: 16 agents, nearly 2,000 sessions, 2 billion input tokens, about $20,000
- •The harness uses no orchestration agent, only git, lockfiles and per-agent containers, so you can copy it with ordinary tooling
- •The resulting compiler is public on GitHub (anthropics/claudes-c-compiler, about 2.8k stars, CC0 license) with build instructions and a stated disclaimer that the AI-written code is not validated for correctness
- •The author states the shortfalls directly, and Hacker News readers argued the output is far weaker than gcc or clang, so you get the case and the pushback
- •The repo README now lists its own assembler and linker, which the original post said the compiler lacked, so check the repo for the current state
Who It’s For
Best For
- ✓Engineers building long-running or multi-agent coding harnesses
- ✓Teams deciding how much autonomy and parallelism to give coding agents on a large codebase
- ✓Researchers studying the practical limits of current frontier models on large software projects
- ✓Platform engineers designing test suites and verifiers that agents will optimise against
Prerequisites
- •Hands-on experience with a coding agent such as Claude Code
- •Working knowledge of git workflows, Docker and shell scripting
- •Basic familiarity with how compilers and test suites work helps with the examples
FAQ
What is Building a C compiler with a team of parallel Claudes?
An Anthropic engineering write-up by Nicholas Carlini on running 16 Claude Code agents in parallel, without an orchestrator, to build a Rust C compiler that boots Linux 6.9. It is for engineers designing long-running or multi-agent coding harnesses who want concrete lessons on tests, task locking and context hygiene.
Is Building a C compiler with a team of parallel Claudes free?
Building a C compiler with a team of parallel Claudes is free to access.
What level is Building a C compiler with a team of parallel Claudes for?
Building a C compiler with a team of parallel Claudes is aimed at a advanced audience. Recommended background: Hands-on experience with a coding agent such as Claude Code, Working knowledge of git workflows, Docker and shell scripting, Basic familiarity with how compilers and test suites work helps with the examples.
How long does Building a C compiler with a team of parallel Claudes take?
Expect roughly ~30 min read, plus optional time in the companion GitHub repo. Most learners work through it at their own pace.
What will I learn from Building a C compiler with a team of parallel Claudes?
You'll learn: Build a bash loop that keeps a Claude Code agent working through tasks without human prompts; Coordinate parallel agents with Docker containers, a shared git upstream and lockfiles in a task directory; Write near-perfect tests and verifiers, because autonomous agents optimise for whatever the verifier checks; Keep agent context clean by printing minimal output, logging details to greppable files and precomputing statistics; Use a known-good reference such as GCC as an oracle to split one monolithic task across agents; Assign specialised agent roles for deduplication, performance work, design critique and documentation upkeep; Recognise where agent teams stall, with the compiler limits and failure modes the author reports.
Topics
Sources
This page was written from 3 sources, 2 on domains other than anthropic.com.