memory-prune

memory-prune is a skill for Claude Code from shandar/memory-map. It costs 147 tokens per session (1,209 once invoked), scanned A, original, MIT.

A cleanup guide for Claude's saved memory, the notes Claude keeps about users and work. It finds entries that are old, duplicated, or no longer correct.

In plain words
What is it for?
Use it to review all saved memory, identify stale or redundant entries, and remove or consolidate them.
Why use it?
It helps prevent saved memory from becoming cluttered or misleading. It supports cleanup in claude.ai and Claude Code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions Claude Code.

Part of the memory-map plugin — 3 skills, 4 commands shipped together

Good fit Use it to review all saved memory, identify stale or redundant entries, and remove or consolidate them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shandar/memory-map/memory-prune
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add shandar/memory-map --skill memory-prune
Clone the repo
git clone --depth 1 https://github.com/shandar/memory-map

Made for: Claude Code.

Or install memory-map, the plugin that ships this one along with the rest of its 3 skills, 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-prune

README.md
[![agentmods](https://agentmods.dev/badge/skills/shandar/memory-map/memory-prune/github.svg)](https://agentmods.dev/skills/shandar/memory-map/memory-prune)
Your own site
<a href="https://agentmods.dev/skills/shandar/memory-map/memory-prune"><img src="https://agentmods.dev/badge/skills/shandar/memory-map/memory-prune/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memory-prune

Your own site · 80×15
<a href="https://agentmods.dev/skills/shandar/memory-map/memory-prune"><img src="https://agentmods.dev/badge/skills/shandar/memory-map/memory-prune.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 147 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,209 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00147 $0.01209
Opus 5.5 $0.00059 $0.00484
Sonnet 5.5 $0.00029 $0.00242
Haiku 4.5 $0.00015 $0.00121

Measured 14d ago against content hash 40cc4688f27f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memory-prune scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/memory-map/skills/memory-prune/SKILL.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Prune

Identify and remove stale, outdated, or redundant memory entries to keep the store clean and decision-useful over time.

Works in claude.ai (uses memory_user_edits) and Claude Code (writes ~/.claude/memory.md). Detected automatically.


Step 0 — Detect environment

Signal Environment Load
memory_user_edits tool is available claude.ai references/claude-ai.md
Not available / running in terminal Claude Code references/claude-code.md

Core Protocol

Step 1 — Read all memory

Fetch every entry with the environment-appropriate read command.

Step 2 — Audit for cleanup candidates

Categorise each entry into:

Stale — references past events or dates that have passed:

  • Events with past dates that are not retrospectively meaningful
  • "Upcoming" tags on things that have shipped
  • Old "CURRENT STATE SNAPSHOT" entries that have been superseded but not replaced

Redundant — covered by another entry:

  • Two entries with overlapping content (one is more current)
  • Sub-entries that have been folded into a parent entry
  • Duplicate category labels

Outdated — factually wrong now:

  • Old contact details, links that no longer work
  • Specs that have been revised
  • Cohort numbers that have changed

Mergeable — could be consolidated to save space:

  • Two related entries that are both under-character-limit could become one
  • Multiple small notes about the same project

Step 3 — Propose changes (do not apply yet)

Show the user a structured proposal:

MEMORY PRUNE — proposed changes

REMOVE (stale)
→ Entry 12: "P2P landing page draft v1" (superseded by v2 in entry 13)
→ Entry 18: "TIU registration link" (event closed)

REMOVE (redundant)
→ Entry 7: "Workshop tools" (covered by entry 14 — frameworks)

CONSOLIDATE
→ Entries 9 + 10 → single "V2V EDITIONS" entry (saves 1 slot)

KEEP (just confirming these are still current)
→ Entry 1-6: PWP and operating preferences
→ Entry 19: Current state snapshot

Apply these changes? [yes / modify / cancel]

Read the full file on GitHub · 148 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago Changed 40cc4688f27f
  2. 3mo ago First seen · 148 lines · 147 tokens per session scan A b277c4160f85

Subscribe to this mod's changes

memory-prune is a skill published in the GitHub repository shandar/memory-map (2 stars, last pushed 16d ago), licensed MIT. It adds 147 tokens to every session and 1,209 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

memory-prune compared with skills from other repositories

memory-prune next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
memory-pruneshandar/memory-mapSkill216d agoMITA147Claude Code
ltm:initLaserPhaser/claude-ltmSkill47mo agoMITA18Claude Code
ltm:compactLaserPhaser/claude-ltmSkill47mo agoMITA17Claude Code
ltm:saveLaserPhaser/claude-ltmSkill47mo agoMITA15Claude Code
gather-contextt1djani/servoSkill15mo agoMITA52Claude Code
iteratingoaustegard/claude-skillsSkill421todayMITA60Claude Code, Codex
session-memoryoaustegard/claude-skillsSkill421todayMITA94Claude Code