Clean, merge, and optimize memory files to keep them lean and effective.
Memory files grow over time and become:
This skill defragments them.
TriggerActionWeekly maintenanceFull defragmentBefore context optimizationClean firstAfter many sessionsRemove stale entriesExplicit requestClean specified files
bash
python3 scripts/analyze_memory.py
Reports:
bash
python3 scripts/defragment.py --plan
Creates defragment-plan.md with:
Read the plan and approve/modify before execution.
bash
python3 scripts/defragment.py --execute
Backs up original files first, then:
archive/bash
python3 scripts/verify_memory.py
Checks:
TierLocationMax SizeAge PolicyHOTmemory.md, ~/self-improving/memory.md≤100 lines eachReview monthlyWARMmemory/*.md, ~/self-improving/domains/≤200 lines eachReview quarterlyCOLDarchive/UnlimitedArchive at 90 days
scripts/analyze_memory.py — Analyze memory statescripts/defragment.py — Plan and execute cleanupscripts/verify_memory.py — Verify integrityreferences/rules.md — Defragmentation rules and patterns