Sixteen AI Agents Built a C Compiler From Scratch
3 160Anthropic researcher Nicholas Carlini set 16 instances of Claude Opus 4.6 loose on a shared codebase over two weeks to build a C compiler from scratch, and the AI agents produced a 100,000-line Rust-based compiler capable of building a bootable Linux 6.9 kernel on x86, ARM and RISC-V architectures.
The project ran through nearly 2,000 Claude Code sessions and cost about $20,000 in API fees. Each instance operated inside its own Docker container, independently claiming tasks via lock files and pushing completed code to a shared Git repository. No orchestration agent directed traffic. The compiler achieved a 99% pass rate on the GCC torture test suite and can compile major open source projects including PostgreSQL, SQLite, Redis, FFmpeg and Doom. But it lacks a 16-bit x86 backend and calls out to GCC for that step, its assembler and linker remain buggy, and it produces less efficient code than GCC running with all optimizations disabled.
Carlini also invested significant effort building test harnesses and feedback systems to keep the agents productive, and the model hit a practical ceiling at around 100,000 lines as bug fixes and new features frequently broke existing functionality.
3 comments
Re:Congratulations (Score: 5, Funny)
by Buchenskjoll ( 762354 ) on Tuesday February 10, 2026 @04:26AM (#65979524)
My old car was a rust compiler.
Doesn't sound like "from scratch" to me! (Score: 5, Insightful)
by crgrace ( 220738 ) on Monday February 09, 2026 @03:30PM (#65978466)
From TFA:
When all 16 agents got stuck trying to fix the same Linux kernel bug simultaneously, he used GCC as a reference oracle, randomly compiling most kernel files with GCC and only a subset with Claudeâ(TM)s compiler, so each agent could work on different bugs in different files.
Not only was Claude trained on a lot of different C compilers, including the entirety of GCC, it still needed a golden model in order to finish.
If I claimed I had written my own C compiler from scratch and then this came out in an interview, I don't think I would be hired.
Re: A C compiler written in Rush (Score: 5, Funny)
by PCM2 ( 4486 ) on Monday February 09, 2026 @04:21PM (#65978592)
Because it has sick drumming, dude!