← ClaudeAtlas

prune-memorylisted

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.
usrrname/agent-skills · ★ 0 · Data & Documents · score 57
Install: claude install-skill usrrname/agent-skills
# 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 1. **Inventory.** List `*.md` files in the memory dir and read `MEMORY.md`. Read every memory file in full — they are small. 2. **Classify each memory** by frontmatter `metadata.type` (`user`, `feedback`, `project`, `reference`). Different types decay at different rates (see *Bias by type* below). 3. **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. 4. **Verify against current state** using one tool call per claim type: - File path → `Read` or `ls`; gone → stale. - Symbol / flag → `Grep` across 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). 5. **Cross-check the index.** Files not listed in `MEMORY.md` → orphaned file.