AGENTIC COMMONSAI industry briefings

繁中EN

TopicAI Coding & Developer ToolsPublished

All English articles

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

On this page6 sections
  1. By the Numbers: 2,000 Sessions, 2 Billion Input Tokens
  2. Minimal by Design: An Infinite Bash Loop and a Shared Git Repo
  3. What the Human Did: Near-Perfect Tests
  4. Where It Falls Short: It Is Not GCC
  5. Why This Matters
  6. References

Summary: Anthropic researcher Nicholas Carlini used 16 parallel Claude Opus 4.6 agents to write claudes-c-compiler, about 100,000 lines of Rust, without internet access. The compiler built a bootable Linux 6.9 kernel for x86, ARM, and RISC-V and compiled major projects such as QEMU and Postgres. The two-week experiment used nearly 2,000 sessions and cost just under $20,000, though it remains below GCC in completeness and efficiency.

Early February brought a new post to Anthropic’s engineering blog: an account of an experiment by Nicholas Carlini, a researcher on the company’s Safeguards team. Sixteen 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 it has compiled QEMU, FFmpeg, SQLite, Postgres, and Redis. Ars Technica and The Register covered the story around February 9; The Register put the number straight in its headline — the model spent $20,000 writing a compiler.

Why the result carries weight: the conditions. This was clean-room work. Claude had no internet access, the compiler leans on nothing beyond the Rust standard library, and once the multi-agent architecture stood up, Carlini was essentially hands-off. It was no demo; it was a deliberate capability benchmark — a large engineering problem with objective verification (does it compile, does it boot), built to locate the point where the agents break.

By the Numbers: 2,000 Sessions, 2 Billion Input Tokens

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

Run the arithmetic. $20,000, in other words, purchased the first draft of a compiler able to bootstrap a Linux kernel. By human standards that is not GCC-grade engineering — but on the question of whether agents can finish large, long-horizon software projects with almost no human supervision, it is the most concrete public data point to date.

Minimal by Design: An Infinite Bash Loop and a Shared Git Repo

The counterintuitive part is how little architecture is involved. No elaborate multi-agent framework: an infinite bash loop keeps respawning Claude Code sessions, with each agent living in its own Docker container. One bare git repository serves as upstream for everyone — every agent clones locally, works, merges, and pushes. Coordination runs through lock files in a current_tasks/ directory to head off duplicated effort; merge conflicts are constant, and the agents settle them without help.

No orchestrator agent exists. Each Claude autonomously chooses “the next most obvious” problem to attack. Carlini did hand out specialized roles — one agent deduplicated code, another pushed compiler speed, a third chased output efficiency, and further agents took Rust design critique and documentation.

What the Human Did: Near-Perfect Tests

Carlini’s own effort went almost entirely into the environment surrounding the agents rather than the code. He states it plainly: a flawed verifier means the agents “will solve the wrong problem.” Hence tests pushed to near-perfect, plus design choices around two known model limitations: context pollution — agents must keep output minimal and logs grep-friendly — and time blindness — deterministic sampled test runs, which give the agent a reliable read on whether it actually improved things.

When the agents stalled on the monolithic Linux kernel build, his fix was to treat GCC as a “known-good compiler oracle” and isolate the files that Claude’s compiler handled, which let debugging proceed in parallel. Of everything in the write-up, that is the move most worth stealing: rather than building smarter agents, build a feedback loop in which ordinary agents can correct themselves.

Where It Falls Short: It Is Not GCC

The limitations Carlini lists are as concrete as the headline results:

  • 16-bit real-mode x86 is unsupported; the kernel’s boot stage gets compiled by GCC instead (ARM and RISC-V are fully self-compiled)
  • The assembler and linker are incomplete and buggy, and the demo video leaned on GCC tooling
  • Generated code trails GCC in efficiency — even with GCC’s optimizations switched off
  • The Rust sits below expert quality, and new features kept breaking functionality that already worked

He describes his own reaction as excitement, concern, and unease at once, and adds a warning: a passing test suite is not a finished job — fully autonomous development carries real risks.

Why This Matters

Three angles. 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 had not expected 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 — any team can reproduce that recipe today with its own agent harness, and no special infrastructure is required. Third, the caution: how much the whole system deserves trust comes down to the quality of the tests. Once agents can clear every test and still ship flawed software, the bottleneck of autonomous development is no longer generation but verification.

References

AGENTIC COMMONSOperated by PHLEGON LABS
ShareXEmail
Support us

Related reading

  1. Anthropic Postmortem: Why Claude Code Got Worse for a Month

    Anthropic's April 23 postmortem ties a month of Claude Code complaints to three changes: lower reasoning effort, a cache bug wiping thinking history, and a verbosity prompt rule.

    Anthropic

  2. Agent Skills Goes Neutral: What the AAIF Handoff Changes

    Anthropic hands the Agent Skills standard, name, repo, and domain to the Linux Foundation's AAIF with community governance.

    Anthropic

  3. What a Multi-Agent Onboarding Assistant Changes for Open Finance Integration

    Ninth Wave's Compass uses per-task models and tenant-scoped grounding to cut API onboarding from weeks to a self-service workflow.

    Amazon Bedrock