Turn on dreaming in Claude Code so your agent cleans up its own memory between sessions: wrong notes get fixed, duplicates merged, the important stuff moved to the top. Takes 2 minutes.


What is dreaming?

While Claude works, it saves notes to a memory folder. Over time some notes go stale and some are simply wrong. Dreaming is a background pass that runs while Claude is idle: it re-reads recent sessions, checks the saved notes against what actually happened, and rewrites the memory. Anthropic introduced it in The components of agent memory (November 2026).

<aside> 🎮

Anthropic's Pokémon test: Claude saved a wrong note about where the PokéCenter was, walked off the same one-way ledge again and again, and never reached Cerulean City. After a dream compared the note with the transcript and fixed it, Claude went straight back through Mt. Moon and made it.

</aside>

Prerequisites

Setup

  1. The quick way: /memory. Start Claude Code, type /memory and look for the Auto-dream row. Toggle it on. The detail next to it shows never, running or when it last ran.
  2. Or in settings. Add this to ~/.claude/settings.json (all projects) or .claude/settings.json (one project):
{
  "autoMemoryEnabled": true,
  "autoDreamEnabled": true
}

autoDreamEnabled overrides Anthropic's default for your account, so false switches it off again.

  1. Check auto memory isn't disabled. If the environment variable CLAUDE_CODE_DISABLE_AUTO_MEMORY is set, unset it, or Auto-dream stays greyed out.

How it works once it's on

  1. You keep working as usual. Claude saves notes to its memory folder (~/.claude/projects/<project>/memory/ by default).
  2. When enough has happened, by default at least 24 hours and 5 sessions since the last dream, Claude runs a dream in the background. It doesn't block your session.
  3. It reads the sessions since the last dream, fixes or deletes wrong notes, merges duplicates and promotes the notes that matter.
  4. Open /memory to see when it last ran, and read the memory files yourself any time: they are plain Markdown.