Catch dead Claude rules before they silently do nothing.
CLI that verifies .claude/rules/*.md paths: globs actually match files in your project.
# One-off
npx claude-rules-doctor check --root .
# Or install globally
npm install -g claude-rules-doctor
rules-doctor check --root .Claude rules with paths: frontmatter can silently fail if:
- The glob pattern doesn't match any files
- File paths changed after the rule was created
- Typos in glob patterns
This tool scans all your rules and tells you which ones are "dead" (not applying to any files).
rules-doctor checkrules-doctor check --cirules-doctor check --jsonrules-doctor check --verboserules-doctor check --root /path/to/project- β OK β Rule is global (no paths) or paths match files
β οΈ WARNING β Rule misconfigured: invalid YAML frontmatter, empty paths array, invalid types in paths, or invalid glob patterns- β DEAD β Paths specified, but 0 files match
A rule gets WARNING status when:
- Invalid YAML in frontmatter
- Empty paths array (
paths: []) - Non-string values in paths (numbers, booleans, null)
- Invalid glob patterns
$ rules-doctor check
π Rules Doctor - Check Results
β
OK <root>/.claude/rules/valid.md
Matches 1 file(s)
β
OK <root>/.claude/rules/global.md
Global rule (no paths specified)
β DEAD <root>/.claude/rules/dead.md
No files match the specified paths
Summary:
Total rules: 3
β
OK: 2
β οΈ WARNING: 0
β DEAD: 1
β οΈ Found 1 dead rule(s). These rules won't apply to any files.name: rules-doctor
on: [push, pull_request]
jobs:
rules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npx claude-rules-doctor check --cicclint validates frontmatter schema. We validate reality: do your globs actually match files in your repo?
MIT