claude-md-audit
Checks AI project documentation and memory files for accuracy, drift, and broken paths.
Install
mkdir -p .claude/skills/claude-md-audit && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19008" && unzip -o skill.zip -d .claude/skills/claude-md-audit && rm skill.zipInstalls to .claude/skills/claude-md-audit
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Audit CLAUDE.md and the memory store (MEMORY.md + fact files) for drift — stale path citations, cross-file contradictions, duplicated facts, and bloat. Use periodically (monthly, or after a big restructure), not on every change. Read-only by default; reports findings by severity with file:line + suggested fix, and routes anything not fixed this session to a follow-up note. Auto-activates on `/claude-md-audit`.Key capabilities
- →Extract and confirm path citations in CLAUDE.md and MEMORY.md
- →Identify cross-file contradictions in claims
- →Detect duplication and bloat in facts
- →Check for broken index links and orphan memories
- →Report findings by severity with suggested fixes
How it works
The skill performs four checks: stale references, cross-file contradictions, duplication/bloat, and structural hygiene. It extracts paths, compares claims, and identifies issues, then reports them by severity.
Inputs & outputs
When to use claude-md-audit
- →Clean up stale project documentation
- →Audit AI memory integrity
- →Sync instruction files after repo restructuring
About this skill
CLAUDE.md + Memory Audit Skill
This repo restructures courses/ often (subject-first renames, archive moves, supersessions). Every restructure risks leaving CLAUDE.md or a memory citing a path that no longer exists. This skill catches that drift on a periodic scan rather than trying to check every commit (the most-skipped kind of rule).
Scope
The canonical instruction + memory surface:
CLAUDE.md(repo root) — the single project instruction file.MEMORY.md— the memory index loaded each session (at~/.claude/projects/C--GitHub-shidler/memory/MEMORY.md).- The memory fact files —
feedback_*.md,project_*.md, etc. in the same dir.
The four checks (run all, in order)
1. Stale references (highest value here)
Extract every path CLAUDE.md and MEMORY.md cite (backtick-quoted paths, links, table "Path" columns) and confirm each resolves in the live tree:
# pull backtick-quoted paths from CLAUDE.md, test each
grep -oE '`[^`]+`' CLAUDE.md | tr -d '`' | grep -E '/|\.md|\.json|\.xlsx|\.py' | sort -u \
| while read p; do [ -e "$p" ] || echo "MISSING: $p"; done
Do the same for MEMORY.md and for any path a fact file names in its body. Flag each miss with the citing file:line and the likely correct path (grep the tree for the basename — a restructure usually moved it, didn't delete it).
2. Cross-file contradictions
Compare claims that appear in more than one place — CLAUDE.md vs. a memory, or two CLAUDE.md sections. Common drift: a stage count, a weight table, a "current vs. archived" status, a naming convention. Quote both sides with file:line. (Example class: CLAUDE.md's "Active Courses" table vs. a project_* memory's description of the same course.)
3. Duplication + bloat
Facts stated in full in two places should live in one home with a pointer from the other (single-sourcing). Flag: a fact duplicated between CLAUDE.md and a memory; a memory that just restates code/git history (which the memory rules say not to store); a CLAUDE.md section that has grown past its usefulness.
4. Structural hygiene
- Broken index links — a
MEMORY.mdline pointing at a memory file that doesn't exist (run/memory-hygiene's validator if present, or grep the linked filenames). - Orphan memories — a fact file not referenced in
MEMORY.md. - Dangling
[[refs]]— a[[name]]in a memory body with no matching file (may be a deliberate forward-ref — flag, don't auto-fix).
Output
You are read-only by default — report and offer fixes; don't rewrite without approval. Group findings by severity:
CLAUDE.md + memory audit — <date>
ERRORS (broken references / contradictions)
- CLAUDE.md:NN — cites `path/that/moved.md`; now at `new/path.md`. Fix: update the citation.
WARNINGS (duplication / bloat / orphans)
- MEMORY.md — `feedback_foo.md` orphaned (not indexed). Fix: add index line or rotate.
HYGIENE (minor)
- feedback_bar.md — dangling [[baz]] (likely forward-ref; leave unless typo).
End with one terminal line:
CLAUDE.md audit: <N> stale refs / <N> contradictions / <N> dup-or-bloat / <N> hygiene. <recommendation>.
Route anything you don't fix this session into a short follow-up note in the audit output so it isn't lost. Fold in npm run docs:validate or an equivalent link-checker if one exists in the repo.
Why a ritual, not a per-change rule
Drift is better prevented by single-sourcing each fact (one home + pointers) and caught by this periodic scan. Run it monthly or right after a courses/ restructure — not on every edit.
When not to use it
- →On every change to the repository
- →When not performing a periodic audit (monthly or after a big restructure)
Limitations
- →Read-only by default, offers fixes but does not rewrite without approval
- →Does not auto-fix dangling `[[refs]]` as they may be deliberate forward-references
- →Not intended for use on every change
How it compares
This skill provides a periodic, read-only audit of documentation and memory files to catch drift and maintain consistency, unlike real-time checks on every commit.
Compared to similar skills
claude-md-audit side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| claude-md-audit (this skill) | 0 | 15d | Review | Intermediate |
| wrap | 0 | 6mo | Review | Intermediate |
| session-wrap | 1 | 6mo | Review | Intermediate |
| windsurf-custom-prompts | 1 | 2mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
wrap
team-attention
세션 종료 시 자동 정리를 수행합니다. CLAUDE.md 업데이트 제안, 반복 패턴 자동화 기회 탐지, 배운 것 정리, 미완성 작업 정리. 사용자가 /wrap 또는 세션 마무리 요청 시 사용.
session-wrap
team-attention
This skill should be used when the user asks to "wrap up session", "end session", "session wrap", "/wrap", "document learnings", "what should I commit", or wants to analyze completed work before ending a coding session.
windsurf-custom-prompts
jeremylongshore
Create and manage custom prompt libraries for Cascade. Activate when users mention "custom prompts", "prompt library", "prompt templates", "cascade prompts", or "prompt management". Handles prompt library creation and organization. Use when working with windsurf custom prompts functionality. Trigger with phrases like "windsurf custom prompts", "windsurf prompts", "windsurf".
analyse-issue
monarch-initiative
Analyze MONDO GitHub issues for validity, suggest improvements, and generate structured reports with duplication checks and identifier validation
gsd-validate-phase
lza6
Retroactively audit and fill Nyquist validation gaps for a completed phase
file-justification
jleechanorg
**Purpose**: Before creating or modifying ANY file, you MUST document the justification to prevent unnecessary file creation and ensure changes are well-reasoned.