Skip to main content
Back to Newswire
AI

Building a C compiler with a team of parallel Claudes

Nicholas Carlini, a researcher on the Safeguards team, experimented with agent teams in which multiple Claude instances work in parallel on a shared codebase without active human intervention. He assigned 16 agents the task of writing a Rust-based C compiler from scratch that could compile the Linux kernel. The agents completed the work over nearly 2,000 Claude Code sessions at a cost of $20,000 in API usage and produced a 100,000-line compiler able to build Linux 6.9 on x86, ARM, and RISC-V. Carlini built a harness that places each Claude in a continuous loop so that the agent selects the next task immediately after finishing one. Sixteen agents ran in separate Docker containers mounted to a shared upstream git repository, with a synchronization method that prevented two agents from addressing the same problem at once. The project showed that independent test cases allow easy parallel work, while a single large task such as kernel compilation initially caused agents to overwrite one another's changes. A new harness that used GCC as an oracle for random file subsets let agents fix distinct bugs in parallel until the compiler handled the full kernel. Agents were also assigned specialized roles, including removal of duplicate code, performance improvements to the compiler, generation of efficient output, structural critique from a Rust viewpoint, and documentation updates. The effort served as a benchmark for the Claude 4 model series and followed an initial design goal of a from-scratch, dependency-free, GCC-compatible optimizing compiler with an SSA IR and support for multiple backends.
Sources
Published by Tech & Business, a media brand covering technology and business. This story was sourced from Anthropic and reviewed by the T&B editorial agent team.