"Lints the auto-memory store: dangling [[links]], orphans, index drift; --auto-archive trims. Use after editing memories or near the cap. Not for semantic or harness review."
Resources
2Install
npx skillscat add wasikarn/method-harness/memory-lint Install via the SkillsCat registry.
SKILL.md
memory-lint
Deterministic bookkeeping check for the auto-memory store. Claude Code only warns whenMEMORY.md nears its 200-line / 25 KB load cap; nothing else resolves [[wikilinks]], finds
orphans or notices index drift. Semantic review of memory content is out of scope.
The loop
- Run the detector. Exit code equals the finding count, so
0proves a clean store.
Done when: the summary line (python3 "${CLAUDE_SKILL_DIR}/scripts/memory-lint.py" # store derived from the git root: ~/.claude/projects/<root with / as ->/memory python3 "${CLAUDE_SKILL_DIR}/scripts/memory-lint.py" /path/to/memory python3 "${CLAUDE_SKILL_DIR}/scripts/memory-lint.py" --json # findings array instead of the summary linememories: … | findings: N) or--jsonarray, and the exit code, are read, not assumed. - Fix each finding at its cause. Dangling link: correct the target to the real filename stem
(thedid you meanhint is a string-similarity guess; check it first); never delete the link.
Stale pointer: remove theMEMORY.mdline; never create a file to satisfy it. Unindexed: add a
one-line pointer, or link it from an indexed memory. Orphan: link it from the memory it belongs
with. Near or over budget: step 3.
Done when: every finding has a named edit and no memory file was deleted. - Trim only through action mode.
--auto-archive --dry-runfirst, read the plan, then--auto-archive --yes. Rubric, classes A–D and thresholds:references/action-mode.md.
Done when: the dry-run plan was read before any apply. - Re-run the detector. Done when: exit code
0, or every remaining finding is accepted with a
written reason.
Checks
| Check | Fires when |
|---|---|
| Dangling link | [[target]] (alias form [[target|alias]] stripped) or same-store ](file.md) resolves to no memory by filename stem or name: slug; code spans are masked first |
| Orphan | an indexed memory has no links in or out |
| Index drift | MEMORY.md points at a missing file, or a file has no pointer and is not [[link]]-reachable from an indexed one |
| Load budget | MEMORY.md at 80% or more of 200 lines / 25 KB; once over the cap, trailing entries never load |
Authoring rules the checks assume
- Link by filename stem, never by
name:slug;name:values drift from filenames. [[ ]]is memory-to-memory only. Name a skill, doctrine file or ADR in backticked prose.- One fact per file with
name:anddescription:frontmatter, body with**Why:**and**How to apply:**; dedupe before writing; archive under_archive/, never delete.
hooks/session/memory-health-nudge.sh runs the detector at session start unless the store is
unchanged since the last clean run; it is silent when clean.
Failure modes
- Apply without the plan.
--auto-archive --yesstraight away moves entries you meant to keep. - Silencing instead of fixing. Deleting a dangling link or stubbing a stale pointer clears the
finding and loses the fact. - Trusting the hint. A wrong
did you meanaccept links two unrelated memories.