agentleFS
AdityaRonAdityaRon/claude-code-skills/skills/memory-audit/SKILL.md

memory-audit

Skill0 starsChanged 15 days agoMITView on GitHub

Check stored memories against external truth (GitHub PRs, Jira issues) and propose corrections where the world moved on. Use when memory-verify.sh reports STALE or TRIAGE, when a memory's claim about a PR or ticket looks out of date, or before trusting an old memory that says something is still in flight. Not for tidying or index size.

18 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Leave everything else to the CLI and memory-archive: merging duplicates, rewriting relative dates, shortening and reordering the index.

    line 14
  2. Very specific:

    If that path does not exist, use bin/memory-verify.sh in a harness checkout.

    line 45
  3. Very specific:

    Every run looks GitHub claims up in one GraphQL call per repo per 100 claims, so what is slow now is the pass over the memory files, not …

    line 69
  4. Distinctive:

    Read the whole file. Then:

    line 75
  5. Distinctive:

    Resolve the reference to a repo: Use repo names in the file's own text first.

    line 80
  6. Very specific:

    If the title has nothing to do with the memory's subject, you resolved to the wrong repo.

    line 88
  7. Distinctive:

    If you cannot resolve it, stop and ask: Do not guess a repo from the number's magnitude alone.

    line 91
  8. Very specific:

    When no lookup can settle the wording (a recurring rota, a quoted example), put verify: none <reason> in the frontmatter instead.

    line 127
  9. Very specific:

    5. Keep the index honest: If you rename or delete a memory, update the matching - Title — hook line in that store's MEMORY.md.

    line 131
  10. Very specific:

    Do not touch CLAUDE.md: If a memory contradicts it, annotate the memory with contradicts CLAUDE.md, verify which is current and raise it.

    line 144

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Auditing memories against external truth

Claude Code's own memory hygiene (the limit checks on every write, and auto-dream where it runs) reasons over memory content and session logs, and never leaves the machine. So a memory saying "PR #4821 is a held draft" survives consolidation intact: the contradiction lives on GitHub. Working out which external lookup settles it needs judgment, and that is this skill's job.

Leave everything else to the CLI and memory-archive: merging duplicates, rewriting relative dates, shortening and reordering the index. The measured history of why is in docs/history/memory-hygiene-problems.md.

The hard part, and why a script cannot do it alone

memory-verify.sh (installed at ~/.claude/memory-verify.sh) resolves any memory carrying a verify: block. Most memories do not carry one, and their references are genuinely ambiguous:

  • References are usually bare: #4821, not acme/api#4821. The same number exists in every repo.
  • A single memory often cites many references; only one or two are the claim under test, the rest are supporting detail.
  • Memories name several repositories, or none, so the file may not say which repo a number belongs to.

So your value is picking the operative claim and resolving the reference. Then write a verify: block back into the file, and that memory is mechanically checkable from then on. Leave a block on every file you touch, even one you conclude is still accurate.

Procedure

1. Collect findings.

bash ~/.claude/memory-verify.sh --json                  # every store
bash ~/.claude/memory-verify.sh --json --store <slug>   # one store

If that path does not exist, use bin/memory-verify.sh in a harness checkout.

Each line is {status, store, file, detail}, and each status means one thing:

  • STALE: already proven wrong. Go straight to step 3.
  • TRIAGE: asserts open state with no verify: block, so nothing can check it. Needs steps 2 and 3. Not age-gated: an unverifiable claim about something still open is a defect the moment it is written.
  • NEEDS_MCP: a Jira claim only this skill can resolve. Batch them: memory-verify.sh --jira-keys prints key in (...) lines of 50 keys; run each line as one JQL search over MCP, never one lookup per key.
  • SKIP: a malformed claim, or a gh ref that is not-found: fix the memory. lookup-failed or gh-unavailable is gh's failure, not the memory's: check gh auth status and rerun before editing anything.
  • ORPHAN: no index line, archive line or hub [[link]] reaches the file, so nothing recalls it. Read it, then propose its line; never delete it for this.
  • VERIFIED, WAIVED: nothing to do. Both are counted; --all lists them.
  • HOOK: advisory. An index hook trails off mid-claim while the memory's own description: still carries the payload. Rewrite the one line in MEMORY.md from the description; nothing else changes.
  • OVERSIZE: the index is past a load limit. Claude Code already reports this on the write that caused it; hand it to memory-archive, not this skill.
  • SETTLED, CANDIDATE: advisory, --curate only.

Every run looks GitHub claims up in one GraphQL call per repo per 100 claims, so what is slow now is the pass over the memory files, not the claims, and --curate adds a second pass over every file.

2. Work out what the memory actually claims.

Read the whole file. Then:

  • Find the operative claim: the sentence asserting current state ("held", "PENDING", "awaiting review", "not yet deployed"). Supporting references that merely explain history are not claims to verify.
  • Resolve the reference to a repo. Use repo names in the file's own text first. If the file names several, match each reference to the repo discussed in its own paragraph.
  • Confirm the match before trusting it. Fetch the title and compare it to what the memory describes:
    gh pr view <num> --repo <owner/repo> --json state,title,mergedAt
    If the title has nothing to do with the memory's subject, you resolved to the wrong repo. A confidently wrong verify: block is worse than none, because every later run trusts it.
  • If you cannot resolve it, stop and ask. Do not guess a repo from the number's magnitude alone.

3. Report, and propose an edit. Never delete on your own initiative.

Touch a memory only after an external check confirms its claim is false. Deleting on a heuristic destroys knowledge silently, worse than staleness.

For each affected memory, show what it claims (quoted), what the lookup returned with the date (merged 2026-06-15), and the proposed edit. Prefer the smallest correct one:

  • Claim overtaken: rewrite the claim to what is now true and keep the history. PENDING: merge, deploy, live-verify becomes Merged 2026-06-15 and verified in prod.
  • Self-contradiction: an appended update left the file asserting both open and closed state. Delete the superseded sentence, keep the current one.
  • Whole memory now worthless: say so and recommend deletion, but let the user confirm. If the memory records a lesson rather than a status, the lesson usually outlives the ticket: keep it, fix the status line.

4. Leave a verify: block behind, near the top of the body:

verify:
  - gh acme/api#4821 merged
  - jira PROJ-123 Done

One <kind> <ref> <expected-state> claim per line: gh takes owner/repo#number and merged, open or closed (issues too); jira takes the issue key and the status name, and this skill resolves it over MCP, not the script.

Record what you expect to stay true. merged is stable; open will go stale by design, which is the point: that is the claim worth re-checking.

When no lookup can settle the wording (a recurring rota, a quoted example), put verify: none <reason> in the frontmatter instead. The memory is then counted as waived, not triaged; with no reason it is a SKIP and waives nothing.

5. Keep the index honest. If you rename or delete a memory, update the matching - [Title](file.md) — hook line in that store's MEMORY.md. A finding on MEMORY.md:<line> is aged by the memory it links to: resolve the claim, then rewrite the one-liner, which loads every session. The index gets no verify: block; put it on the memory the line links to and keep the hook consistent.

Rules

  • Never delete a memory without an external check confirming it is false, and never without the user agreeing.
  • Never edit a memory you have not read in full. The operative claim is often not the one the scanner flagged.
  • Absolute dates only. Rewrite "last week" to the actual date.
  • Do not touch CLAUDE.md. If a memory contradicts it, annotate the memory with contradicts CLAUDE.md, verify which is current and raise it.
  • Batch your questions. Audit the set, then bring one set of proposals, not one per file.
  • One store by default, the current project's. Audit every store only when asked: memory is siloed per launch directory, so one repo can have two stores.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.