Memory consolidation pass — synthesize recent learnings into organized durable memories. Use when session has yielded significant learnings, before long sessions, or when memory feels cluttered. Triggers automatically on session end via SessionStart hook.
Performs a 4-phase memory consolidation pass to synthesize recent learnings into organized, durable memories.
Two-tier system:
MEMORY.md — Index file, ≤200 lines, auto-loadedmemory/ directoryCritical constraint: MEMORY.md is truncated at 200 lines. Lines 201+ never reach context.
Trigger signals:
/reflect reveals memory gaps or contradictionsSkip if:
/dream already ran (< 24 hours)List the memory directory to see what exists:
Glob pattern: memory/*.md
Read: memory/MEMORY.md
Understand current structure by reading MEMORY.md and scanning topic files for:
Priority order for finding worth-saving information:
memory/logs/YYYY/MM/YYYY-MM-DD.md if they existP:/.claude/state/dreaming-insights.json (or .md)
principle_stats for high-count violations (context_reuse, grounded_changes, etc.)patterns for high_violation_principle entriesKey guidance: Don't exhaustively read transcripts. Look only for things you already suspect matter. Bias toward action over completeness.
Write or update memory files at the top level using established conventions:
From memory_management.md:
Merge signal into existing topics rather than creating duplicates:
new_topic.md if existing_topic.md covers itConvert relative dates to absolute dates:
Delete contradicted facts:
Daemon-derived insights:
dreaming-insights.json are lesson candidatescontext_reuse with count=10 → write/update context_reuse.md in memory/ with violation pattern, examples, and corrective actiongraduate pass: if a daemon insight appears repeatedly, promote it to a hook rule or validatorKeep MEMORY.md under 200 lines:
Maintain index quality:
Resolve contradictions:
Return a brief summary of what was consolidated:
## Dream Summary
**Consolidated:**
- [List of files written/updated]
**Pruned:**
- [List of files or entries removed]
**Learned:**
- [2-3 key learnings from this session's work]
| Memory Type | Path |
|---|---|
| Index | C:\Users\brsth\.claude\projects\P--\memory\MEMORY.md |
| Topic files | C:\Users\brsth\.claude\projects\P--\memory\*.md |
| Daily logs | memory/logs/YYYY/MM/YYYY-MM-DD.md |
SessionStart hook (SessionStart_memory_monitor.py) warns when MEMORY.md > 180 lines. Consider running /dream when you see this warning.
Related skills:
/reflect — Captures session learnings to CKS/learn — Novelty-weighted lesson capture/gto — Gap analysis for projects