Instruction File Size Limit
Individual instruction files must stay within size limits. Oversized files exceed context windows and degrade agent performance. The check enforces a maximum of 300 lines per file.
Antipatterns
- Monolithic instruction file: Putting all project instructions in a single
CLAUDE.mdthat grows past 300 lines. Split into.claude/rules/*.mdfiles by topic instead. - Embedded large examples: Including full code samples or log output inline that push the file past the line limit. Reference external files or keep examples to 3-5 lines.
- Duplicated instructions across sections: Restating the same instruction in multiple sections inflates the file without adding information. State each instruction once.
Pass / Fail
Pass
# Project (48 lines)
## Commands
## Conventions
## Boundaries
Fail
# Project (350 lines)
## Commands (50 lines)
## Conventions (120 lines)
## Full API Reference (180 lines)
Limitations
Counts raw lines (max 300) regardless of line length or content density. A file with 300 single-word lines and one with 300 dense paragraphs are treated equally.
