| name | consolidate-memory |
| description | Consolidate, prune, and reorganize the memory system — like a dream cycle. Use when user says "dream", "consolidate memory", "clean up memory", "prune memory", "organize memory", or "tidy up memory". Also trigger when the user complains about stale context, contradictory information, or when memory files feel cluttered. If the session-start hook reports that consolidation is overdue, and the user acknowledges it, use this skill. |
Consolidate Memory Skill
Purpose
Review all memory files, prune stale entries, resolve contradictions, deduplicate, convert relative dates to absolute, and reorganize — keeping the memory system clean and useful over time.
Memory System Location
<MEMORY_PATH>
Process
Phase 1: Orient
Read the full memory directory to understand current state.
- Read
SOUL.md, AGENT.md, MEMORY.md, USER.md
- List all files across all category dirs:
find <MEMORY_PATH> -name "*.md" | sort
- Read files that appear large or recently modified
Phase 2: Identify Issues
- Stale entries — completed projects long ago, people no longer relevant, tools no longer used
- Contradictions — conflicting facts across files (newer entry usually wins)
- Relative dates — "yesterday", "last week" that have lost meaning
- Duplicates — same info repeated across files
- Orphaned links —
[[links]] pointing to non-existent files
- Oversized files — over 1000 lines should be split
- Misplaced content — files outside expected structure:
- Root:
SOUL.md, AGENT.md, USER.md, MEMORY.md, notes.md
- Category folders:
Customers/, Personal/, Personal/Projects/, People/, Knowledge/, Decisions/, Reference/, Technical/, Work/, .archive/
Phase 3: Consolidate
Phase 4: Update MEMORY.md
- Keep under 1000 lines
- Remove pointers to deleted files, add pointers to new files
- Archive "Recent Context" entries older than 30 days to
.archive/YYYY-MM-DD-consolidation.md
Phase 5: Stamp the consolidation
date +%s > <MEMORY_PATH>/.last-dream
echo "0" > <MEMORY_PATH>/.session-count
Add to MEMORY.md under Recent Context:
- YYYY-MM-DD: Memory consolidated
Phase 6: Report
Tell the user what changed — briefly:
- Files pruned/deleted
- Contradictions resolved
- Entries deduplicated
- Dates converted
- MEMORY.md size before/after
Guidelines
- Be surgical — don't rewrite files that don't need changes
- When unsure if something is stale, leave it with a comment rather than deleting
- Preserve the user's voice — don't rephrase their notes into formal language