memory-prune — Claude Code command: what it does, how to install
memory-prune cleans low-value, broken, and outdated nodes from your semantic memory tree. Keeps project context lean and responsive.
no license ★ 1,357 updated 2026-03-01
.claude/commands/memory-prune.mdWhat memory-prune does
This command inspects semantic memory trees built on the WFGY architecture. It identifies prune candidates based on age, low access counts, redundant entries, and failed reasoning branches. The execution pipeline relies on read, write, edit, and bash capabilities within the host environment.
Safety mechanisms protect critical assets. Checkpoint entries, recent nodes under 7 days old, and high delta-S elements strictly above 0.7 are never dropped. When pruning executes, an automatic snapshot lands in .wfgy/backups/, followed by an index rebuild and reference re-linking.
Running this command without an established WFGY memory structure produces no meaningful output.
What it helps with
- prune obsolete nodes from semantic memory trees
- eliminate duplicate entries and broken paths
- reconnect orphaned children after node removal
- back up memory trees before executing cleanup
Example prompts for the agent
- /memory:prune --older-than 60
- /memory:prune --failed-only
- /memory:prune --old --low-value --dead-ends
How to install memory-prune
Manually: put the files in place
.claude/commands/memory-prune.mdCall it with /memory-prune. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/memory-prune.mdCall it with /prompts:memory-prune. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/memory-prune.prompt.mdManually: put the files in place
.gemini/commands/memory-prune.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about memory-prune
How to install memory-prune in Claude Code?
Place the command specification file into .claude/commands/memory-prune.md in your project.
What does memory-prune do?
It scans memory nodes against age, score, and utility criteria, dumps a safety backup, deletes candidate nodes, and reconnects severed relationships.
Can memory-prune delete recent or critical records?
No, rules safeguard checkpoints, nodes newer than 7 days, user-flagged items, and nodes exceeding a 0.7 delta-S threshold.