Skip to content

Blog

Anthropic shares an experiment in which 1,000 Claude Fable 5.2 agents rebuilt the proof of Fermat's Last Theorem

9 min read

Cover image made from the Claude logo, Fable 5.2 and François de Poilly's 17th-century engraved portrait of Pierre de Fermat (portrait: Wikimedia Commons, public domain)
Cover image made from the Claude logo, Fable 5.2 and François de Poilly's 17th-century engraved portrait of Pierre de Fermat (portrait: Wikimedia Commons, public domain)

On November 9 (US time), Anthropic published an experiment on the claude.dev blog in which it ran 1,000 agents at once. Using an early pre-release version of Claude Fable 5.2, it launched one lead agent and 999 helpers and had them formalize the proof of Fermat's Last Theorem in Lean again. It took 28.7 hours.

Fermat's Last Theorem states that there are no positive integers a, b and c that satisfy aⁿ + bⁿ = cⁿ when n is greater than 2. It went unsolved for more than 350 years, until Andrew Wiles published a 129-page proof in 1995. Formalization means rewriting every step of that proof so that a computer can check it. Lean is the programming language that does the checking.

Anthropic had already formalized the same proof in September. That time, it ran dozens of agents on an internal research model roughly on par with Claude Fable 5.1, with help from Prove2Me, a platform built specifically for formalizing mathematics, and direction from researchers. Over 11 days it used about 6 billion output tokens and produced 13 million lines of Lean code. This time there was no dedicated platform and no researcher steering the work along the way. Even so, it used only a third of September's output tokens, and the proof shrank to one-seventh of the length.

The agents' only tools were a shell, Git branches and a shared database.

Anthropic gave the agents 60 statements to prove (the final theorem and 59 intermediate steps), a one-line description of each, a one-sentence outline of the classical proof route, and 47 lemmas already proven in the September formalization. The only roles were one lead and 999 helpers. The lead was told to break the problem down and hand the pieces to helpers. The helpers were told to wait for the lead's instructions and to ask the lead when unsure. They were not told how to prove anything or how to organize the team.

The tools each agent received were just as spare.

  1. A shell and file editor inside a sandbox cut off from the network
  2. Lean tools and the Mathlib math library
  3. Its own Git branch and permission to open merge requests into main
  4. A shared Postgres database, accessed from the shell

It did not start at 1,000 agents. Anthropic says that when it packed agents onto a single machine, memory, disk and CPU ran out at around 100, and more than half of the 100-agent runs stalled partway or had to be restarted. So each agent got its own lightweight virtual machine, and the agents shared their work through a SQL database. Anthropic gave three reasons for choosing SQL: it is a general-purpose way to organize information, its transactions hold up even when 1,000 agents write at once, and Claude already knows it well.

Each of the 1,000 agents works inside its own sandbox and connects to the outside only through a single gateway. The gateway calls the Claude API and forwards Git and SQL requests to the repository and the database (Anthropic).
Each of the 1,000 agents works inside its own sandbox and connects to the outside only through a single gateway. The gateway calls the Claude API and forwards Git and SQL requests to the repository and the database (Anthropic).

The lead set up five database tables within 10 minutes.

Within 10 minutes of the run starting, the lead created five tables. They were team-wide instructions (Announce), an assignment sheet recording who owns what (Assign), a board anyone could post to (Notes), a task list where anyone could add tasks and the first helper to claim one took it (Subtasks), and a log of finished work (Landed). In human-company terms, the lead had set up its own announcements channel, assignment sheet, team board, task board and deployment log.

The five shared tables the lead created in the first 10 minutes. The lead wrote instructions and assignments, while the helpers logged finished work and managed the task list (Anthropic).
The five shared tables the lead created in the first 10 minutes. The lead wrote instructions and assignments, while the helpers logged finished work and managed the task list (Anthropic).

The lead assigned a group of 16 to 17 helpers to each statement and wrote 999 rows in the assignment sheet, one per helper. It named a captain for each group to post a plan and split up the work. It told every helper to first judge how hard its statement was and post that assessment to the board.

The helpers judged 47 of the 60 statements impossible, but proved most of them.

The assessments came in after about 27 minutes. Most helpers judged 47 statements impossible within this run's budget. The lead set those 47 aside and moved almost all the helpers onto the remaining 10. Each group grew from about 17 helpers to between 46 and 139. At around 45 minutes, with 5 of the 10 done, the lead wrote that “the team's throughput is far higher than the early ‘impossible within budget’ estimates.” All 10 were finished within 70 minutes.

