memory-cleanlisted
Install: claude install-skill OutlineDriven/odin-claude-plugin
Audit memory for structural rot and staleness, report with evidence, fix only on user confirmation.
## Scope
Audits and fixes existing memory files. Does not create new memories from session signals (that is `memory-update`). Does not redact PII or credentials (that is `memory-sanitize`, which `memory-clean` will recommend when it detects suspected credentials at critical severity).
## Path resolution
Scripts live under this skill's own `scripts/` directory. Resolve the skill root from `$HOME` (the conventional install path is `$HOME/.claude/claude/skills/memory-clean/`):
```sh
SKILL_SCRIPTS="${MEMORY_CLEAN_SKILL_SCRIPTS:-$HOME/.claude/claude/skills/memory-clean/scripts}"
MEMORY_DIR=$("$SKILL_SCRIPTS/resolve-paths.sh" memory_dir)
SESSION_HISTORY_GLOB=$("$SKILL_SCRIPTS/resolve-paths.sh" session_history_glob)
```
Set `MEMORY_CLEAN_SKILL_SCRIPTS` to override when the skill is installed outside `$HOME/.claude`. Abort on non-zero exit from the resolver. Overrides via `MEMORY_DIR` / `SESSION_HISTORY_GLOB` env vars.
## Workflow
### 1. Resolve paths (above)
### 2. Snapshot before any fix
```sh
cp -r "$MEMORY_DIR" /tmp/memory-snapshot-$(date +%s)
```
Never mutate originals without a snapshot.
### 3. Run structural audit
```sh
./scripts/audit-memory.sh "$MEMORY_DIR" "$SESSION_HISTORY_GLOB" > /tmp/memory-audit-$(date +%s).json
```
The script emits JSON with these arrays:
| Field | What it detects |
|---|---|
| `orphans` | Files in dir with no MEMORY.md entry |
| `dangling