Defragment and reorganize agent memory files: split bloated files, merge duplicates, remove stale information, and restructure the memory hierarchy. Use when memory files have grown unwieldy, contain redundancies, or need reorganization. Run periodically (weekly) or on demand.
80
100%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Reorganize memory files for clarity, efficiency, and relevance. Like filesystem defragmentation but for knowledge.
Inventory all memory files:
MEMORY.md — long-term memory
memory/ — daily notes, tasks, topical files
memory/tasks/ — active and completed tasksFor each file, note: line count, last modified, topic coverage, staleness.
Look for these common issues:
| Problem | Signal | Fix |
|---|---|---|
| Bloated file | >300 lines, covers many topics | Split into focused files |
| Duplicate info | Same fact in multiple places | Consolidate to one location |
| Stale entries | References to completed work, old dates, resolved issues | Remove or archive |
| Orphan files | Files in memory/ never referenced or updated | Review, merge, or remove |
| Inconsistencies | Contradictory information across files | Resolve to ground truth |
| Poor organization | Related info scattered across files | Restructure by topic |
| Recursive nesting | memory/memory/memory/... directories | Delete nested dirs (indexer bug artifact) |
Before making edits, write a brief plan:
## Defrag Plan
- [ ] Split MEMORY.md "Key People" section → memory/people.md
- [ ] Remove completed tasks older than 30 days from memory/tasks/
- [ ] Merge memory/bm-marketing-ideas.md into memory/competitive/
- [ ] Update stale project status entries in MEMORY.mdApply changes one at a time:
After changes:
## Memory Defrag (HH:MM)
- Files reviewed: N
- Split: [list]
- Merged: [list]
- Pruned: [list]
- Net result: X files, Y total lines (was Z lines)memory/YYYY-MM-DD.md files — they're the audit trail.people.md, project-status.md, competitive-landscape.md — not notes-2.md.memory/tasks/ and memory/competitive/ are fine; memory/work/projects/active/basic-memory/notes/ is not.status: done older than 14 days can be removed. Their insights should already be in MEMORY.md via reflection.(review needed) tag rather than deleting.cb95e59
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.