Claude Code's Dream feature for memory management
Summary
Claude Code has a “Dream” feature that automatically maintains and cleans its memory files. It resolves contradictions, merges duplicates, converts relative dates to absolute ones, and removes stale info - keeping the memory index under 200 lines.
Key Insight
The Dream feature addresses a real problem with long-running AI assistant memory: entropy. Over time, memory files accumulate duplicates, contradictions (e.g. two files saying different things about the same topic), stale information, and relative dates like “last week” that become meaningless later. Dream runs as a maintenance pass over memory files and recent transcripts, performing consolidation operations: merging related files, resolving contradictions by picking the most recent/relevant version, deleting outdated entries, and normalizing relative dates to absolute ones. The 200-line cap on the index forces prioritization rather than unbounded growth. This is essentially garbage collection for AI context - a pattern worth replicating in any system that accumulates structured notes or memory over time.