agentleFS
shandarshandar/memory-map/skills/memory-prune/SKILL.md

memory-prune

Skill2 starsChanged 7 months agoMITView on GitHub

Clean stale, outdated, or redundant entries from Claude's stored memory. Use this skill when the user says things like "clean up memory", "prune memory", "memory is getting cluttered", "remove old entries", "consolidate memory", or "trim the memory map". Also trigger proactively when memory approaches its limits — 30 entries on claude.ai, 200 lines on Claude Code — or when entries reference past events that have completed (an event date that has passed, a deliverable marked "upcoming" that is now shipped). Always propose changes for user confirmation before applying — never delete memory autonomously. Pairs with memory-map and memory-recall to form the complete memory loop.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. preetamnath/agent-skills★ 4same name
    2. sarmakska/slipstream★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for one of:

    line 89
  2. Distinctive:

    Never apply changes without user confirmation: Always propose first.

    line 116
  3. Distinctive:

    Always preserve a backup: before pruning Claude Code memory:

    line 121
  4. Distinctive:

    Run this skill without being asked when:

    line 131
  5. Distinctive:

    When triggering proactively, frame it as: *"Your memory store is getting full.

    line 137

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

SignalEnvironmentLoad
memory_user_edits tool is availableclaude.aireferences/claude-ai.md
Not available / running in terminalClaude Codereferences/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]

Step 4 — Wait for user confirmation

Never apply changes without explicit user approval. Memory is a user asset. Wait for one of:

  • "yes" / "apply" / "do it" → proceed to Step 5
  • "modify" → ask which proposals to skip or change
  • "cancel" / "no" → exit cleanly, no changes made

Step 5 — Apply changes in safe order

Apply in this order to avoid line number shifts breaking subsequent operations:

  1. Replace consolidations first (preserves line numbers)
  2. Remove entries from highest line number to lowest (removing high first preserves low numbers)
  3. Verify by re-reading memory after all changes

Step 6 — Show the result

MEMORY PRUNE — complete

Before: 24 entries
After:  19 entries
Removed: 3 stale, 1 redundant
Consolidated: 2 → 1

Hard rules

  • Never apply changes without user confirmation. Always propose first.
  • Never remove CURRENT STATE SNAPSHOT — it's the live anchor entry. If it's stale, ask the user to update via memory-map first.
  • Never remove operating preference entries (PWP, design system, communication style) unless the user explicitly says so — these are foundational.
  • Always preserve a backup before pruning Claude Code memory:
    cp ~/.claude/memory.md ~/.claude/memory.md.backup-$(date +%Y%m%d)
  • One action at a time for claude.ai memory — line numbers shift after every operation.

When to trigger proactively

Run this skill without being asked when:

  • claude.ai memory hits 28+ entries (out of 30 max)
  • Claude Code ~/.claude/memory.md exceeds 180 lines
  • An entry references a past date that's clearly behind us (e.g. "event May 8" is now July)
  • The user opens a session and the memory store has obvious bloat

When triggering proactively, frame it as: "Your memory store is getting full. Want me to propose a cleanup?" — never just start pruning.


Pairs with

  • memory-map — writes new memory at session close
  • memory-recall — loads stored memory at session start

Together: write → recall → prune. The full memory loop.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.