agentleFS
preetamnathpreetamnath/agent-skills/skills/memory-prune/SKILL.md

memory-prune

Skill4 starsChanged 7 months agoMITView on GitHub

Prune project memory files: keep memory-native records, route guidance, state, and evidence to canonical owners, then trim or delete absorbed sources. TRIGGER when: user says 'prune my memories', 'clean up memory', 'what memories should be promoted', or 'review my memory dir'. SKIP when: routing one fact (place-fact), or auditing one instruction file or AGENTS.md (refine-file).

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write the canonical target and required delivery views.

    line 57
  2. Very specific:

    Update MEMORY.md: remove deleted sources, refresh trimmed sources, and keep - Title — one-line summary for all others.

    line 61

≈ “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

Memory Prune

Protocol

Step 0 — Resolve and read the memory set

Resolve ~/.claude/projects/<slug>/memory/, where <slug> replaces every non-alphanumeric character in the absolute current directory with -, with ls ~/.claude/projects/ | grep -Fx -- "$(pwd | sed 's|[^a-zA-Z0-9]|-|g')". If it returns zero or multiple matches, show the candidates and ask the user to choose. Read every *.md except the MEMORY.md index, including frontmatter and metadata.type; stop if none exist.

Step 1 — Load the lenses

Invoke the Skill tool to load vet-fact, place-fact, tighten-instruction, and structure-prose; this workflow owns memory dispositions.

Step 2 — Classify and score each fact

Judge coherent facts or blocks; one file can span lanes. Treat metadata.type only as a signal: user or feedback leans memory-native; project or reference leans toward guidance, state, or evidence.

MaterialVerdict
Current guidance kept by vet-factPROMOTE through place-fact.
Setup or onboarding excluded by vet-factROUTE to the README.
Stale, derivable, or duplicated guidanceDROP.
Active state or unique evidence/open decisionsSkip vet-fact; ROUTE through place-fact.
Completed state or evidence with no unique valueDROP when place-fact's retirement condition applies.
User preference, feedback, or deliberately auto-loaded live contextKEEP only when memory is its canonical owner with upkeep and retirement paths.

For every PROMOTE or ROUTE, including README routes, record place-fact's full placement contract in the analysis; do not paste it into the repository.

Score each verdict 0.0–1.0; name the target or why memory remains the owner. Derive each file's source disposition from all its facts:

DispositionUse when
DELETEEvery fact will be absorbed or dropped.
TRIMSome facts remain; remove absorbed or dropped blocks, preserve the rest, and point only when the placement contract requires it.
NONEMemory remains the canonical owner for the complete file.

Step 3 — Present and confirm

Present every recommendation at confidence ≥ 0.70, sorted by confidence:

| # | Confidence | Memory and block | Verdict | Target | Source disposition | Why |
|---|---:|---|---|---|---|---|

Report the count below 0.70; stop if no row qualifies. KEEP rows are informational. Confirm each PROMOTE, ROUTE, or DROP before editing a target or source.

Step 4 — Apply and prove

For each approved PROMOTE or ROUTE:

  1. Shape PROMOTE material with tighten-instruction, then structure-prose; preserve ROUTE material in its owner's required form.
  2. Write the canonical target and required delivery views; verify the trigger, upkeep, and retirement path.

Recompute source dispositions from approved rows. DELETE removes the source; TRIM preserves unabsorbed blocks and refreshes stale frontmatter or summaries. Leave declined and below-threshold facts unchanged.

Update MEMORY.md: remove deleted sources, refresh trimmed sources, and keep - [Title](file.md) — one-line summary for all others.

Cold-read every changed source and target in full. Fix only run-caused or exposed contradictions, duplicate ownership, mixed scopes, broken routes, lost evidence, or unnecessary eager loading.

Step 5 — Report

**Memory prune:**
- Promoted: [memory block → target, one per line | none]
- Routed: [memory block → target, one per line | none]
- Kept: [memory block, one per line | none]
- Dropped: [memory block, one per line | none]
- Sources: [N deleted, N trimmed, N unchanged]
- Below threshold: [N]

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.