How AI agents use sleep-time compute to organize long-term memory
Anthropic explains how Claude uses dreaming and salience judgment to consolidate memory, correcting errors and building knowledge structures during idle time.
Anthropic has released a technical deep dive into the architecture of agent memory, detailing how its Claude models utilize idle processing time to consolidate experiences. The report outlines a mechanism called "dreaming," where agents review session logs offline to correct errors, refine notes, and build structured knowledge representations for future tasks.
What happened
The article draws a parallel between human memory consolidation during sleep and a computational process termed "sleep-time compute." Just as the human hippocampus replays experiences to integrate them into the neocortex, AI agents can use periods between interactions to reorganize their context. Researchers at Letta and UC Berkeley previously proposed this concept, but Anthropic provides concrete benchmarks showing how it improves Claude’s performance in long-horizon tasks.
The core finding is that effective memory is not just about storing data, but about predicting what will be useful later. Agents write "memory notes" based on salient events, tagging them for later retrieval. However, the quality of these notes depends heavily on the model’s ability to judge importance. Older or less capable models tend to hoard information indiscriminately, while newer models like Claude Opus 5 and Sonnet 5.5 learn to distill rules and verified facts, creating a more efficient knowledge base.
How it works
The system relies on two main components: in-session memory writing and offline dreaming. During active tasks, the agent identifies salient events and writes them to a persistent memory store, such as a directory of files. This acts as a prediction that the information will be needed again. For example, if an agent fails a task, it may record the failure and hypothesize why it occurred, creating a rule for future attempts.
Dreaming occurs when the agent is not actively interacting with a user. It reviews the transcript of previous sessions against its stored memory notes. If a note contradicts the transcript, the agent corrects it. This process also allows the agent to build higher-level representations, such as "wikis," which link related concepts together. These structures help the agent navigate its growing knowledge base more efficiently than searching through raw logs.
Key details
- Sleep-time compute: Agents use idle time to replay logs, correct memory errors, and consolidate knowledge, similar to human sleep cycles.
- Salience judgment: Newer models like Claude Opus 5.5 selectively save strategic rules and verified facts, whereas older models like Sonnet 3.7 saved redundant state data, leading to performance drops.
- Benchmark results: In the Continual Learning Bench (CL-Bench) 1.0, Opus 5 closed the learning loop by recording validated rules, significantly outperforming stateless baselines.
- Pokémon Red test: Fable 5 earned four badges by maintaining a small, strategic memory folder, while Sonnet 3.7 earned only one badge due to cluttered, outdated memory files.
- Dreaming correction: In a navigation task, dreaming allowed Claude to correct a false memory about a map location, preventing it from getting stuck in a loop.
- Wiki construction: Agents can build linked wiki pages from large document corpora during dreaming, improving retrieval accuracy for complex queries.
Why it matters
For engineers building autonomous agents, this highlights that memory management is not just a storage problem but a curation problem. Storing every interaction leads to noise and slower retrieval times, as seen in the Pokémon benchmark where excessive file creation halted progress. Effective agents must distinguish between transient state data, which can be read from the environment, and strategic knowledge, which must be retained.
The concept of dreaming offers a practical solution for maintaining memory integrity. Without offline verification, agents can reinforce incorrect assumptions, leading to repetitive failures. By implementing a background process that validates memory against ground-truth logs, developers can ensure their agents learn from mistakes rather than compounding them. This shifts the design focus from simple context windows to dynamic, self-correcting knowledge bases.
What you can do
- Implement a background job that reviews agent logs during idle periods to identify and correct inconsistent memory entries.
- Design memory schemas that separate transient state (e.g., current location) from persistent strategy (e.g., proven tactics).
- Allow advanced models to autonomously judge salience rather than enforcing rigid rules on what to save, as fixed rules can hinder performance.
- Use structured representations like wikis or linked notes to help agents navigate large knowledge bases efficiently.
- Test your agent’s memory retention using long-horizon benchmarks like CL-Bench to measure its ability to close learning loops.
- Monitor memory folder size and growth rates to detect hoarding behavior, which may indicate poor salience judgment.



