Skip to content
Visionwork
Log in

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?

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?

What we would do

  1. Keep CLAUDE.md short. Move instructions that matter for only part of the codebase into path-scoped rules, which load only for matching files.
  2. 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.
  3. Test your own rules with the kit.

Check

Learn it step by step: How Claude remembers

Sources

Sign up for membership to see the sources.