Saying there was “no reason to sit idle,” the lead moved helpers onto the deferred statements. From then on, the helpers began writing tasks themselves. By hour 5.6, 73 helpers had written 756 tasks, and only 16 of them were captains. At hour 3, the lead wrote to idle helpers, “Don't wait for me.” The setup started with the lead handing out work. Within a few hours it had become one where helpers picked up work on their own.

About 750 helpers took on the last remaining theorem.

At around 18 hours, what remained was the Langlands–Tunnell theorem and the statements that depend on it. It is a classical result that Wiles's proof relies on. At this point, Anthropic restarted the run from the last checkpoint and gave it 12 more hours. The captain who had taken on this statement earlier estimated it would need at least 700,000 to 1 million lines of Lean code and put the chance of finishing in time at under 1%. The lead had also set it aside. With the other work nearly done, the lead moved about 750 helpers onto it, writing, “Honestly, the odds are low.”

Langlands–Tunnell needed about 9 times as many tasks as the other statements and more than twice as much new code. When a piece was too hard to finish alone, a helper split it again and attached smaller tasks beneath it. The task tree grew to 2,418 tasks, up to 10 levels deep. Each piece could move ahead by assuming the pieces below it were already proven, so hundreds of helpers could work at the same time.

The task tree growing under Langlands–Tunnell. The outer rings are more finely divided tasks, and finished tasks turn from gray to color (Anthropic).
The task tree growing under Langlands–Tunnell. The outer rings are more finely divided tasks, and finished tasks turn from gray to color (Anthropic).

Langlands–Tunnell was proven at hour 28.4, and the final theorem at hour 28.7. The lead's last message was: “Thank you, everyone. Fermat's Last Theorem is on main and verified with the official checker.”

Sandboxing and monitoring made the experiment possible.

The safeguards take up the largest part of Anthropic's post. There was no separate tool for agents to talk to each other. They communicated only through the database and Git. Agents could push only to their own branches, and a separate job handled merges into main. They connected to the database only through an unprivileged shared role, and each SQL statement had a 5-second limit and a 256MiB write limit. The only way out of the sandbox was a single channel to the gateway. The gateway attached each agent's identity to every request from outside the sandbox, so no agent could impersonate another. Tools for regaining root privileges, such as sudo, were removed, and the kernel was built without features that give root direct access.

On top of that were two layers of monitoring. An LLM classifier checked every shell command and file edit before it ran. It looked for attempts to escape the sandbox, probe its boundaries or tamper with the monitoring. If the lead was blocked, the whole run stopped and could restart only after a human reviewed it. If a helper was blocked, only that helper was removed. A separate offline monitor went back through the whole team's records, also looking into what other agents had done.

Across more than 1 million tool calls, none met the blocking threshold. When Anthropic later re-ran the check with a monitor that also reads the model's reasoning, using current criteria, only one call, which checked for root privileges, came close to being blocked. Anthropic said it runs experiments like this even on models that have not yet finished pre-release alignment evaluations, so it designs the monitoring on the assumption that the model may be misaligned.

In my November 2 post “How do Claude and Codex split a single task at AXIT?”, I described a setup that separates the agents doing the work from the agents checking it. The scale is different, but the principle is the same: keep the side doing the work separate from the side checking it.

The agents gave up on hard problems too early.

Anthropic calls this a “toy experiment.” It also said the result does not mean dedicated platforms like Prove2Me are no longer needed. They are still useful for compiling Lean code quickly and for finding and reusing results that humans have already proven.

There is still a role for people, too. Early on, the helpers judged 47 statements impossible, and the Langlands–Tunnell captain put the odds at under 1%. Both were wrong. During the run, the harness automatically reminded the lead of the remaining time 19 times and told it to keep going. Anthropic wrote that agents tend to give up on hard problems early and misjudge difficulty, so a human nudge at those moments can keep them from stopping too soon.

What held the 1,000 agents together was not a new collaboration tool but Git branches and five database tables. General-purpose tools were enough for coordination. The real effort went into the boundary that kept anything the agents did from leaking out. I think teams that want to put multiple agents to work should first decide how to set up sandboxing and monitoring, before choosing collaboration tools.

https://claude.dev/blog/safely-scaling-multi-agent-teams-with-fable-5-2/