techlist.io
Anthropic2026-02-055 min read

Curated summary

Building a C compiler with parallel Claudes

Read original(opens in new tab)

Enabling Long-Running Claudes with Agent Teams

Nicholas Carlini, a researcher on Anthropic's Safeguards team, describes "agent teams," a setup where multiple Claude instances work in parallel on a shared codebase without human intervention. To test it, he tasked 16 agents with writing a Rust-based C compiler from scratch that could build the Linux kernel. Across nearly 2,000 Claude Code sessions and about $20,000 in API costs, the team produced a 100,000-line compiler that builds Linux 6.9 on x86, ARM, and RISC-V. The post's main lesson is that the work shifts from writing code to designing the environment (tests, feedback, and coordination) so agents can orient themselves and make progress on their own.

Autonomous Loop Harness

  • Existing tools like Claude Code stop and wait for human input, so Carlini wrote a bash loop that restarts a Claude session with the same prompt whenever one finishes.
  • The agent prompt asks Claude to break the problem into small pieces, track its work, choose the next task, and keep going.
  • The loop should run in a container, since agents can do destructive things. In one case, Claude ran pkill -9 bash and ended its own loop.

Parallel Agents and Task Locking

  • Parallel agents address two limits of a single session: only one task runs at a time, and specialized agents can handle side jobs such as documentation, code quality, or subtasks.
  • Each agent runs in its own Docker container with a local clone of a shared bare git repo mounted at /upstream. Agents push and pull through git.
  • To avoid duplicate work, an agent locks a task by writing a file to current_tasks/. If two agents claim the same task, git sync forces one to pick another. After finishing, the agent pulls, merges, pushes, and removes its lock. Merge conflicts were frequent, but Claude resolved them.
  • There is no orchestrator and no formal communication channel between agents. Each agent chooses the "next most obvious" problem and often keeps a running doc of failed approaches.

Designing the Environment for Claude

Write extremely high-quality tests. Claude solves whatever problem the verifier describes, so a flawed verifier means the wrong problem gets solved. Carlini drew on existing compiler test suites, wrote verifiers and build scripts for open-source projects, and added new tests as failure modes appeared. Late in the project, Claude kept breaking existing features, so he added a CI pipeline that blocks commits that break existing code.

Design for the model's limitations.

  • Context pollution: Output should be a few lines, with details written to log files. Errors are tagged with ERROR on the same line so grep can find them, and summary statistics are precomputed.
  • Time blindness: Claude cannot judge elapsed time and will run slow tests for hours. The harness prints progress rarely and offers a --fast mode that runs a random 1% or 10% sample. The sample is deterministic per agent but varies across agents, so the whole codebase gets covered while each agent can still spot regressions.

Orient agents from scratch. Each agent starts in a fresh container with no context, so the harness requires extensive READMEs and progress files that agents keep updated.

Making Parallel Work Possible

  • Parallelism is easy when there are many independent failing tests, since each agent takes a different one. After the suite reached 99%, agents worked on compiling different open-source projects such as SQLite, Redis, libjpeg, MQuickJS, and Lua.
  • Compiling the Linux kernel was one giant task, so all 16 agents hit the same bug and overwrote each other. The fix was to use GCC as a known-good oracle: most kernel files were compiled with GCC and only a random subset with Claude's compiler. Agents could then fix different bugs in different files. Delta debugging found pairs of files that failed together but worked separately.

Specialized Agent Roles

Carlini assigned agents to specific jobs: removing duplicated code, improving compiler performance, generating efficient output code, critiquing the design from a Rust developer's perspective, and writing documentation.

Results and Limitations

  • Cost and scale: Opus 4.6 used about 2 billion input tokens and 140 million output tokens over two weeks, for just under $20,000.
  • Clean room: Claude had no internet access and relied only on the Rust standard library.
  • Capabilities: The 100,000-line compiler builds a bootable Linux 6.9 on x86, ARM, and RISC-V, and compiles QEMU, FFmpeg, SQLite, Postgres, and Redis. It passes about 99% of most compiler test suites, including the GCC torture tests, and can compile and run Doom.
  • Limitations:
    • On x86 it calls GCC for 16-bit real-mode code, because its output exceeds Linux's 32 KB limit. ARM and RISC-V compile fully on their own.
    • It has no native assembler or linker yet; the demo used GCC's.
    • It does not build every project and is not a drop-in GCC replacement.
    • Generated code is less efficient than GCC with all optimizations disabled.
    • The Rust code is reasonable but not expert-level.
    • Fixes often broke existing functionality, suggesting Opus 4.6 is near the limit of what this setup can reliably do.

Looking Ahead

Carlini sees agent teams as a step beyond tab completion and single-task tools like Claude Code, enabling autonomous construction of complex projects. He also warns that autonomous development is risky. Passing tests can create false confidence, and code deployed without human verification is a real concern. He calls the experiment exciting but unsettling, and expects the benefits to outweigh the harms while calling for new safety strategies.

Continue with another curated summary.