1,000 Claude Agents Formalized Fermat's Last Theorem — Lance Martin, Anthropic
Loading slides…
Read the talk
1,000 Claude Agents Formalized Fermat’s Last Theorem
Anthropic’s agents used Git and SQL to organize a Lean formalization over about 30 hours. Lance Martin then follows Claude’s memory from notes written during a task to later passes that break a Pokémon navigation loop and build a wiki from company records.
From a talk by Lance Martin
At a glance
Ideas worth remembering
Lean checked the proof. With Git and SQL for coordination, the agents built their own assignment and progress tables, broke hard statements into dependent tasks, and moved workers as statements were solved.
A memory directory pays off when a model can tell what is worth saving and when a later question calls for a lookup. Both behaviors helped explain the differences across models in CLB’s 40 fresh sessions.
Dreaming gives Claude a chance to revise what later sessions inherit. In Pokémon, a later pass broke a navigation loop. In the wiki experiments, extra passes improved the reference Claude could consult or filled pages an earlier pass had left unfinished.
From a paper proof to a Lean proof
Fermat’s Last Theorem fits on one line. For an integer exponent $n > 2$, the equation $a^n + b^n = c^n$ has no solution in positive integers $a$, $b$, and $c$. The original proof took seven years of work and appeared in the mid-1990s. Formalizing it is a second job. Each step in the chain of reasoning has to be expressed precisely enough for Lean to check it.
In Anthropic’s first formalization, reported in September, roughly a dozen Claude agents struggled to coordinate. A specialized proof-orchestration platform helped them track the state of the work. The setup gave them a proof graph they could query, and a researcher provided substantial support. Lance Martin’s follow-up kept Lean as the proof checker and asked whether a much larger team could organize the work itself.
Give 1,000 agents Git and a SQL database
Each agent ran in its own sandbox with restricted network access. The sandboxes could reach two shared services, Git and a SQL database. Anthropic monitored every tool call in real time for activity such as attempted sandbox escapes. A separate offline review checked all agent runs every 10 minutes.
The prompt established one lead and 999 helpers, described the available tools, and gave the team the problem statement. The follow-up dropped the specialized coordination platform. Researchers left decisions about the solution to the agents, including how to divide and track the work.
The lead agent builds its own coordination tables
About five minutes into the run, the lead created a set of SQL tables on its own. The lead turned the shared database into a place where the team could coordinate.
- Announcements. The lead could broadcast updates that applied across the proof effort.
- Assignments. The lead gave workers roles and directed helpers to individual proof statements as work progressed.
- Notes. Agents posted observations and progress updates for one another.
- Subtasks and landed work. Separate tables tracked smaller pieces of work and marked which contributions had landed as Lean code.
How often did the lead need to broadcast to the whole team? The database activity trace shows writes in red above reads in green. Writes to the announcement table came only occasionally. The lead used it for major updates while agents coordinated work on individual statements through assignments and notes. 4:32
Break down hard statements and move agents as work finishes
For one of the harder statements, the agents built a task tree. Which smaller pieces did a larger piece depend on? The branches recorded those dependencies, and the display showed tasks moving from in progress to done, with completed work marked in red. The tree made it possible to follow progress inside a single proof statement. 5:23
The allocation chart zooms out to the proof’s 60 statements. As statements were solved, the lead reassigned helpers and agents also moved themselves to other parts of the proof. The team finished the formalization in about 30 hours. A closing note called for a freeze of the Git origin and signed off with “magnificent work all 999 of you.” 5:46
The run showed that this team could build its own proof coordination with Git and SQL under Anthropic’s monitoring. Team size, proof-specific tooling, and researcher involvement all changed from the earlier run, leaving open how much adding agents contributed on its own.
A useful note today can become clutter tomorrow
An agent writes a note when something seems important to the task at hand. It knows what just happened and has only a partial view of what later sessions will need. A series of sensible decisions about what to save in the moment can leave overlapping fragments where a future session needs a coherent account.
Martin draws an analogy to overnight memory consolidation, in which replaying parts of the day’s experience is thought to help turn them into long-term knowledge. The corresponding design gives agent memory two jobs. During a task, capture observations while they are fresh. Later, review the records together and decide what should carry forward.
What a memory directory buys across 40 fresh sessions
CLB, an open-source continual-learning benchmark, gives Claude 40 questions about a database, each in a fresh session. The experiment compares runs with and without a memory directory. When the directory is available, a note saved while answering one question can help answer a later one. The prompt tells Claude it can use the directory and leaves the timing of reads and writes up to the model.
How much did access to the directory help? The chart pairs a solid bar for memory with a hatched bar for the run without it. Sonnet 4.6 gained little. In Anthropic’s review of the runs, it saved observations inconsistently and seldom looked up notes on its own. Stronger models made better use of the same setup. They chose when to read and write more reliably, and their notes included checked claims about the database and predictions about what might happen next. 9:40
What Claude chooses to save while playing Pokémon
While playing Pokémon, Claude could write whatever it wanted to a memory directory. How did two models use that freedom? In the directory comparison, each box is sized by its number of files. The box sizes show how much each model wrote, and the contents of the notes explain what each model thought was worth keeping. 11:05
- Sonnet 3.7 recorded a wide range of experiences, including many with little strategic value. The result was a large, unwieldy directory.
- Fable 5 kept a smaller directory focused on tactics and strategy, especially information that would be hard to recover from the game state alone.
Fable 5 also got further in the game. The model and the contents of its memory changed together, leaving open how much the tighter directory contributed to that progress.
Dreaming over transcripts and notes
In both experiments, Claude wrote memory while doing the task. A transcript gives a later session a fuller record to search, at the cost of sifting through a lot of material for a few relevant details. A memory note puts a selected observation within easier reach. That selection reflects what looked important during the original task.
Dreaming gives Claude a separate pass over transcripts and existing notes. What does a future session have to look up, and what can it start with? Claude can organize material into a wiki that later sessions consult when needed. It can also promote selected memories to injected context, which loads automatically in every future session.
What does a future session look up or receive automatically?
Read the diagram as text
- Transcripts. Recorded during work — Searchable records of earlier tasks.
- Memory notes. Recorded during work — Observations the agent chose to save during a task.
- Dreaming pass. Revisits existing records and reorganizes selected information.
- Wiki. Possible dreaming outputs — Organized knowledge to consult for later questions.
- Injected context. Possible dreaming outputs — Selected memories loaded into every future session.
- Future session. Can receive selected memories at startup and retrieve more information as needed.
- Transcripts → Dreaming pass: Records for review.
- Memory notes → Dreaming pass: Observations for review.
- Transcripts → Future session: Details found through search.
- Memory notes → Future session: Notes retrieved on demand.
- Dreaming pass → Wiki: Organize knowledge into pages.
- Dreaming pass → Injected context: Select memories to preload.
- Wiki → Future session: Pages consulted as needed.
- Injected context → Future session: Load at session start.
A wrong landmark sends Claude through the same trapdoor
During one Pokémon run, Claude saved the wrong location for a landmark. When that memory came back into context, Claude reached the landmark area and used the note to place itself in the wrong spot. It fell through a trapdoor and landed back on the previous level. When Claude reached the same point again with the same memory, it kept making the same mistake.
Could a later pass break the loop? On the trajectory chart, upward movement means game progress and downward movement means regression. With raw memory, Claude kept losing progress when it reached the trapdoor. The orange trajectory, with memory and dreaming, passes that point and reaches the next level. The specific change to the stored memory remains unspecified. 14:47
Build a company wiki before answering questions
After acquiring Stainless, Anthropic made an anonymized dataset from company documents, Slack messages, and other records. The team wrote 25 questions that could only be answered from that corpus. Semantic search could pull relevant material from the records at question time. A second approach let Claude spend tokens up front building a wiki from those same records.
What did extra compute before answering buy? Semantic search alone scored about 53% on the question set. As Anthropic increased the token budget for dreaming, the resulting wiki helped Claude answer more questions. Giving Claude both the wiki and the search tool also improved performance over search alone. The combined setup could reuse pages that brought related facts together and still retrieve passages from the underlying records. 16:10
Fill the pages the wiki already points to
A separate benchmark started with a wiki Claude had already built. Some entries were placeholders for pages that had yet to be written. The wiki had recorded topics it meant to cover, leaving a visible list of gaps for a later pass.
What changed between the two versions? Dreaming took the existing wiki as input and filled the missing pages in this example. A pass over the wiki can also produce an index. The placeholders made the omissions visible, giving the later pass specific entries to complete. 17:24
Full transcript
Loading transcript…