agentleFS
mazze93mazze93/claude-code-skills/skills/claude-md-audit/SKILL.md

claude-md-audit

Skill1 starsChanged 12 days agoMITView on GitHub

Audit CLAUDE.md files across one or many repos for stale information — dead path references, obsolete workspace roots, old model names, drifted file maps. Use when asked to "audit CLAUDE.md", "check for stale docs/instructions", or after restructuring a repo.

3 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

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Run scan.py from this skill's directory against the workspace root (it ships in the workspace plugin, so it is not under ~/.claude/skills/):

    line 16
  2. Very specific:

    Write docs/audits/claude-md-audit-<date>.md in the container: a Critical section, a per-repo verdict table (STALE/clean + evidence lines), …

    line 62

“Common” is measured: kept by at least 6 in 10 of the 3 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

/claude-md-audit

CLAUDE.md files drift: repos get restructured, machines get replaced, and the instructions keep describing a world that no longer exists. Drifted agent instructions are worse than none — agents obey them confidently.

Method (two lanes, budget-aware)

Lane 1 — deterministic (cloud Claude or plain script; this is the verdict lane):

Run scan.py from this skill's directory against the workspace root (it ships in the workspace plugin, so it is not under ~/.claude/skills/):

python3 ~/Projects/skills/claude-code-skills/skills/claude-md-audit/scan.py ~/Projects

Pass a single project directory instead to scan just that project. The claude-md-drift-on-start.sh SessionStart hook does this automatically for the project each new session opens in, so most drift arrives already flagged. The hook uses --json (structured findings) and never parses the text form.

The scanned repository is treated as untrusted. Only regular, non-symlinked files that stay inside the root are read, capped at 1 MiB, with bad encoding replaced rather than fatal. Anything else is reported as skipped. Paths are escaped, so a file or directory name can't forge a finding line. Regression tests: python3 -m unittest discover -s tests -v from this directory.

Dead-path hits leave out tokens that can't be claims about the repo's filesystem: those with no file extension, no trailing slash, and a first segment that isn't an existing directory (owner/repo slugs, branch names, linux/amd64, try/catch), plus domain refs (ghcr.io/…) and slash-separated enums.

It flags, per CLAUDE.md:

  • backticked path references that don't exist on disk (verify each hit — shorthand like blog/PullQuote.astro and enums like plan/implement/review are false positives)
  • stale workspace roots (🚀 PROJECTS, submodule-era language)
  • old model-generation strings (claude-3, sonnet-3, …)
  • last-updated dates

Lane 2 — on-device summaries (Ollama, zero budget): POST each file to http://localhost:11434/api/generate (model gemma4 or better) asking for a 2-3 sentence summary + anything time-sensitive. Summaries give reviewers orientation; they are NOT verdicts — a small model's staleness opinions are unreliable. Never let Lane 2 output change a verdict without Lane 1 evidence.

Always check first

~/.claude/CLAUDE.md exists. Every repo defers postures/hard-stops to it; on a fresh machine it silently vanishes and 90% of the posture goes with it (this happened — see the tessera-claude-anchor record).

Output

Write docs/audits/claude-md-audit-<date>.md in the container: a Critical section, a per-repo verdict table (STALE/clean + evidence lines), and a recommended-fixes list. Flag, don't auto-rewrite: each CLAUDE.md rewrite changes agent behavior in that repo and deserves review in that repo's context.

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.