← ClaudeAtlas

memory-cleanlisted

Audit the durable memory store (~/.claude/projects/*/memory/) and suggest prunes. Reports orphaned .md files, dangling index pointers, index size vs the context budget, and advisory superseded/duplicate entries — then, only on explicit confirmation, deletes the chosen files, rewrites MEMORY.md, and verifies integrity. Never auto-deletes. Sibling to /pm-clean. Triggers on "memory-clean", "clean memory", "prune memory", "stale memories", "orphaned memory files".
auerbachb/claude-code-config · ★ 5 · Code & Development · score 73
Install: claude install-skill auerbachb/claude-code-config
Audit this project's durable memory store and present prune recommendations. Same discipline as `/pm-clean`: evidence for every recommendation, conservative on "stale," and **nothing is removed without an explicit yes**. All detection and mutation lives in the shared, tested script `.claude/scripts/memory-audit.py` — this file is the recommend-then-confirm layer. ## Step 0: Locate the audit script Prefer the global install; fall back to the in-repo copy when developing the skill itself. ```bash SCRIPT="" for candidate in \ "$HOME/.claude/skills-worktree/.claude/scripts/memory-audit.py" \ "$HOME/.claude/scripts/memory-audit.py" \ ".claude/scripts/memory-audit.py"; do if [[ -f "$candidate" ]]; then SCRIPT="$candidate"; break; fi done if [[ -z "$SCRIPT" ]]; then echo "ERROR: memory-audit.py not found (checked ~/.claude/scripts/, skills-worktree, in-repo)" >&2 exit 1 fi ``` Parse `$ARGUMENTS`: pass through an explicit `--dir PATH` (for a non-current project or a relocated store) and translate `--budget-kb N` to `--budget-bytes $((N*1024))`. With no arguments the script auto-detects the **current project's** memory dir — the ROOT project, not the worktree, since memory is pinned to the root project across worktree sessions. ## Step 1: Scan (read-only) ```bash python3 "$SCRIPT" --check --json [--dir PATH] [--budget-bytes N] ``` Exit `0` = scanned (a clean store is a valid result). Exit `3` = memory dir not found — tell the user and offer to re-run with `--dir PAT