/prune-memory
Review the Memory MCP knowledge graph for stale entities, score
them with time-decay, and present candidates for archival — the
paired discipline to /log-session’s add-to-memory step.
When to use it
Run this every few weeks (or whenever Memory MCP feels noisy) to keep the knowledge graph focused on insights that are still load- bearing. The command queries every entity, scores each one by a time-decay function (age × access frequency × current relevance), and presents the lowest-scoring entities as archival candidates. You confirm which ones to actually remove — no entities are deleted without explicit operator confirmation.
The intent is preventing memory-graph drift: an insight that mattered three months ago may be irrelevant now (the architecture changed, the gotcha was fixed at the root, the lesson was superseded). Without pruning, the graph accumulates and Memory MCP recall returns less relevant results. Pruning is the maintenance step that keeps recall sharp.
Don’t use this as a quick way to delete a single specific entity —
that’s a one-off mcp__memory__delete_entities call, not a pruning
pass. This command operates on the whole graph; use it for periodic
review, not targeted deletion.
How it fits
Reads the graph, presents candidates, removes only what the operator confirms. Pure review — no deletions without consent.
What it does (quick)
- Queries the Memory MCP graph (
read_graph) - Scores every entity by age + access frequency + current relevance
- Sorts ascending — lowest-scoring entities surface as archival candidates
- Presents each candidate with its observations + a recommendation (archive / keep / merge-into-similar)
- Removes only the entities the operator explicitly confirms
Related commands
/log-session— paired discipline; that command adds memory, this command removes stale memory/validate-memory— observational sibling; checks for missing entities (the opposite gap from this command’s stale entities)
Canonical spec: .claude/commands/prune-memory.md