Anthropic Agent Teams Build a 100,000-Line C Compiler
The successful construction of a 100,000-line C compiler by a team of 16 parallel Claude agents demonstrates a major leap toward autonomous, long-running software development using large language models.
This research focuses not only on the resulting compiler artifact but also on the advanced scaffolding required to keep multiple LLM instances on track, manage complex codebases, and maintain progress without active human intervention.
Agent Team Architecture for Autonomous Development
Autonomous progress in LLM agents requires a fundamental shift from interactive sessions to sustained, self-directed loops.
Enabling Long-Running Agents
Existing LLM agent scaffolds typically require a human operator to provide continuous input, causing the model to halt when facing a complex, long-term problem. To overcome this, the researchers implemented a harness that forces Claude into a simple, continuous loop. When an agent completes one task, it immediately proceeds to the next, maintaining sustained, autonomous progress until the objective is met.
Parallelization and Synchronization
Running multiple Claude instances in parallel addresses two critical weaknesses of single-agent systems: the inability of one session to debug multiple issues simultaneously, and the potential for specialization.
The implementation uses a bare Git repository structure where each agent operates in its own Docker container. To prevent agents from simultaneously attempting to solve the same problem, the harness employs a simple synchronization algorithm:
- An agent claims a task by writing a lock file (e.g.,
current_tasks/parse_if_statement.txt). - If a second agent attempts to claim the same task, Git's synchronization mechanism forces the second agent to select a different task.
- The agent works, pulls changes from the upstream repository, merges changes from other agents, pushes its own changes, and then removes the lock.
This system allows agents to work concurrently on different parts of the compiler, even when merge conflicts occur, which Claude is capable of resolving.
Key Lessons in Orchestrating LLM Agents
The most significant effort in this project was designing the environment—including tests, feedback, and structure—to allow Claude to orient itself and make progress without human guidance.
High-Quality Testing and CI
Since Claude operates autonomously, the task verifier must be nearly perfect; otherwise, the model will solve the wrong problem. The researchers found that improving the testing harness required finding high-quality compiler test suites and building verifiers and build scripts for open-source packages. Furthermore, a continuous integration pipeline was implemented to strictly enforce that new commits do not break existing functionality.
Designing for LLM Limitations
The test harness was designed specifically around inherent limitations of language models, including context window pollution and time blindness.
- Context Window Pollution: To prevent the context window from being filled with useless data, the harness logs all important information to files. Errors are logged in a structured manner (e.g.,
ERRORfollowed by the reason on the same line) to facilitate automated processing. - Time Blindness: Since Claude cannot perceive time, the harness prints incremental progress infrequently. It also includes a default
--fastoption that runs a small, deterministic random sample of tests, ensuring progress without overwhelming the context.
Solving Parallelization Bottlenecks
When agents began compiling the Linux kernel, they frequently encountered the same bugs, leading to redundant work. The solution was to integrate GCC as an online known-good compiler oracle. A new test harness randomly compiled most of the kernel using GCC, leaving only the remaining files for Claude’s compiler. This allowed agents to work in parallel on different files, fixing unique bugs until Claude’s compiler could compile the entire kernel.
Specialization Through Multiple Roles
Parallelism enables specialization beyond simply fixing bugs. The team assigned distinct roles to different agents, including:
- Coalescing duplicate code found in LLM-written code.
- Improving the performance of the compiler itself.
- Ensuring the output compiled code was efficient.
- Critiquing the project's design from a Rust developer's perspective.
- Maintaining project documentation.
Compiler Capabilities and Limitations
Over two weeks, the project consumed 2 billion input tokens and generated 140 million output tokens, totaling just under $20,000. The resulting 100,000-line compiler is a functional artifact that has reached the current limits of the Claude 4 model series.
Proven Capabilities
The compiler can successfully build a bootable Linux 6.9 on x86, ARM, and RISC-V. It also compiles various open-source projects, including QEMU, FFmpeg, SQlite, postgres, and redis. It maintains a 99% pass rate on most compiler test suites, including the GCC torture test suite, and can compile and run Doom.
Current Technical Limitations
The compiler is not yet a drop-in replacement for a professional compiler, and several limitations remain:
- Missing Core Components: The compiler lacks its own assembler and linker, which are the final components being automated and remain somewhat buggy.
- Code Efficiency: Even with all optimizations enabled, the generated code is less efficient than code produced by GCC with all optimizations disabled.
- 16-bit x86 Support: The compiler cannot implement the necessary 16-bit x86 code generator required to boot Linux out of real mode. For this specific phase, it currently calls out to GCC.
- Code Quality: While the Rust code quality is reasonable, it does not match the standard produced by an expert Rust programmer.
Implications for Future Software Development
Agent teams represent a paradigm shift from using LLMs for simple tasks like tab-completion to enabling the autonomous implementation of entire, complex software projects.
While this capability is highly exciting, the researchers caution that fully autonomous development introduces significant risks. Unlike human-supervised development, where errors can be caught in real time, autonomous systems can report passing tests while still containing critical flaws. The rapid progress in LLMs opens the door to writing vast amounts of new code, but this new world requires new strategies to navigate safely, ensuring that the positive applications outweigh the inherent risks of deploying unverified software.