並列ClaudeチームによるCコンパイラの構築
Opus 4.6にエージェントチームを使ってCコンパイラを構築させ、ほぼ放置した結果から、自律的ソフトウェア開発の未来について学んだことを紹介。
キーポイント
Anthropicが16体のClaudeエージェントチームでCコンパイラを自律開発(Linuxカーネルをコンパイル可能な10万行のRust製コンパイラ)
人間の介入なしで長期自律動作するエージェントチームのハーネス設計手法を確立(テスト設計、並列作業構造化など)
約2,000セッション・2万ドルのコストで複数アーキテクチャ対応コンパイラを完成させ、自律ソフトウェア開発の可能性を示した
影響分析・編集コメントを表示
影響分析
この実験は、LLMエージェントによる大規模複雑システムの自律開発が現実的段階に入ったことを示す。人間の継続的監督なしで複数エージェントが協調して作業する「エージェントチーム」パラダイムは、ソフトウェア開発の自動化を根本から変える可能性がある。
編集コメント
「AIがAIを管理する」自律開発の実証実験として極めて示唆的。2万ドルというコストも現実的な水準で、近未来の開発現場を想像させる。
アンソロピック社の研究者ニコラス・カリーニは、大規模言語モデル(LLM)エージェントの自律的なソフトウェア開発能力を探るため、「エージェントチーム」という新たな監督手法を用いた実験を行った。この手法では、複数のClaudeインスタンスが人間の介入なしに並行して共有コードベース上で作業する。
実験では、16体のエージェントに、Linuxカーネルをコンパイル可能なRustベースのCコンパイラをゼロから作成する課題を与えた。約2,000回のClaude Codeセッションと2万ドルのAPIコストを費やし、エージェントチームは10万行に及ぶコンパイラを完成させた。このコンパイラはLinux 6.9をx86、ARM、RISC-Vアーキテクチャ向けにビルドできる能力を有している。
この取り組みを通じて得られた主な知見は、長期間自律動作するエージェントチームを管理する「ハーネス」(制御枠組み)の設計に関するものである。具体的には、人間の監督なしでエージェントを正しい軌道に保つテストの書き方、複数のエージェントが並行して進捗を出せる作業の構造化、そしてこの手法が限界に達するポイントの特定である。
従来のClaude Codeのようなエージェント基盤では、オペレーターがオンラインで共同作業する必要があった。複雑な問題に対してモデルは一部を解決しても、やがて停止し、さらなる指示を待つ状態になる。
これを克服するため、研究者はClaudeを単純なループ内で動作させるハーネスを構築した。エージェントは一つのタスクを終えると、直ちに次のタスクを選択する。エージェントへのプロンプトでは、解決すべき問題を示し、それを小さな部分に分解し、作業内容を追跡し、次に行うべきことを判断し、完璧になるまで継続するよう指示した。
複数のインスタンスを並行して実行することは、単一エージェントの弱点を補う。第一に、一つのClaude Codeセッションは同時に一つのことしかできないが、プロジェクト規模が拡大するにつれ、複数の問題を並行してデバッグする方がはるかに効率的である。第二に、複数のClaudeエージェントを実行することで専門分化が可能となる。いくつかのエージェントが当面の問題の解決に当たる間、他の専門化されたエージェントは、ドキュメンテーションの維持やコード品質の監視などの補助的タスクを担当できる。
この実験は、自律的なソフトウェア開発の未来を示唆するものであり、エージェントチームが大規模で複雑なエンジニアリングプロジェクトにどのように適用され、またその限界がどこにあるのかを探求する重要な一歩となった。完成したコンパイラ自体も興味深い成果物だが、本研究の核心は、長期自律動作を可能にするシステム設計の方法論にある。
原文を表示
Engineering at AnthropicBuilding a C compiler with a team of parallel Claudes
We tasked Opus 4.6 using agent teams to build a C Compiler, and then (mostly) walked away. Here's what it taught us about the future of autonomous software development.
Written by Nicholas Carlini, a researcher on our Safeguards team.
I've been experimenting with a new approach to supervising language models that we’re calling "agent teams."
With agent teams, multiple Claude instances work in parallel on a shared codebase without active human intervention. This approach dramatically expands the scope of what's achievable with LLM agents.
To stress test it, I tasked 16 agents with writing a Rust-based C compiler, from scratch, capable of compiling the Linux kernel. Over nearly 2,000 Claude Code sessions and $20,000 in API costs, the agent team produced a 100,000-line compiler that can build Linux 6.9 on x86, ARM, and RISC-V.
The compiler is an interesting artifact on its own, but I focus here on what I learned about designing harnesses for long-running autonomous agent teams: how to write tests that keep agents on track without human oversight, how to structure work so multiple agents can make progress in parallel, and where this approach hits its ceiling.
Existing agent scaffolds like Claude Code require an operator to be online and available to work jointly. If you ask for a solution to a long and complex problem, the model may solve part of it, but eventually it will stop and wait for continued input—a question, a status update, or a request for clarification.
To elicit sustained, autonomous progress, I built a harness that sticks Claude in a simple loop (if you’ve seen Ralph-loop, this should look familiar). When it finishes one task, it immediately picks up the next. (Run this in a container, not your actual machine).
#!/bin/bash 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 claude-opus-X-Y &> "$LOGFILE" done CopyIn the agent prompt, I tell Claude what problem to solve and ask it to approach the problem by breaking it into small pieces, tracking what it’s working on, figuring out what to work on next, and to effectively keep going until it’s perfect. (On this last point, Claude has no choice. The loop runs forever—although in one instance, I did see Claude pkill -9 bash on accident, thus killing itself and ending the loop. Whoops!).
Running multiple instances in parallel can address two weaknesses of a single-agent harness:
One Claude Code session can only do one thing at a time. Especially as the scope of a project expands, debugging multiple issues in parallel is far more efficient.
Running multiple Claude agents allows for specialization. While a few agents are tasked to solve the actual problem at hand, other specialized agents can be invoked to (for example) maintain documentation, keep an eye on code quality, or solve specialized sub-tasks.
My implementation of parallel Claude is bare-bones. A new bare git repo is created, and for each agent, a Docker container is spun up with the repo mounted to /upstream. Each agent clones a local copy to /workspace, and when it's done, pushes from its own local container to upstream.
To prevent two agents from trying to solve the same problem at the same time, the harness uses a simple synchronization algorithm:
Claude takes a "lock" on a task by writing a text file to current_tasks/ (e.g., one agent might lock current_tasks/parse_if_statement.txt, while another locks current_tasks/codegen_function_definition.txt). If two agents try to claim the same task, git's synchronization forces the second agent to pick a different one.
Claude works on the task, then pulls from upstream, merges changes from other agents, pushes its changes, and removes the lock. Merge conflicts are frequent, but Claude is smart enough to figure that out.
The infinite agent-generation-loop spawns a new Claude Code session in a fresh container, and the cycle repeats.
This is a very early research prototype. I haven’t yet implemented any other method for communication between agents, nor do I enforce any process for managing high-level goals. I don’t use an orchestration agent.
Instead, I leave it up to each Claude agent to decide how to act. In most cases, Claude picks up the “next most obvious” problem. When stuck on a bug, Claude will often maintain a running doc of failed approaches and remaining tasks. In the git repository of the project, you can read through the history and watch it take out locks on various tasks.
Lessons from programming with Claude agent teams
The scaffolding runs Claude in a loop, but that loop is only useful if Claude can tell how to make progress. Most of my effort went into designing the environment around Claude—the tests, the environment, the feedback—so that it could orient itself without me. These are the appro
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み