audit-memory-file
Skill0 starsChanged 6 months agoMITView on GitHub
Audit one project's CLAUDE.md/AGENTS.md against the best-practice digests - score it, classify content, propose a diff (including symlink migration and oversized-file restructuring), apply on approval, and log the result. Use when the user asks to audit, review, fix, or shrink a specific project's memory file, or for each project during an audit run.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- refresh-best-practicesSkill
- scan-projectsSkill
- seed-memory-fileSkill
- setupSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
NEVER write to the target project without showing the diff first.
- Distinctive: line 12
Safety check: If the project is a git repo and its memory files have uncommitted changes, flag and skip unless told otherwise.
- Very specific: line 60
Apply: only what was approved. Optionally stamp provenance as a zero-cost HTML comment (<!-- audited YYYY-MM-DD by agents-md-orchestrator …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Audit Memory File
NEVER write to the target project without showing the diff first.
Workflow
- Safety check. If the project is a git repo and its memory files have
uncommitted changes, flag and skip unless told otherwise. Check the
project's scope in
SCOPES.mdfor caution level, constraints (no-new-filesetc.), and theNever touch/ fork-skip lists — skip listed projects unless explicitly asked. - Read the yardstick:
best-practices/claude-code.mdandbest-practices/codex.md. - Read the target memory file(s) and assess each line against the
litmus test: would removing this cause the agent to make mistakes?
Classify content:
- Keep — commands, project-specific rules, gotchas, env quirks
- Relocate — reference material, per-subproject detail, dated reports
→ move to the project's
docs/*.mdwith plain-path pointers (NOT@imports— they load eagerly and defeat the purpose; the only sanctioned import is the one-line@AGENTS.mdbridge shim used where symlinks are unreliable) - Cut — generic advice, things inferable from code, stale info
- Rewrite — rules at the wrong altitude: brittle step-by-step logic trees → strong heuristics
- Missing — no build/test/lint commands, no verification step Flag breaches of the hard size limits stated in the digests (Claude line ceiling, Codex byte cap).
- Verify claims against the repo (cheap, catches rot the yardstick
can't): every path the file mentions exists; every referenced command
(
npm run X, make/just targets) is actually defined in package.json/Makefile/etc. Flag stale claims for Cut or fix. If the inventory row carries another:flag (GEMINI.md, copilot-instructions.md, …), skim those files for contradictions with the memory file and propose consolidating them into it. If the user reports a rule being ignored, first confirm the file loads at all (/memorylists loaded instruction files) before diagnosing length. - Structural fixes to include in the proposal when applicable:
- Bridge migration: target state is
CLAUDE.md(file) +AGENTS.md → CLAUDE.md(symlink). Migrate:git mv AGENTS.md CLAUDE.md && ln -s CLAUDE.md AGENTS.md(plainmvoutside git). Where symlinks are unreliable (Windows), reverse the pair: keepAGENTS.mdas the file with aCLAUDE.mdcontaining@AGENTS.md— Codex cannot import, so AGENTS.md must hold the real content there. Stage but never commit. - Oversized file: relocate, don't delete — always-needed rules stay;
file-type/subtree-specific rules →
.claude/rules/*.mdwithpaths:frontmatter (load only when matching files are touched); reference material →docs/; dated reports →docs/<topic>-YYYY-MM.mdsnapshots. Inno-new-filesscopes, relocated content goes to the scope-rootdocs/instead of inside the repo.
- Bridge migration: target state is
- Propose the full diff and a one-line score summary (structure / conciseness / specificity / altitude / completeness / staleness). Wait for approval.
- Apply only what was approved. Optionally stamp provenance as a
zero-cost HTML comment (
<!-- audited YYYY-MM-DD by agents-md-orchestrator -->). - Log in PROJECTS.md: set
Last auditto today, update the CLAUDE.md/AGENTS.md state columns, add a short note for anything notable (including stale claims found in step 4).
Score quickly, don't ceremonialize
The score exists to justify the proposal in one line ("4/10 — 600 lines of reference data loaded every session"), not to produce a report. Spend the effort on the diff.
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
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.

