---
name: memory-lint
description: Audit the persistent memory directory for staleness, orphans, dead references, broken supersession chains, likely duplicates, and archive files past their 180-day TTL. Invoke when the user asks to "lint memory", "check memory", "audit memory", "clean up memory", "find stale memories", or when running the scheduled weekly memory check. Produces a triage punch list — does not auto-fix.
version: 1.0.0
---

# memory-lint

Audit the memory directory at `$HOME/.claude/projects/<dev-slug>/memory/` and produce a triage punch list. Do not auto-fix; surface findings for the user to decide.

The non-interactive version is at `~/.claude/skills/memory-lint/run.sh` and is run weekly by a systemd user timer.

## When to invoke (interactive)

- User asks to lint, audit, or check memory health
- Before a major memory cleanup pass
- After a long session where many memories were touched

For weekly runs, the systemd timer calls `run.sh` directly.

## Checks performed

The `run.sh` script implements all checks in pure bash:

1. **Stale project memories** — `event_date` older than 30 days
2. **Orphans** — `MEMORY.md` ↔ disk mismatches
3. **Dead references** — file paths or symbols named in memory bodies that no longer exist in `$HOME/Development`
4. **Broken supersession chains** — `superseded_by` pointing to a file that is itself superseded
5. **Archive TTL** — files in `archive/` older than 180 days

## Output format

```
# Memory lint — YYYY-MM-DD

## Stale project memories (N)
- file.md — event_date YYYY-MM-DD (X days)

## Orphans (N)
- in MEMORY.md, missing on disk: file.md
- on disk, missing from MEMORY.md: file.md

## Dead references (N)
- file.md → missing: path/to/thing

## Supersession issues (N)
- file.md superseded_by missing: target.md

## Archive TTL (N)
- delete candidate: archive/old_file.md

## Summary
N findings total. Triage with user — no auto-fixes performed.
```

If all checks pass, output `# Memory lint — YYYY-MM-DD\n\nAll checks pass. N memories tracked.`

## Manually triggering

```bash
~/.claude/skills/memory-lint/run.sh
```

Writes report to `$HOME/.claude/projects/<dev-slug>/memory/lint-reports/YYYY-MM-DD.md`.
