memory-audit

A review process for MEMORY.md, a file that keeps an agent's frequently used project context between sessions. It checks whether entries are too large, outdated, duplicated, or better stored as longer knowledge articles.

In plain words
What is it for?
Use it after the memory file exceeds its limits to classify sections, propose moves or removals, get approval, and apply approved changes together.
Why use it?
It prevents the working memory file from becoming an overcrowded session history and preserves useful information in the right place.

Skill for Claude CodeCodex

Part of the memory-kit plugin — 8 skills, 4 agents, 4 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/awrshift/claude-memory-kit/memory-audit
Any agent
npx skills add awrshift/claude-memory-kit --skill memory-audit
Clone the repo
git clone --depth 1 https://github.com/awrshift/claude-memory-kit

Made for: Claude Code, Codex.

Or install memory-kit, the plugin that ships this one along with the rest of its 8 skills, 4 agents, 4 hooks.

Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00119 $0.00988
Opus 5 $0.00060 $0.00494
Sonnet 5 $0.00024 $0.00198
Haiku 4.5 $0.00012 $0.00099

Measured 3d ago against content hash 04a91efc3646, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/memory-kit/skills/memory-audit/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory audit — the surgical one-file pass

This is the cap-trip response, not the daily ritual. /memory-kit:close-session runs every session and captures; this runs when the hot cache has actually outgrown itself and something must LEAVE it. Keeping them separate is the point: a daily ritual that also has to do surgery becomes a ritual people skip.

Always pause for approval before writing. The user talks; you write — including here.

Inputs

  • .claude/memory/MEMORY.md — read in full.
  • knowledge/concepts/*.md — filenames + first 5 lines, for duplicate detection (the directory may not exist yet; the first move creates it).
  • context/handoffs/ — to confirm a session narrative already lives there → drop, not move.

Step 1 — classify every section

Scan by ## heading. For each, count lines and mark exactly one action:

Mark When
move (create) a settled pattern (confirmed on 3+ distinct dates) with >25 lines of reference detail
move (merge) same, but a concept article on the topic already exists
drop a per-session chronicle — it already lives in a handoff; distil at most one settled line
update in-place stale: names a deleted file, a closed ticket, a superseded decision
simplify true and useful, but three times longer than it needs to be
keep earns its lines

Step 2 — the move plan (a table, never prose)

# Section Lines Action Target Reason
1 N move / merge / drop / simplify / keep knowledge/concepts/<slug>.md or —

Close the table with: estimated line savings, and the projected line/byte count afterwards against the caps (180 lines / 32 KB / 3000 chars per line).

Step 3 — PAUSE

Print the plan and ask for approval. Wait for an explicit yes or edits. No writes before that.

Step 4 — execute the approved moves, atomically

  • move (create): write knowledge/concepts/<slug>.md with frontmatter matching knowledge/index.md's spec, then add its one-line entry to that index in the same pass.
  • move (merge): append under a ### From MEMORY.md (YYYY-MM-DD) header — never duplicate a section that already says the same thing.
  • in MEMORY.md: replace the moved section with a one-line pointer plus a one-line teaser. A move without a pointer orphans the content — that is the failure this audit exists to prevent.
  • drop: delete; keep at most one distilled line.

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 78 lines · 119 tokens per session scan A 04a91efc3646

Subscribe to this mod's changes

memory-audit is a skill published in the GitHub repository awrshift/claude-memory-kit (31 stars, last pushed 6d ago), licensed MIT. It adds 119 tokens to every session and 988 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.