claude-md-doctor
Skill1 starsChanged 6 days agoMITView on GitHub
Check the instruction files Claude Code loads into every session — CLAUDE.md (project, parent folders, ~/.claude), .claude/CLAUDE.md, CLAUDE.local.md, .claude/rules, AGENTS.md, @imports and the auto-memory MEMORY.md — for broken or too-deep imports, files over the recommended 200 lines, MEMORY.md past the 200-line/25 KB load limit, references to files and npm scripts that no longer exist, secrets, a committed CLAUDE.local.md, and an AGENTS.md that is silently ignored. Shows what loads at launch and its token cost. Use when Claude ignores instructions, when setting up or cleaning a project's CLAUDE.md, or alongside claude-token-audit.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- agent-clinic/claude-md-doctortheir own version, first seen Aug 30, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- agent-clinic/claude-md-doctor★ 38same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- bash-checkpointSkill
- brave-cdpSkill
- cf-backupSkill
- cf-pages-deploySkill
- claude-safety-auditSkill
- claude-sandboxSkill
- claude-token-auditSkill
- cws-extension-checkSkill
- env-doctorSkill
- event-recap-videoSkill
- freelance-proposalSkill
- gif-makerSkill
- itch-html5-packageSkill
- link-preview-checkSkill
- mcp-auditSkill
- package-guardSkill
- pwa-checkSkill
- read-guardSkill
- readme-upgradeSkill
- release-notesSkill
- secret-commit-guardSkill
- session-handoffSkill
- site-qaSkill
- thumbnail-makerSkill
- visual-diffSkill
The file
Files
claude-md-doctor
scripts/md-doctor.mjs is zero-dependency Node 22+ and read-only.
node md-doctor.mjs # what loads when Claude Code starts in the current folder
node md-doctor.mjs path/to/projectOutput: every file loaded at launch with its token cost (and the import chain that pulled it in), the files that load on demand, then findings.
Checks (rules from the Claude Code memory docs)
| Severity | Finding |
| high | @import of a file that doesn't exist; something that looks like a key, token or credentialed URL |
| medium | CLAUDE.md or a rule file over 200 lines (the docs' target); an import more than 4 hops deep (it won't load); an import cycle; MEMORY.md past the first 200 lines / 25 KB, so the rest is invisible; instructions to run npm run x / pnpm x scripts missing from package.json; CLAUDE.local.md committed to git |
| low | backticked paths that no longer exist (stale instructions), CLAUDE.local.md not gitignored, memory files not linked from MEMORY.md, or links to missing ones |
| info | AGENTS.md ignored because a CLAUDE.md exists (add @AGENTS.md to read both) |
It understands the loading rules: parent-folder files load at launch, subfolder CLAUDE.md files and paths:-scoped rules load on demand, imports inside code spans/blocks are skipped (`@README` is literal), and block-level HTML comments are stripped (and not counted).
Fixing
- Over 200 lines: move area-specific instructions into
.claude/rules/<topic>.mdwith apaths:frontmatter so they only load when Claude touches matching files. Imports don't save context; the imported file loads in full. - Contradictions and vague rules are a judgment call this script doesn't make. Run Claude Code's built-in
/doctor prompt-auditfor that. - Stale paths and scripts: update them, or Claude will waste turns looking for files that moved.
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.

