Skip to content
Back to skills

Claude Md Doctor

ASecurity

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 laun...

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 21, 2026
ai-agentsnodegit

Works with

  • claude code

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 21, 2026

npx -y skills add binay-py/claude-skills --skill claude-md-doctor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Claude Md Doctor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Claude Md Doctor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/binay-py-claude-md-doctor/badge)](https://www.skillsdirectory.com/skills/binay-py-claude-md-doctor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: claude-md-doctor
description: 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.
---

# 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/project
```

Output: 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>.md` with a `paths:` 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-audit` for that.
- Stale paths and scripts: update them, or Claude will waste turns looking for files that moved.

Files in this skill

  • SKILL.md2.5 KB
  • scripts/md-doctor.mjs11.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.