/dotfiles:memory-review [project directory | all] [--no-agents]from Kevin's dotfiles skills
Reviews, prunes, and repairs Claude Code's persistent project memories. Verifies each memory against current code/docs/skills, deletes stale entries, merges duplicates, and keeps MEMORY.md indexes in sync.
Ships in Kevin's dotfiles skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Claude Code keeps one memory per fact under ~/.claude/projects/{project}/memory/, with a MEMORY.md index per project that loads into every session of that project. A memory is a point-in-time observation, and nothing tests it: the code moves, the follow-up ships, the tool gains the feature the memory worked around. A stale memory then steers a session wrong with full confidence. One described a hand-written CI watcher, and a later session rebuilt it, while repomatic ci-status --wait already did the job.
This skill verifies every memory against the current state, fixes or removes the stale ones, merges duplicates, and leaves each index in step with its folder. The mechanics live in scripts/memory_review.py, a uv standalone script, and the brief of a review agent in references/agent-brief.md. Read the brief when step 3 starts, not before.
$ARGUMENTS names the scope: a project directory, for its memory folder alone, or all, for every memory folder, which is the default. With --no-agents the lead reviews inline, which fits a scope under about 40 files.
The instruction files, skills and docstrings are out of scope: they are the subject of the agent-config-self-tune skill, when it is installed. The two meet at one verdict. A memory that restates one of those files is deleted, and a memory that is a procedure becomes a skill, or a references/ file of one.
Every memory gets one verdict, with the evidence the report must carry: a path and line, a command, or a URL.
| Verdict | Test | Action |
|---|---|---|
| KEEP | Still true, still useful, recorded nowhere else | None |
| UPDATE | Partly stale, or bloated with narrative | Edit in place: correct the fact, cut the story, keep exact error strings |
| DELETE | One of the four tests below | Report it; the lead moves it to the Trash |
| MERGE | A duplicate of another memory | Write the merged text into the survivor; report the other one as DELETE |
A memory is deleted when:
AGENTS.md or CLAUDE.md, a skill, a docstring, a docs page. Name the file and the line;The survivor of a merge is the file with more inbound [[links]]. A claim nobody can test keeps its file and gets an UNSURE flag in the report: a virtual machine, a live service, anything that needs a write or an install, a forge behind a bot wall.
uv run --script {skill}/scripts/memory_review.py inventory. It prints one row per memory folder: file count, size, and the mechanical issues (an index line with no file, a file with no index line, a missing frontmatter). Fix those first with the Edit tool: they are cheap, and they confuse the agents.... batches {scratch}/memreview --size 45. It writes one file list per batch: one project per batch where it fits, a large project split, the small projects pooled. Each batch is one agent's property, and no two batches share a file.references/agent-brief.md filled in. The agents edit UPDATE and MERGE files in place, delete nothing, never touch a MEMORY.md, and report each DELETE with its evidence. They send the report with SendMessage to main, in parts of at most 3000 characters, and end on a one-line final message: see § Traps.{scratch}/memreview/apply-{batch}.json with its deletions and its new index lines, in the schema the script's docstring gives. Write it on arrival: a report read later is a report forgotten. A verdict whose evidence names no file, line, command or URL goes back to its agent. Keep the UNSURE flags and the findings outside the memories in the same file, for the final report.... apply {scratch}/memreview for the plan, then with --apply. The script moves the deleted files to the Trash, backs each index up under {scratch}/memreview/backup/, drops the index lines of the deleted files and replaces the lines of the updated ones. It refuses to apply while any reference fails to resolve. The Trash step needs the sandbox off.... check. It lists the [[links]] that resolve to no memory, the lines that call someone "he", and the empty folders. Hand the first two lists to one agent on Sonnet, with a table that maps each dead link to its new home: the merge survivor, or the home the DELETE evidence named. Run check again when it returns.git log, rg, Read. Each file, function, flag, configuration key and version a memory names must still exist and behave as described.AGENTS.md or CLAUDE.md, the skills of the user and of the repository.--help of the CLI the memory works around, and its changelog since the memory's date.gh api 'repos/{owner}/{repo}/issues/{n}' --jq '.state, .state_reason, .pull_request.merged_at', GET only. A non-GitHub forge gets a plain GET, or an UNSURE flag.Subagents should return findings as text, not write report files, and it cuts a long final message at about 5000 characters with [result truncated — ask the agent for the rest via SendMessage] (Claude Code 2.1.284). Put the delivery rule in the brief: without it, every agent needs a second round, and the second round arrives as duplicates of the first.~/.claude/projects/. The agents edit with the Edit and Write tools, and the lead runs the Trash step with the sandbox off.[[link]] resolves by the name of a frontmatter, not by the file name, and the two spellings differ: underscores in the file, hyphens in the name. The check subcommand resolves both.\b(he|him|his|himself)\b outside a verbatim quote, index hooks included.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kdeldycke/dotfiles --plugin dotfiles10 skills in this plugin
/agent-config-self-tuneAudit and tune the configuration of coding agents across Claude Code and pi - settings files (settings.json, settings.local.json), permission rules, instruction files (CLAUDE.md, AGENTS.md), skill bodies and agent definitions. Use when an instruction file, a skill or an agent definition gets bloated or too big, or when asked to slim down, spread, deduplicate, relocate or compress it. Reads each source once, drops what another layer states, moves each rule beside the code, test or docs page it governs, then re-encodes what stays in a dense register to cut token count and context bloat. Also compresses system prompts and tool descriptions, percolates recurring local patterns into the global config, and reviews past session transcripts for tool calls denied by the sandbox or allow/deny rules to propose allowlist refinements./audit-repo-issuesAnalyze a GitHub repository's issues and PRs to find unaddressed feature requests, dismissed ideas, maintenance signals, and opportunities relevant to the current project. Use when you want to scout a related or competing repo for gaps your project could fill./fill-web-formFill a web form using data extracted from local documents (PDFs, images, spreadsheets). Uses Claude Desktop (Cowork) with Chrome integration to read source documents and navigate/fill browser forms. Use when the user wants to automate filling an online form from document data./pr-triageAudit open PRs across multiple repos for duplicates, stale drafts, Renovate noise, and conflicts. Produces a unified priority report./rename-with-datesRename documents and files (PDFs, images, screenshots, etc.) by reading their content to extract the effective/publication date, then renaming them with a "YYYY-MM-DD - Clear descriptive title.ext" format. Use when the user wants to organize files with date prefixes based on document content./session-titleRefresh the current Claude Code session's title (shown in /resume picker and terminal tab). Trigger on "rename session", "refresh session title", "update tab title", "set session title to ...".Other plugins' skills for the same job