
As AI agents become increasingly embedded in our daily lives and day-to-day workflows, they are taking on longer-horizon tasks and providing increasingly personalized responses. To support this, agents need to build and maintain high-quality long-term memory from historical interactions and task experiences, and retrieve relevant information to personalize their responses in future sesssions.
In November 2026, Anthropic published its research on how Claude manages long-term agent memory, introducing a process called Dreaming, illustrated in Figure 1.
Dreaming refers to the process of agents organize their memory by reflecting on logs to fix mistakes or produce new notes and representations. — Anthropic
Let’s explore the four components illustrated in Figure 1 and how Dreaming helps Claude maintain its long-term memory.
Transcripts (or logs)
Transcripts are the raw records of an agent’s experiences across previous sessions. They capture interactions, actions, observations, and task outcomes.
Unlike summarized memory, transcripts preserve the original context and serve as a searchable historical record. More importantly, they provide a source of evidence against which the agent can validate its existing memories.
Memory notes
In the human brain, chemical signals released before, during, or after an experience can mark a memory as important. Marked memories tend to be replayed more often than unmarked ones during offline periods. This process, called replay, helps stabilize and integrate them into long-term memory.
Similarly, the agent can maintain memory notes that capture salient observations from transcripts (or logs). These notes can also support a learning loop. When Claude answers a question incorrectly, it can record the failure, hypothesize possible causes, test those hypotheses, and turn the findings into rules that improve its future responses.
Figure 2 below shows how Sonnet 3.7 and Fable 5 wrote their memory notes differently while playing Pokemon.

Sonnet 3.7 assumed that almost everything might be important and wrote to extensively to memory (and earned one badge in the game), while Fable 5 was much more selective on how to organize and what to write into its memory note (and earned four badges).
Dreaming can correct memory. For example, when Claude had incorrectly recorded the location of a PokéCenter, Anthropic ran Dreaming on its memory folder. Claude cross-checked the note against the original session transcript, identified the mistake, and corrected it. The transcript provided the ground truth for validating its memory, allowing Claude to complete the task successfully on its next attempt.
Memory representations
Dreaming can also build new memory representations to help Claude navigate an increasingly large knowledge base.
One example is a wiki: a collection of pages written and maintained by Claude that consolidates what it knows about particular subjects and links related information across different notes.
Rather than searching through hundreds or thousands of individual memory files, Claude can use these links as a map to locate relevant knowledge more efficiently.
This becomes particularly useful when an agent works on long-running tasks involving large amounts of information, where individual memory notes alone may not provide enough structure.
Injected context
Dreaming can also promote selected notes to the top of the memory hierarchy.
The agent harness can preemptively load these notes into Claude’s context at the beginning of each new session. This means Claude does not need to search for them or even know that there is something to search for.
However, context injection needs to be handled carefully. Injected memories consume valuable tokens, and an incorrect memory can be carried into every subsequent session. Therefore, the injected layer needs to contain only high-quality, relevant information.
This is similar to that Claude loads high-level memory of project when we using Claude across various sessions. Nowadays, you might notice that with new session Claude still have good memory about previous sessions, thanks to Claude Code’s auto memory.
The memory is maintained under ~/.claude/projects/<project>/memory/ containing
MEMORY.mdindex and one topic file per memory.
Importantly, Claude Code does not load all its auto memory into every session. It loads only the first 200 lines or 25 KB of MEMORY.md, whichever limit is reached first. This file acts as an index, telling Claude what it knows and where to find more detailed information when needed.
Tell Claude what memory is for, but not how to use it
One particularly interesting finding from Anthropic’s research concerns how we should instruct agents to manage their own memory.
They found that stronger models performed better when given the freedom to determine what information was important, rather than being constrained by predefined rules about what to remember.
Open questions
Anthropic’s research raises several interesting questions about how we should design long-term memory systems for AI agents.
When an agent should create a memory? Should memory creation happen during an active session, immediately capturing important observations, or should it happen offline through a process like Dreaming?
How can we keep memory reliably up to date? An agent can write incorrect information into memory, or information that was once correct can become outdated as the environment changes. Dreaming provides one way to detect and correct these mistakes, but it requires additional compute. Continuously checking every memory may not be practical.
Ultimately, Dreaming introduces an interesting dimension to agent memory: memory is not just something an agent stores; it is something the agent needs to continuously organize, evaluate, and improve.
As models become more capable, giving them greater autonomy over this process may prove more effective than predefined memory rules or current approaches.
