/dream is an undocumented 📝Claude Code command that triggers a background agent to consolidate a session's memory files — merging facts, pruning contradictions, and trimming the index, much as REM sleep consolidates memory in the brain.
The command surfaced publicly in March 2026, when developers reverse-engineering the Claude Code binary identified a hidden feature flag — tengu_onyx_plover — that governs an automatic memory-consolidation routine commonly called Auto Dream. Auto Dream runs on its own after roughly 24 hours and at least five sessions of new activity; /dream is the manual trigger for the same process. It addresses a structural weakness in long-running coding agents, whose memory files steadily accumulate stale, contradictory, and bloated entries.
Once invoked, the agent works through a four-phase cycle. It orients by reading the memory directory and the MEMORY.md index; gathers signal by searching recent session transcripts — the JSONL files Claude Code stores locally — for high-value patterns such as user corrections and explicit saves; consolidates by merging new facts into topic files, deleting notes contradicted by later decisions, and converting relative dates into absolute ones; and trims the index back below 200 lines. The design is explicitly modeled on REM sleep, during which the brain moves short-term memories into long-term storage.
The feature remains officially undocumented, and public understanding of it comes from independent reverse-engineering and community write-ups rather than 📝Anthropic. In effect it gives Claude Code a recurring maintenance pass over its own 📝Claude Code Memory layer, keeping the agent's persistent notes accurate and compact across many sessions.
