← All articles

Stories

Sixteen Claudes and the Compiler They Couldn't Leave Behind

Nicholas Carlini gave 16 agents a Linux build to solve. An old compiler helped them get it working and kept a small but decisive job for itself.

Sixteen Claudes and the Compiler They Couldn't Leave Behind

By Ted Mavera, Product Manager at HarnessUp · November 24, 2026

One Broken Build

Sixteen Claude agents were trying to build the Linux kernel, and they kept running into the same bug. An agent would fix it, then another would overwrite the change while trying to fix it too. Nicholas Carlini, a researcher on Anthropic's Safeguards team, had set them up to work on separate problems. The Linux build was giving all 16 the same one. Carlini described the pileup in his February 5 account of the experiment for Anthropic.

The assignment was to write a C compiler in Rust that could build Linux. The agents wrote Rust, and their compiler had to read C and turn it into instructions for different kinds of processors. A test could check whether the compiler handled an individual piece of C as expected. The Linux build gave Carlini another result he could check. Once the compiler made it through the kernel's source files, the resulting kernel still had to start.

Carlini had used a C compiler as a test for earlier Claude models, too. He reported that Opus 4.5 could get a compiler through large test suites, but it still fell short on large software projects. With Opus 4.6, Linux was the next test. The agents would work on a shared codebase across a succession of Claude Code sessions, and Carlini would work on the setup that told them whether their changes were helping.

By the time the agents were getting stuck on Linux, they had already found a way to divide other work. Carlini says they took on small projects such as SQLite and Redis separately once the compiler was passing 99 percent of its tests. A problem compiling SQLite could send one agent into one part of the Rust code while a Redis failure sent another agent somewhere else. The failing Linux build kept bringing the agents back to the same place. That was where Carlini brought in GCC, the established compiler he used to build the kernel.

A File to Claim

Before GCC came into the Linux test, Carlini had given the agents a way to tell each other what they were doing. Each worked in its own Docker container and shared changes through Git. To claim a piece of work, an agent put a text file in a directory called current_tasks. A file could say, in effect, that somebody was already working on how the compiler reads an if statement. If two agents tried to claim that job, the second would have to choose something else. When an agent finished, it pulled in the other changes, merged them with its own and removed the claim. Carlini says merge conflicts were common. The claim covered one task, and a change made for another task could still touch the same Rust file. Both edits would then have to make it into the shared version of that file. There was no lead agent handing out jobs, so what the next Claude Code session could find in Git mattered. A task file could show that the if statement was already spoken for, and the README and progress files could show what had been tried on the tasks still open. Carlini also gave some agents standing jobs, such as looking for duplicate code or tending the documentation. Those jobs could continue while other agents worked on the compiler's output. The source and commit history are available in Anthropic's Claude C Compiler repository.

The tests had to carry instructions of their own. A new Claude Code session arrived in a fresh container, and a wall of terminal output gave it a lot to read before it got to the first useful error. Carlini set up the tests to print a short result and keep the details in a log. An agent could look for ERROR and get the reason on the same line. A fast test option could run a sample of the suite, with each agent getting a repeatable sample to compare before and after a change. If a test passed on the second run, the agent could check that it was the same test that had failed on the first. The sample also left some tests to the checks on the shared code. That mattered late in the run, when Carlini saw agents add a feature and break something that had already worked. He set up continuous integration and tightened the checks on new commits. A repair could pass the test that prompted it and still break a case the agent had left out of its sample. Carlini describes the short test output and the stricter checks in his notes on running the agent team.

Two Compilers, One Kernel

Carlini changed the Linux test so that GCC compiled most of the kernel's files and Claude's compiler handled a smaller selection. The build joined the results into one kernel. If it booted, the files Claude had compiled had worked in that combination. If it failed, the agents could give some of those files back to GCC and run the test again. An agent could build the kernel once with a file compiled by Claude's compiler, then again with the same file compiled by GCC while keeping the rest of the build the same. If the second kernel booted, the agent had a place to start looking for a difference in the instructions the two compilers had produced. Carlini described the mixed build in Anthropic's account of the Linux test.

Now two agents could work on different sets of Linux files and get different failures.

There was still a case the mixed build could hide. Take two Linux files whose compiled code has to work together. In one run, Claude's compiler could handle the first file and link it with GCC's version of the second. In another, the compilers could trade places and the kernel could still boot. Both runs would have included code from each compiler. Only a third build, with Claude's compiler handling both files, would show what happened when its two sets of instructions met in the same kernel. Carlini reported having to look for those pairs even after the agents made their way through the individual files. Anthropic's report describes the remaining failures.

Diagram showing GCC compiling most Linux kernel files and Claude’s C Compiler handling a smaller set, with both sets feeding the same test kernel.

By the end of the two-week run, Carlini counted nearly 2,000 Claude Code sessions and just under $20,000 in API costs. The agents had produced a Rust compiler of about 100,000 lines. It could build a bootable Linux 6.9 kernel on x86, ARM and RISC-V, and it could compile programs including FFmpeg and SQLite. Across those sessions, Anthropic recorded 2 billion input tokens and 140 million output tokens. The line count describes the finished compiler, while the token counts also include the work that went into it, such as reading test output and writing changes along the way. Both sets of figures appear in Carlini's published evaluation.

For developers looking at their own Claude Code or Codex sessions, Deep Scan reads saved conversations on their machine and shows where each conversation used tokens. It's part of HarnessUp's local token measurement and saving tools.

The 32K Limit

A bootable Linux kernel still leaves room for several tools to do the work. The compiler translates the C program into instructions for the target processor. In a build that uses separate tools, an assembler turns those instructions into object files and a linker joins the pieces. GCC's driver can run those stages together, so a single command can cover work done by more than one program. The GCC manual describes where each stage starts and stops.

In Anthropic's demo, the build used GCC's assembler and linker. On x86 there was a further job for GCC, before the main kernel could get going. The boot path Carlini tested begins with 16-bit setup code, which has to fit into 32 kilobytes. The limit applies to the code the boot loader reads at the beginning. The 32-bit and 64-bit kernel code comes later. The Linux kernel's x86 boot documentation describes that setup stage.

Claude's compiler generated more than 60 kilobytes for that 16-bit stage.

Carlini reported that the instructions it generated were correct, but they took up more space than the Linux boot path allowed. The agents' compiler supplied its own 32-bit and 64-bit x86 code. For the 16-bit setup code on x86, the build called GCC. Carlini says the ARM and RISC-V builds needed no corresponding fallback at that stage. His February report gives the size of the output and the fallback it used.

Linux 6.9 booted on x86 with that first piece of code built by GCC. The old compiler was still in the build.

This article was drafted with AI assistance in HarnessUp Publish and approved by the HarnessUp team before publishing.