Recipe-Inhalt ist auf Englisch. Englisches Original lesen →
← Alle Recipes
Phase 4 · Memory & Knowledge·5 steps

Auto-Memory and Auto-Dream, what Claude Code does at night

Anthropic added Auto-Memory in March 2026 and Auto-Dream consolidates it nightly. Useful by default. Dangerous when combined with external memory systems. Here is how to keep both happy.

5 steps0%
Du liest ohne Account. Mit Login speichern wir Step-Fortschritt + Notes.

Auto-Memory and Auto-Dream, what Claude Code does at night

Since March 2026, Claude Code has had two memory features that are default-on and that most users do not realize are running. This recipe explains what they do, when they help, and the one situation where they cause real problems.

Schritt 1: Understand what each feature actually does

Auto-Memory. While you work, Claude writes notes in the background to a local memory file. Build commands, architecture decisions, your preferences, things you correct it on. Across sessions these accumulate.

Auto-Dream. A background subagent that runs once every 24 hours across all memory files. It deduplicates, removes outdated info, and rewrites relative dates ("yesterday") into absolute dates ("on 2026-03-15") so the file does not read confused six months from now. Anthropic markets it as the "nighttime brain" of the AI.

The settings live in ~/.claude/settings.json:

{
  "autoMemoryEnabled": true,
  "autoDreamEnabled": true,
  "cleanupPeriodDays": 30,
  "autoCompactWindow": 200000,
  "fileCheckpointingEnabled": true
}

autoMemoryEnabled is true by default. autoDreamEnabled rolls out via a server-side feature flag, you may or may not have it active yet. Check with /memory in a Claude Code session, the selector should show "Auto-dream: on" if it is active for your account.

Schritt 2: Identify if you are in the happy case

You only use Claude Code. You have no other memory system. You are happy with the AI writing into ~/.claude/CLAUDE.md (the user-scope file) and per-project CLAUDE.md files.

In this case: leave both default-on. Check weekly what got written. If the file accumulates noise, you can prune by hand, or disable for a day, or run /memory and edit directly.

Schritt 3: Know the three structural limitations

Even in the happy case, three things are worth knowing.

It is local and Claude-Code-only. If you also use Cursor, Codex, or any other AI tool, those tools see none of what Claude Code wrote. Auto-Memory has no cross-tool story.

It is markdown-file-based. No knowledge graph, no semantic retrieval, no confidence score, no bi-temporal model. If your CLAUDE.md grows past a few hundred lines, the model starts missing things, there is no smart query layer, just full-file read.

Auto-Dream's nightly run can collide with external memory systems. If you also run a memory MCP that writes to ~/.claude/, Auto-Dream might consolidate or scramble those files at 2 AM. This is the problem this recipe really exists to warn you about.

Schritt 4: Pick a collision-avoidance strategy

If you run an external memory system (StudioMeyer Memory, local-memory-mcp, Mem0 self-hosted, anything that writes to ~/.claude/ for hooks, settings, or memory files), Auto-Dream can mistake your files for its own. Three options to handle this.

Option A: Turn off Auto-Memory and Auto-Dream, let your external system be master.

Recommended if you have invested time in a real memory MCP setup (Recipe 4.1).

Edit ~/.claude/settings.json:

{
  "autoMemoryEnabled": false,
  "autoDreamEnabled": false
}

Now Claude Code does no automatic memory writes. Your MCP server is the single source of truth. The always-on instruction block (Recipe 4.1) tells the model when to call nex_search, nex_learn, etc.

Option B: Move external memory files outside ~/.claude/.

If you want both systems but keep them separate, store your external memory's local files anywhere except ~/.claude/. For example: ~/.studiomeyer-memory/, ~/Library/Application Support/local-memory-mcp/, ~/Documents/memory/. Auto-Dream only touches ~/.claude/.

Option C: Carefully separate by file naming inside ~/.claude/.

If you must store inside ~/.claude/ (because of plugin paths or similar constraints), Auto-Dream targets specific filename patterns. Your external system's files should not match CLAUDE*.md, memory.md, or be in ~/.claude/agents/{agent-name}/memory/. Use a non-conflicting subdirectory like ~/.claude/external-memory/ and your system's tools will not interfere.

Of the three, Option A is the cleanest. Option B is the least invasive if you actually use Auto-Memory for non-MCP-related notes. Option C is the workaround for unusual setups.

Schritt 5: Verify which mode you are in

Quick test: is Auto-Dream actually running for you?

Open Claude Code. Run /memory. The selector at the top right should show one of:

  • "Auto-dream: on", feature flag enabled, runs every 24h
  • "Auto-dream: off", feature flag not enabled yet, or you disabled it
  • (no line), your version is older than the rollout

You can also trigger it manually by saying "consolidate my memory files". Claude will run the same logic on demand. Useful for testing without waiting 24 hours.

What you might lose by turning Auto-Memory off

Honest disclosure. Auto-Memory captures the small things, a build command you found, a quick fix you discovered, the exact npm script that works. Those land in CLAUDE.md and are searchable next session.

If you turn it off, you have to write those manually, either via your MCP server's nex_learn tool (or equivalent) or by editing CLAUDE.md by hand.

In our experience the trade is worth it. Auto-Memory is fine for individuals who only use Claude Code. The moment you have a real cross-tool memory setup, the noise of two systems writing into the same files is worse than the convenience of one system writing automatically.

What's next

If you are running a memory MCP server, you have made the call about Auto-Memory. Recipe 4.8 compares the major server options head-to-head with honest benchmark numbers. Recipe 4.9 covers the failure modes that get worse as your memory accumulates, particularly sycophancy amplification and stale facts.

CLAUDE.md or memory server, piMemory server comparison. Mem0