“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).
The lock gate ensures that multiple Claurst instances running simultaneously don’t trigger competing dream passes that overwrite each other’s work.
The four dream phases
1
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.2
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
3
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
4
Prune and index
The subagent enforces the index limits and cleans up stale pointers:
MEMORY.mdis kept under 200 lines AND ~25KB- Topic files with stale pointers to deleted content are cleaned up
- Contradictions between files are resolved, keeping the more recent claim
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: