Free Claude Code rules checker and CLAUDE.md linter
Rules in .claude/rules/ are Markdown files Claude Code adds to its context. A rule with no paths frontmatter loads in every session. A rule with paths loads only when Claude opens a matching file. A small mistake, like an unquoted glob, a Cursor-style globs: field or the wrong folder, quietly changes which of those happens. Paste up to four rule files below to see when each one loads, then type file paths to see which rules Claude would pick up for them.
Everything runs in your browser. Nothing you paste is sent anywhere.
1. Your rule files
Give each file its path, such as .claude/rules/api.md, .claude/rules/frontend/react.md or ~/.claude/rules/prefs.md, and paste its full contents including the --- lines.
2. When each rule loads
Paste a rule above to see the report.
3. Which rules load for a file?
Build a new rule
Writes the frontmatter for you with every pattern quoted, which avoids the most common YAML mistakes. Leave patterns empty for a rule that loads in every session.
Save as
Check a CLAUDE.md
Counts lines against the 200-line target, lists every @path import the way Claude Code reads it (spaces, quotes, backticks), and flags instructions that work better as a hook or permission rule.
How rules load (from the docs)
- Where: every
.mdfile in.claude/rules/, including subfolders such as.claude/rules/frontend/. Personal rules in~/.claude/rules/apply to every project and load before project rules. Neither set overrides the other. - No
paths: the rule loads at launch, with the same priority as.claude/CLAUDE.md. - With
paths: the rule loads when Claude uses Read, Write or Edit on a matching file, or views one with a single-file command such ascatorhead. You'll see a one-lineLoaded .claude/rules/...notice. After/compactit's gone until a matching file is opened again. pathsis the only field read. It takes a YAML list or a comma-separated string. Other fields are ignored without an error. If the YAML doesn't parse, Claude Code ignores the frontmatter and loads the rule as if it had nopaths;claude --debugshows the parse error.- Brace expansion like
*.{ts,tsx}works. A rule's wholepathslist shares a budget of 1,000 expanded patterns and 4 MiB; a pattern past the budget is used unexpanded and matches nothing. - An invalid
[, as inphotos [2024/**, makes that pattern match nothing. Escape a literal bracket as\[, and put such patterns in single quotes, because a backslash inside double quotes is a YAML escape. - Symlinks into
.claude/rules/work. A link to a target outside your working directory waits for the external-imports approval, and after approval only its rules withoutpathsload. - Excluding:
claudeMdExcludesin settings skips CLAUDE.md and rules files by absolute-path glob. AReaddeny rule that covers a rule file also stops it loading, with anInstruction file not loadednotice.
What this checker can't know
- Claude Code's exact glob engine. The tester uses standard glob rules (
*stays inside one folder,**crosses folders, files starting with a dot are matched). We checked it against a common glob library on 589 pattern and path pairs, but edge cases such as negated brackets can differ. - Its exact YAML parser. The mistakes flagged here are rejected by the two most common JavaScript YAML parsers. If Claude Code's parser accepts something this page rejects, quoting the pattern still works in both.
- What patterns in a subfolder's
.claude/rules/or in~/.claude/rules/are relative to. The docs only show project-relative patterns. - Your session. Run
/contextto see which memory files loaded, or add anInstructionsLoadedhook, which reports every CLAUDE.md and rule file as it loads, withload_reasonpath_glob_matchand thetrigger_file_paththat caused it.
Rule still not loading, or Claude ignoring your CLAUDE.md? Read CLAUDE.md or .claude/rules not working? 12 causes and fixes. Starting from scratch? Use the CLAUDE.md generator. Instruction has to happen every time? Make it a hook with the hooks generator, or a hard limit with the permissions builder.
Rules on this page follow Anthropic's memory and rules, debug your configuration and hooks docs. Not affiliated with Anthropic.