memory-maintenancelisted
Install: claude install-skill djnsty23/claude-auto-dev
# Memory Maintenance
Memory files accumulate: two memories drift into saying the same thing, the
index points at a file that was renamed, a `[[link]]` outlives its target, and
`CLAUDE.md` slowly describes a codebase that no longer exists.
This finds all of that mechanically and fixes it with judgement.
## 1. Audit — always start here
```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory-audit.js"
```
Read-only. Add `--all` to include projects with no recent activity, `--json` for
machine output, `--stale-days=N` to change what counts as active (default 30).
It reports, per project: oversized index, duplicate `name:` slugs, near-duplicate
bodies, dead index links, unindexed files, dangling `[[links]]`, missing
frontmatter, and memory for projects that no longer exist on disk.
**Paths come from `CLAUDE_CONFIG_DIR` or `$HOME`.** Nothing is hardcoded, so this
works for any user on any machine.
## 2. Fix, in this order
**Never delete a memory to resolve a duplicate.** Merge, then remove the file
that is now redundant — and only when its content is fully represented in the
survivor. A deleted memory is unrecoverable and its loss is silent.
1. **Missing frontmatter** — add `name:` and `description:`. Safe, mechanical.
2. **Dead index links** — remove the row, or restore the link if the file was
merely renamed (check git in the project first).
3. **Unindexed files** — add a one-line pointer to `MEMORY.md`.
4. **Dangling `[[links]]`** — a link to a memory that does not exist