Prune memory
skill dump
npx -y skills add usrrname/agent-skills --skill prune-memoryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Audit the current project's memory store (`~/.claude/projects/<encoded-cwd>/memory/`) and prune memories that no longer match the project state — dead file/function/flag references, past-dated project memories, orphaned index entries, and duplicates. Suggests candidates with rationale and requires per-item confirmation before deleting; does not edit memory bodies. Use when the user says "prune memory", "clean up memory", "audit memory", "memory is stale", "remove old memories", or invokes /prune-memory.
SKILL.md
4.5 KB, as published. Nobody here has run it
Prune Memory
Audit the per-project memory directory and remove entries that no longer reflect reality. Suggest-only: surface candidates with reasons, confirm before touching files, never rewrite memory bodies.
Locate the memory directory
Derive from the current working directory: replace every / with -, prepend ~/.claude/projects/, append /memory/. Example: /Users/jenc/code/agent-skills → ~/.claude/projects/-Users-jenc-code-agent-skills/memory/.
If the directory is missing or empty, report and stop. If MEMORY.md is absent but memory files exist, flag the index drift first.
Workflow
- Inventory. List
*.mdfiles in the memory dir and readMEMORY.md. Read every memory file in full — they are small. - Classify each memory by frontmatter
metadata.type(user,feedback,project,reference). Different types decay at different rates (see Bias by type below). - Extract concrete claims from each memory body — file paths in backticks, function/symbol names, flag/env-var names, dates (
YYYY-MM-DD), external URLs, person names, ticket IDs. - Verify against current state using one tool call per claim type:
- File path →
Readorls; gone → stale. - Symbol / flag →
Grepacross the repo; zero hits → stale. - Date → compare to today; past → stale if the memory's premise was the date.
- URL → leave alone (not the agent's job to fetch).
- File path →
- Cross-check the index. Files not listed in
MEMORY.md→ orphaned file.MEMORY.mdentries pointing at missing files → orphaned link. - Find duplicates by frontmatter
descriptionoverlap and body subject. Two memories on the same rule → propose keeping the more specific / more recent one. - Group findings into a single report:
dead-reference— cites artifact that no longer existspast-dated— project memory whose premise (deadline, freeze, sprint) has passedorphaned— file ↔ index mismatchduplicate— overlapping subject with another memorycontradicted— body claims X, current code does not-X (only flag when confidence is high)
- Confirm per item. Present each candidate with: path, type, one-line rationale, suggested action (delete / unlink from index / keep). Ask the user to approve, skip, or batch-approve a category. Default action on skip is keep.
- Apply approved actions. For deletes: remove the file and the matching line in
MEMORY.md. For index repairs:EditMEMORY.mdto add or remove the pointer. Never rewrite memory bodies — that is out of scope. - Report.
Reviewed N, pruned M, kept N-M. <one line per pruned file>.
Bias by type
feedbackandusermemories are durable — only prune on dead-reference or duplicate. Personal preferences and rules do not expire just because a file moved.projectmemories decay fast — past-dated, contradicted, and dead-reference all apply. Most pruning targets live here.referencememories — verify URLs/paths still resolve in name only (does the file/dir exist); do not fetch.
What you must NOT do
- Do not edit memory bodies. If a memory needs an update, flag it for the user; auto-save will fix it next time the underlying fact is observed.
- Do not delete
MEMORY.mditself, even if empty. - Do not prune memories that reference external projects or systems just because they are not in the current repo —
referencememories often point off-repo on purpose. - Do not consolidate by merging two memories into one; that is rewriting.
- Do not act without per-item confirmation, except for the bulk-approve path the user explicitly chooses.
Final assistant-message summary
Memory pruned: <M>/<N> reviewed.
- <path>: <category> — <one-line reason>
- <path>: <category> — <one-line reason>
Index updated: MEMORY.md (<+a/-b> lines).
Kept: <N-M> (no action needed or user declined).
If nothing was prunable, say so and list the categories you checked.
Gives 0 of the 12 instructions most memory context skills give
Counted across 674 of the 847 authors here whose files we hold, read 2026-08-06
- inform the user when setup is completein 21 of 674, across 6 files
- confirm the draft with the user before writingin 21 of 674, across 6 files
- update the agent skills block in place if it existsin 21 of 674, across 6 files
- present findings to the userin 20 of 674, across 5 files
- write the three docs files from seed templatesin 20 of 674, across 5 files
- ask the user about each decision one at a timein 19 of 674, across 4 files
- edit CLAUDE.md if it existsin 18 of 674, across 3 files
- explore current repo statein 18 of 674, across 3 files
- do not overwrite user edits to surrounding sectionsin 18 of 674, across 3 files
- back up the original file before overwritingin 16 of 674, across 8 files
- keep the memory index under 200 linesin 15 of 674
- Provide actionable steps and verificationin 13 of 674, across 2 files
Said here and by no other author read
- derive memory directory from working directory
- report and stop if directory is missing or empty
- extract concrete claims from memory bodies
- verify claims against current project state
- cross-check index for orphaned files or links
- find duplicate memories
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.