CLAUDE.md Validator
The CLAUDE.md validator checks your project's CLAUDE.md files for correctness, size limits, import integrity, and content structure.
What It Checks
- File size limits (40KB default)
@importdirective syntax and referenced file existence- Circular import detection
- Import depth limits (max 5 levels)
- YAML frontmatter in
.claude/rules/*.mdfiles pathsglob pattern validity
Rules
This validator includes 15 rules. See the CLAUDE.md rules category for the complete list.
| Rule | Severity | Description |
|---|---|---|
| claude-md-size | warn | File exceeds maximum size limit (40KB default) |
| claude-md-import-missing | error | Imported file not found |
| claude-md-import-circular | error | Circular import detected |
| claude-md-file-not-found | error | CLAUDE.md file not found |
CLI Usage
bash
# Validate CLAUDE.md files only
claudelint validate-claude-md
# With verbose output
claudelint validate-claude-md --verbose
# With auto-fix
claudelint validate-claude-md --fixSee Also
- Claude Code Memory - Official CLAUDE.md documentation
- Configuration - Customize rule severity
- Troubleshooting - Common issues