Anthropic

16 Claude Agents Built a C Compiler: 100K Lines, $20K

Anthropic researcher Nicholas Carlini ran 16 parallel Claude Opus 4.6 agents over ~2,000 Claude Code sessions to write a 100,000-line Rust C compiler that boots Linux 6.9 — for under $20,000.

16 Claude Agents Built a C Compiler: 100K Lines, $20K — article cover
On this page6 SECTIONS
  1. The Numbers: 2,000 Sessions, 2 Billion Input Tokens
  2. Minimal Orchestration: An Infinite Bash Loop and a Shared Git Repo
  3. The Human Job: Near-Perfect Tests
  4. The Caveats: It Is Not GCC
  5. Why It Matters
  6. Sources

In early February, Anthropic’s engineering blog published an account of an experiment by Nicholas Carlini, a researcher on the company’s Safeguards team: 16 Claude Opus 4.6 agents working in parallel wrote a C compiler from scratch — roughly 100,000 lines of Rust, released as “claudes-c-compiler.” The compiler builds a bootable Linux 6.9 kernel on x86, ARM, and RISC-V, and compiles QEMU, FFmpeg, SQLite, Postgres, and Redis. Ars Technica and The Register covered it around February 9; the latter put the number right in the headline — the model spent $20,000 writing a compiler.

What gives the result weight is the condition it was built under: clean-room. Claude had no internet access, the compiler depends only on the Rust standard library, and Carlini stayed essentially hands-off after setting up the multi-agent architecture. This was not a demo but a deliberate capability benchmark — a large engineering problem with objective verification (does it compile, does it boot), designed to find where the agents break.

The Numbers: 2,000 Sessions, 2 Billion Input Tokens

The project ran nearly 2,000 Claude Code sessions over about two weeks, at a cost of just under $20,000 — roughly 2 billion input tokens and 140 million output tokens. The output is a 100,000-line Rust codebase that passes around 99% of major compiler test suites, including the GCC torture tests, and can compile and run Doom.

Do the arithmetic: $20,000 bought the first draft of a compiler that can bootstrap a Linux kernel. That is not GCC-grade engineering by human standards — but it is the most concrete public data point yet on the question of whether agents can complete large, long-horizon software projects with almost no human supervision.

Minimal Orchestration: An Infinite Bash Loop and a Shared Git Repo

The most counterintuitive part is how simple the architecture is. There is no elaborate multi-agent framework: an infinite bash loop keeps respawning Claude Code sessions, each agent running in its own Docker container. All agents share a single bare git repository as upstream — each clones locally, works, merges, and pushes. Coordination happens through lock files in a current_tasks/ directory to avoid duplicated work; merge conflicts happen constantly, and the agents resolve them themselves.

There is no orchestrator agent. Each Claude autonomously picks “the next most obvious” problem to solve. Carlini did assign specialized roles — one agent deduplicated code, another improved compiler speed, a third targeted output efficiency, plus agents for Rust design critique and documentation.

The Human Job: Near-Perfect Tests

Carlini’s own effort went almost entirely into the environment around the agents, not the code. His framing is blunt: if the verifier is flawed, the agents “will solve the wrong problem.” So he made the tests near-perfect, and he designed around two known model limitations: context pollution — agents are required to keep output minimal and logs grep-friendly — and time blindness — deterministic sampled test runs, so an agent can reliably tell whether it made things better.

When agents stalled on the monolithic Linux kernel build, his fix was to use GCC as a “known-good compiler oracle,” isolating the files handled by Claude’s compiler so debugging could proceed in parallel. That is the most stealable engineering move in the whole write-up: rather than building smarter agents, build a feedback loop in which ordinary agents can correct themselves.

The Caveats: It Is Not GCC

Carlini’s limitations list is as specific as the results:

  • No 16-bit real-mode x86 support; boot-stage kernel compilation is delegated to GCC (ARM and RISC-V are fully self-compiled)
  • The assembler and linker are incomplete and buggy; the demo video relied on GCC tooling
  • Generated code is less efficient than GCC’s — even with GCC’s optimizations disabled
  • The Rust falls short of expert quality, and new features frequently broke existing functionality

He describes himself as excited, concerned, and uneasy at once, and warns that passing the tests does not mean the job is done — fully autonomous development carries real risks.

Why It Matters

Three layers. First, the capability baseline: Carlini says the project “nearly reached the limits” of Opus 4.6 — a model we covered at its release — and that he did not expect this to be possible “so early in 2026.” That sentence is itself a data point on the progress curve. Second, the methodology: infinite loop plus Docker plus shared git plus lock files is a recipe any team can reproduce today with its own agent harness; no special infrastructure required. Third, the caution: the trustworthiness of the whole system rests on the quality of the tests. When agents can pass every test and still ship flawed software, verification — not generation — becomes the real bottleneck of autonomous development.

Sources

AI-assisted summary compiled from the sources above, reviewed by a human before publishing.

SHAREXEMAIL