Free resources · For developers
Does a longer CLAUDE.md get obeyed less?
The same three rules in CLAUDE.md files of 5, 61 and 201 lines, 180 replies: the short file was followed more often.
How long should CLAUDE.md be?
The usual advice is a "target under 200 lines per CLAUDE.md file". The page adds that longer files "reduce adherence".
What did the test do?
We put the same three reply rules in files of 5, 61 and 201 lines. In the two longer files the rules sit in the middle. We made the other lines from templates: unrelated project notes. The rules: first sentence 12 words or fewer, whole reply 80 words or fewer, and never write "I hope this helps". Claude Haiku answered the same 30 questions, twice each, for every file.
What happened?
- 5 lines: 51 of 60 replies followed all three rules.
- 61 lines: 41 of 60.
- 201 lines: 40 of 60.
The data shows short against not short. Other work finds long inputs are used unevenly when the key detail sits in the middle. The 61-line and 201-line files scored the same, so there is no steady decline with length.
How firm is that?
- The 5-line against 201-line difference gives p = 0.03, 5 against 61 gives p = 0.05, and 61 against 201 gives p = 1.0. None of the three p-values is corrected for running three tests.
- The 60 replies per file are 30 questions we asked twice, so they are not fully independent. The p-values do not account for that.
- The same rules in a similar 4-line file followed 43 of 60 in an earlier run. Two runs of nearly the same setup differed by 8; the short and long files differ by 11.
- One model, format rules only. The filler said nothing about replies, so it never contradicted the rules. A real CLAUDE.md might. Longer files may also just make replies longer; we did not test that.
What we would do
- Keep CLAUDE.md short. Move instructions that matter for only part of the codebase into path-scoped rules, which load only for matching files.
- Do not rely on CLAUDE.md for a rule that must never break. Claude treats it as "context, not enforced configuration". A hook can enforce it instead; with a Stop hook, 58 of 60 replies followed all three rules.
- Test your own rules with the kit.
Check
- Count the lines in your CLAUDE.md. If it is over 200, move something out and test again.
- Run the kit with your real file and a trimmed copy before changing anything.
- This result covers one model and format rules only.
Learn it step by step: How Claude remembers
Sources
Sign up for membership to see the sources.