# memory-prune

memory-prune cleans low-value, broken, and outdated nodes from your semantic memory tree. Keeps project context lean and responsive.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 1357 repo stars
- Author: qdhenry
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/memory/memory-prune.md
- Updated: 2026-03-01
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/memory-prune

## What it 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.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/memory-prune.md` — Call it with /memory-prune. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/memory-prune.md` — Call it with /prompts:memory-prune. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/memory-prune.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/memory-prune.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qdhenry/Claude-Command-Suite/tree/HEAD/.claude/commands/memory/memory-prune.md

## When to use it
- 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
- /memory:prune --older-than 60
- /memory:prune --failed-only
- /memory:prune --old --low-value --dead-ends

## Similar
- [memory-continue](https://affpapa.org/en/nevibecode/skills/memory-continue.md) — skill · 1500 installs
- [memory-reflect](https://affpapa.org/en/nevibecode/skills/basicmachines-co-memory-reflect.md) — skill · 760 installs
- [memory](https://affpapa.org/en/nevibecode/skills/orchestkit-memory.md) — skill · 757 installs
- [distill-memory](https://affpapa.org/en/nevibecode/skills/distill-memory.md) — skill · 743 installs
- [memory-search](https://affpapa.org/en/nevibecode/skills/ruvnet-memory-search.md) — skill · 751 installs
- [agent-memory](https://affpapa.org/en/nevibecode/skills/openhands-agent-memory.md) — skill · 117 installs

From the same set: [qdhenry/claude-command-suite](https://affpapa.org/en/nevibecode/by/qdhenry/claude-command-suite.md) — 112 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
