We tasked Opus 4.6 using agent teams to build a C Compiler
TL;DR Highlight
16 parallel Claudes built a Rust C compiler that builds Linux 6.9 for under $20K.
Who Should Read
Backend or platform developers designing harnesses and tests for long-running autonomous coding agents
Core Mechanics
- A bash loop kept Claude working nonstop
- A while loop makes Claude pick up the next task as soon as it finishes one.
- The author says to run it only inside a container.
- Lock files plus git coordinated parallel agents
- Each agent claims a task by writing a text file under current_tasks/.
- If two agents claim the same task, git sync forces the second to pick another.
- There was no orchestration agent, so each Claude picked the next most obvious problem.
- Test quality decided the outcome
- The author says that if the verifier isn't nearly perfect, Claude solves the wrong problem.
- Late in the project new features often broke old ones, so he added CI and stricter checks.
- Test output was designed for Claude
- To avoid context pollution, the harness prints a few lines and logs the rest to files.
- Errors put ERROR and the reason on one line so grep finds them.
- Because Claude is time-blind, a default --fast option runs a 1% or 10% sample.
- GCC served as the oracle for the kernel
- The kernel is one giant task, so 16 agents hit the same bug and overwrote each other's fixes.
- Most files were built with GCC and only some with Claude's compiler, so each agent could chase a different file's bug.
- Agents got specialized roles
- Separate agents handled duplicate code, compiler speed, output code efficiency, Rust-style design critique, and docs.
- Results and limits were both clear
- About 2,000 sessions, 2B input and 140M output tokens, just under $20K produced a 100K-line Rust compiler.
- It builds Linux 6.9 on x86, ARM, and RISC-V and passes 99% of most test suites including GCC torture.
- With all optimizations on, its output is less efficient than GCC with optimizations off, and 16-bit x86 calls GCC.
Community Reactions
- A kernel-build veteran's reaction
- A commenter who spent nearly a decade getting Clang to build the Linux kernel was struck by this result.
- They noted that correctness and performance of generated code are the next milestones.
- Pushback: it's the tests, not the agent team
- Commenters argued that strong existing compiler test suites steered Claude to a well-defined solution.
- Some said a single agent could do it and parallelism just adds complexity.
- Real work is fuzzier than a compiler
- Commenters noted a C compiler is among the most rigorously specified software.
- They wondered how it translates to everyday work with shifting requirements.
- Doubts about 'clean-room'
- Commenters argued Opus is trained on GCC and Clang source and GCC was used as an oracle, so it isn't clean-room.
- Requests for prompts
- Commenters asked for the prompts and agent structure to learn from.
- One reported that the git history shows no human-written prompts.
How to Apply
- Add a --fast sampling option to your agent test runner
- Add an option that runs a random 1-10% of tests today.
- Fix the seed per agent so regressions show up on the same sample.
- Print a few summary lines and send details to a log file.
- Make logs grep-friendly
- Change failures to print ERROR and the reason on one line.
- Precompute aggregates like pass rates and write them to a file.
- Set up lock-file task claiming
- Have each parallel agent commit current_tasks/task_name.txt to claim work.
- Have it pull, merge, push, and delete the lock when done.
- Split giant tasks using a known-good implementation
- If a trusted implementation exists, swap in new code for only part of it so each agent owns a different piece.
- When it breaks, narrow the swapped range to find the cause.
Try It
#!/bin/bash
# Run only inside a container. Put AGENT_PROMPT.md in the working dir and replace {{model}}. Simplified version of the original harness.
mkdir -p agent_logs
while true; do
COMMIT=$(git rev-parse --short=6 HEAD)
LOGFILE="agent_logs/agent_${COMMIT}.log"
claude --dangerously-skip-permissions \
-p "$(cat AGENT_PROMPT.md)" \
--model {{model}} &> "$LOGFILE"
doneTerminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques