Auto-memory · Auto-dream · /memory
Since February 26 Claude has been writing files to your machine on every session. Most users have no idea those files exist.
In this video: how auto-memory works, how to enable auto-dream, and a live demo where 20 files with months of contradictions end up as 7 clean ones in under two minutes.
The problem
Auto-memory works well at first. After 20 or 30 sessions, the files grow. Duplicates appear. Entries that say "yesterday we switched the framework" — yesterday when exactly? A file that says Express at the top and Fastify further down. MongoDB on one line, PostgreSQL on the next. AWS in production and GCP as a pending migration — but no indication of whether that migration ever happened.
Claude reads all of that at the start of each session. It consumes tokens. And it starts getting confused. The memory that was supposed to help it becomes noise.
$ ls ~/.claude/projects/shopapi/memory/
tech_stack.md tech_stack_v1.md tech_decisions.md
database.md database_migration.md
infra.md infra_old.md
deploy.md deploy_v1.md
preferences.md preferences_v2.md
bugs_pending.md cicd_fixes.md MEMORY.md
# 14 files. Several say different things about the same topic.
# Some entries in MEMORY.md point to files that no longer exist. What everyone calls "Memory 2.0" is actually two distinct mechanisms.
Since v2.1.59 · Feb 26, 2026
Writes. Every time you work with Claude, it generates markdown files
with project context — decisions, errors, preferences. Active by default.
Files live at ~/.claude/projects/.
Since v2.1.87 · Manual activation
Cleans. Runs between sessions and consolidates memory: resolves contradictions,
removes duplicates, discards stale context and updates the index. Must be enabled in
/memory.
Enabling the toggle in /memory does not just activate auto-dream.
It changes the mechanism Claude uses to consolidate — even when you invoke it manually.
Toggle OFF
Claude uses its generic tools to read and rewrite files. It works, but interrupts to ask for permissions and is slower. Claude improvising.
Toggle ON
Uses a dedicated Anthropic subagent. Says "Recalling N memories", "Contemplating…". Operates without interruptions, faster and more accurate.
An e-commerce project with months of decisions that changed. The state any real project accumulates.
14
files before
7
files after
Before: Express and Fastify in the same file. MongoDB and PostgreSQL. No indication which one won.
After: Fastify + PostgreSQL + Prisma + Node 20. Single source of truth.
Before: AWS EC2 with load balancer and RDS, plus a GCP Cloud Run migration marked as "pending".
After: GCP Cloud Run. Migration from AWS complete. Terraform apply pending in production.
Before: 20 entries, several pointing to files that do not exist (database_issues.md, cicd_fixes.md, bugs_pending.md).
After: 7 entries. All pointing to real files.
Everything in the video is verifiable. Here are the sources.
Scripts to reproduce the demo on your own machine. One command creates ShopAPI with 14 accumulated memory files and opens the full tmux environment.
| Script | What it does |
|---|---|
demo-autodream.sh | Launches the full environment: creates ShopAPI, injects dirty memory, saves a snapshot and opens tmux |
demo-dirty-memory.sh | Only creates the project and injects the 14 accumulated memory files |
demo-restore-memory.sh | Cleans everything to start from scratch without re-cloning the repo |
Official Anthropic documentation on the Claude Code memory system.
code.claude.com/docs →
Toggle appears in /memory but /dream returns "Unknown skill". Filed in the official repo.
github.com/anthropics →
Follow-up on the dream subagent behavior and fixes in subsequent versions.
github.com/anthropics →
Common questions about the Claude Code memory system.
Auto-memory is a Claude Code feature that writes markdown files to your machine during every session — technical decisions, errors encountered, preferences you taught it. It was activated by default on all projects on February 26, 2026 with version 2.1.59. No configuration needed: if you use Claude Code, it is already running.
Auto-dream reads all memory files for a project, resolves contradictions (two files listing different technologies for the same stack), removes duplicates, discards stale context and updates the MEMORY.md index. The result: the same information in fewer files, with no noise. It appeared in v2.1.87 inside the /memory menu — disabled by default, must be enabled manually.
The toggle is not just on/off. With auto-dream OFF Claude tries to consolidate memory using its generic available tools — it works, but it is Claude improvising with a hammer. With auto-dream ON it uses a dedicated subagent Anthropic built specifically for this: it says "Recalling N memories", "Contemplating... thinking", and operates without asking permission for each file. Noticeably more accurate and faster.
Not yet. There are two open issues in the official Anthropic repo (links in resources) where users reported that the toggle appears in /memory but typing /dream returns "Unknown skill: dream". The Anthropic team has the fix in progress. For now, the way to invoke it is with natural language: "consolidate my memory using dream".
Automatically between sessions at some interval once enabled — no fixed schedule is published in the official documentation. You can also invoke it manually at any time by writing "consolidate my memory using dream" in Claude Code.
Yes. From /memory you can disable auto-memory completely if you do not want Claude writing files to your machine. You can also review, edit or delete individual files from that same menu. The files live at ~/.claude/projects/ — one folder per project.
Yes, in ambiguous cases. If there are two contradictory entries with no clear indication of which is more recent, dream may choose the wrong one. It reads signals like file timestamps, linguistic context (verbs like "we migrated", "replaced", "decided") and session history. The recommendation is to review the result after the first few runs — especially on projects with a lot of accumulated history.
Open a terminal and run ls ~/.claude/projects/.
You may have months of accumulated context that Claude is reading at the start of every session.