All writing

Agent memory needs a cleanup job, and Claude's dreaming is one

Lance Martin of Anthropic showed how Claude reviews its own transcripts and notes between sessions to correct and reorganize memory. I explain the four layers, the evidence he showed, and why I think memory curation should be a scheduled job.

Diagram titled "How Claude dreams between sessions." A Session box flows into a Dreaming container and then into a Next session box. Inside Dreaming are four layers, top to bottom: Injected context (memory loaded into every session), Memory representations (computed from transcripts and notes, for example wikis), Memory notes (salient observations written by Claude) and Transcripts (searchable event log). Transcripts feed every layer above, and adjacent layers exchange information both ways. Adapted from Lance Martin, Anthropic.

Most agent memory today is a pile of notes. An agent can write a note in one session and act on it in a later one, even if the note is wrong. At AI Engineer Code Summit 2026, Lance Martin from Anthropic showed what happens when the model goes back and cleans that pile up. He calls it "dreaming."

I want to walk through what it is, what he showed, and why I think the idea matters more than the name suggests.

What dreaming is

Between sessions, Claude reviews its transcripts and the notes it wrote, then re-represents them. Martin put it this way: "Dreaming lets you reflect over transcripts and these written notes and re-represent them."

Martin's slide shows four layers:

  • Transcripts: the searchable event log of what happened.
  • Memory notes: salient observations Claude wrote down.
  • Memory representations: things computed from transcripts and notes, like wikis.
  • Injected context: the memory loaded into every new session.

Transcripts feed every layer above them, and neighboring layers pass information in both directions. So memory is not just stored. It is curated.

Martin also named the tension dreaming is meant to handle. Short-term, task-specific notes pile up fast. A useful memory store needs to be globally coherent and not redundant. Those two pull against each other, and a cleanup pass sits between them.

The evidence he showed

Two examples stuck with me.

A false memory in Pokémon. In one run, a wrong memory about a landmark trapped Claude in a repeated gameplay loop. After dreaming corrected it, Claude moved on. In Martin's words: "With dreaming, it rescues that mistake. Claude proceeds to the next level." His broader claim was: "Dreaming is an effective way to correct mistakes in memory."

Wikis that improve with more thinking. On a Stainless document corpus, the wikis Claude built got better at answering questions as more tokens went into dreaming. A wiki combined with search did better than raw search alone. Raw search scored 53% on that 25-question benchmark. He also said dreaming filled in missing wiki pages and created an index in another benchmark.

He added that stronger models were better at deciding when to write and read memory. They produced more selective, verified memories.

The 1,000-agent run

The same talk included a much bigger experiment. A team of 1,000 agents, one lead and 999 helpers, formalized Fermat's Last Theorem in Lean. Each agent worked in an isolated sandbox with two shared primitives: Git and a SQL database.

About five minutes in, the lead agent created coordination tables for announcements, role assignments, notes, subtasks and landed code. The run lasted about 30 hours. The agents reassigned themselves across 60 proof statements and built task trees for hard subproblems. Martin's summary: "Agents are getting increasingly good at orchestrating themselves and knowing how to coordinate using these simple primitives for very challenging long-horizon tasks."

The detail I keep returning to is how plain the tools were. Git and a database.

My take

We spend a lot of time on what goes into an agent's context and very little on whether its memory is true. A wrong note does not fail loudly. It can steer a later session, as the Pokémon run showed.

In enterprise work that is a reliability and safety problem, not a curiosity. If an agent carries memory between sessions, someone needs to be able to say what it believes, where that belief came from, and when it was last checked. The transcript layer helps, because the event log is still there to check notes against.

So my opinion is that curating memory should be a scheduled job, not something that happens by accident. Dreaming is one version of that job, and I like that it works on the agent's own history.

My own notes from the talk were short: I should use the dreaming feature in Claude, because it helps organize Claude's memories. I want to try it on a project that has built up transcripts and notes. I also want to plant a few wrong facts in the memory first and see whether dreaming catches them. The Pokémon case is one example, and I would rather measure it on my own material.

Credit: Lance Martin (Anthropic), "Exploring Claude's frontier," AI Engineer Code Summit 2026.

Related work

About Farhan Baluch

Senior AI Engineer in Toronto. Two years shipping agents for telecom and banking teams.

Connect on LinkedInGitHubEmailRésuméAll workMore writing

More writing

Everything on this site in one file. Copy it and paste it into your agent.

Loading…