“You are performing a dream — a reflective pass over your memory files. Synthesize what you’ve learned recently into durable, well-organized memories so that future sessions can orient quickly.”
Memory directory
All memories live in~/.claude/memory/. The directory structure is:
name, description, and type fields. The description is used to decide relevance — a future session’s memory selector reads these descriptions to choose which files to inject.
The three-gate trigger
AutoDream does not run on every session exit. It requires all three gates to pass simultaneously:The dream only runs when all three gates pass. This prevents both over-consolidation (wasteful API calls) and under-consolidation (stale memories building up).
| Gate | Condition |
|---|---|
| Time gate | At least 24 hours have passed since the last dream |
| Session gate | At least 5 sessions have occurred since the last dream |
| Lock gate | A consolidation lock can be acquired (prevents concurrent dreams) |
The four dream phases
Orient
The dream subagent runs
ls on the memory directory, reads MEMORY.md, and skims the headers of existing topic files. This gives it a map of what is already known before looking at new information.Gather recent signal
The subagent searches for new information worth persisting. It checks sources in priority order:
- Daily logs — KAIROS mode append-only log files in
logs/YYYY/MM/ - Drifted memories — existing memory files that may contain outdated claims
- Transcript search — recent session transcripts for learnings not yet captured
Consolidate
The subagent writes or updates memory files based on gathered signal:
- New facts get new topic files with proper frontmatter
- Existing files get updated with new findings merged in
- Relative dates (e.g., “yesterday”, “last week”) are converted to absolute dates
- Facts that contradict more recent information are deleted
Read-only bash access
The dream subagent has read-only bash access. It can observe your project — list files, read source code, search for patterns — but it cannot modify any project files. The dream pass is purely a memory consolidation operation; it has no ability to make changes to your codebase. This restriction is intentional: a background process running without your supervision should never be able to alter your work.Managing memories with /memory
Use the /memory slash command to inspect and manage your memories interactively:
/remember skill: