How Claude remembers: Anthropic's notes on agent memory and dreaming
Tell the model what memory is for, not how to use it, then clean up the notes in the background.
Anthropic walks through its evaluations of agent memory. On a database Q&A benchmark, newer models closed the learning loop on their own: write a rule, say how they know it is true, and log traps. Telling Opus 5 and Opus 4.7 to "record only failures" cut much of the gain memory gave them, while the older Sonnet 4.6 nearly doubled its score only when told to read memory first and test its theories.
Dreaming is a background pass that checks notes against the original transcripts. In Pokemon it fixed a wrong landmark note that had trapped Claude in a loop. On a 350,000-file corpus, 128 dreaming sessions built a linked wiki that raised scores from 13% to 48% of criteria, and wiki plus search beat search alone (61% vs 53%) while saving about 20,000 tokens per question. The always-loaded layer must stay small: Claude Code's auto memory loads only the first 200 lines or 25 KB of MEMORY.md.
The companion cookbook is a runnable version: export finished sessions, run one Haiku analyzer per transcript plus an organizer, write into a memory store your agent mounts read-only, and run it nightly from cron. Fifty long transcripts cost about $8.
