agentleFS
EllAchEEllAchE/skill-observability/skills/prune-memory/SKILL.md

prune-memory

Skill0 starsChanged 3 months agoMITView on GitHub

Audit and prune a Claude Code project memory store. Use when the user asks to inspect MEMORY.md, remove expired or stale memories, fix expiry coverage, or reduce always-loaded memory context without promoting policy into shared documentation.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. usrrname/agent-skills★ 0same 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 repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep this workflow focused on the personal memory store.

    line 8
  2. Distinctive:

    Remove index rows only when the user asked for edits.

    line 30
  3. Very specific:

    Delete expired memory files only after explicit approval of the exact set.

    line 32
  4. Distinctive:

    Keep active private preferences, necessary local machine facts, and current work that has no better tracker.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Prune Memory

Keep this workflow focused on the personal memory store. Route durable policy that should move into version-controlled documentation through share-memory.

Workflow

  1. Resolve the memory directory. Use the explicit path when supplied; otherwise derive ~/.claude/projects/<munged-project-path>/memory from the current project.
  2. Exit without changes when MEMORY.md is absent.
  3. Record the MEMORY.md byte size and entry count, then run memory-prune <memory-dir>. Its default mode is a dry run that reports expired files and invalid or missing expiry metadata.
  4. Backfill missing expiry metadata without deleting content. Choose dates by how quickly the fact decays:
    • machine, path, version, or tooling state: about six months;
    • in-flight work: its expected completion date, or one month;
    • already codified policy: one month;
    • genuinely permanent facts only: 9999-12-31.
  5. Re-run the dry-run sweep. Treat missing or invalid expiry as audit debt, not permanence.
  6. For stale index rows that are not expiry-driven, re-read live MEMORY.md with line numbers immediately before proposing edits. Identify each row by title and reason, highest line number first.
  7. Remove index rows only when the user asked for edits. Explain that removing an index row changes startup context while deleting its backing file is stronger.
  8. Delete expired memory files only after explicit approval of the exact set. Run memory-prune --delete <memory-dir>; its default mode is a dry run.
  9. Re-run memory-prune, then report before/after bytes, entries, files, and every deleted or retained item.

Keep active private preferences, necessary local machine facts, and current work that has no better tracker. Prune resolved status breadcrumbs, duplicated rules, transient tool facts, and memories already represented more accurately elsewhere.

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.