CLAUDE.md length: aim under 200 lines
CLAUDE.md length should stay under 200 lines per file, according to Anthropic's Claude Code documentation. Anthropic: how Claude remembers your project The same page says longer files consume more context and reduce adherence, so the size of the file affects how reliably its instructions are followed.
This page sets out what the documentation says about size, what to do when a file grows past it, and what it leaves unsaid.
How long should a CLAUDE.md be?
Anthropic's Claude Code documentation, read on 10 November 2026, says to target under 200 lines per CLAUDE.md file. Anthropic memory docs The guidance sits in the section on writing effective instructions, under a bullet labelled Size.
The reason given is that longer files consume more context and reduce adherence. Anthropic memory docs Each Claude Code session begins with a fresh context window, and CLAUDE.md is loaded into it at the start, so every line you add is spent in every session. Anthropic memory docs
The figure applies per file. Anthropic lists several locations for CLAUDE.md files, including a project file, a user file at ~/.claude/CLAUDE.md and a local file at ./CLAUDE.local.md, so the 200-line target is for each one of them rather than for the total. Anthropic memory docs
What happens when it runs long?
According to the documentation, adherence falls. Claude treats CLAUDE.md files as context, not enforced configuration, and the page says the more specific and concise the instructions are, the more consistently Claude follows them. Anthropic memory docs
A long file therefore has two costs. It uses context in every session, and the rules inside it become less likely to be followed. The page does not give a line count at which Claude starts ignoring instructions, so 200 lines is a target and not a measured cliff.
For a rule that must hold every time, the documentation points to a different tool. To block an action regardless of what Claude decides, it says to use a PreToolUse hook. Anthropic memory docs Our guide to Claude Code hooks covers how those work.
What belongs in a short file?
The page says to keep CLAUDE.md to facts Claude should hold in every session, such as build commands, conventions, project layout and "always do X" rules. Anthropic memory docs
If an entry is a multi-step procedure, or only matters for one part of the codebase, the documentation says to move it to a skill or a path-scoped rule instead. Anthropic memory docs For large projects it also describes breaking instructions into topic-specific files with project rules, which can be scoped to specific file types or subdirectories. Anthropic memory docs
Wording matters as much as count. The page asks for instructions concrete enough to verify and gives three pairs: "Use 2-space indentation" instead of "Format code properly", "Run npm test before committing" instead of "Test your changes", and "API handlers live in src/api/handlers/" instead of "Keep files organized". Anthropic memory docs Our guide to writing a CLAUDE.md or AGENTS.md has a template that follows this shape.
It also lists when to add a line: when Claude makes the same mistake a second time, when a code review catches something Claude should have known, when you type the same correction you typed last session, and when a new teammate would need the same context. Anthropic memory docs
Is 200 lines a hard limit?
The page words it as a target: "target under 200 lines per CLAUDE.md file". Anthropic memory docs The text we read gives no cutoff after which CLAUDE.md content is dropped from loading.
A figure of 200 lines does appear elsewhere on the page, and it is easy to confuse with the CLAUDE.md target. In the comparison table of the two memory systems, the "Loaded into" row gives "first 200 lines or 25KB" in the auto memory column. Anthropic memory docs Auto memory is the notes Claude writes itself from your corrections and preferences. The two systems are compared in CLAUDE.md vs memory in Claude Code.
| CLAUDE.md files | Auto memory | |
|---|---|---|
| Who writes it | You Anthropic memory docs | Claude Anthropic memory docs |
| Loaded into | Every session Anthropic memory docs | Every session (first 200 lines or 25KB) Anthropic memory docs |
How do you check what loaded?
To confirm a CLAUDE.md file loaded, the documentation says to run /context all in a session and check the list under Memory files. In fullscreen mode, /context alone collapses that list. Anthropic memory docs
To get a starting file, run /init. Claude analyses the codebase and writes a file with the build commands, test instructions and conventions it finds, and if a CLAUDE.md already exists, /init suggests improvements rather than overwriting it. Anthropic memory docs A generated file is a draft, and the page says to refine it with instructions Claude would not discover on its own. Anthropic memory docs
Common questions
Is there a maximum CLAUDE.md size?
The page text we read gives a target of under 200 lines per CLAUDE.md file and does not give a maximum. Anthropic memory docs The "first 200 lines or 25KB" figure in its comparison table is listed for auto memory. Anthropic memory docs
Where should long instructions go?
Multi-step procedures, and instructions that matter only for one part of the codebase, belong in a skill or a path-scoped rule according to Anthropic. Anthropic memory docs Project rules can also split instructions into topic-specific files. Anthropic memory docs
Does Claude always follow CLAUDE.md?
No. Anthropic says Claude treats CLAUDE.md as context, not enforced configuration, and recommends a PreToolUse hook to block an action regardless of what Claude decides. Anthropic memory docs
How we checked
We read Anthropic's page "How Claude remembers your project" on 10 November 2026. The text available to us ends partway through the "Write effective instructions" section, just after the size guidance. The page's contents list includes a troubleshooting entry titled "My CLAUDE.md is too large", and its body is not covered here.
No count of forum posts or other data was used on this page.
Last verified 10 November 2026. Checked against Anthropic's Claude Code memory page on 10 November 2026.
Sources
- Anthropic, how Claude remembers your project checked 10 November 2026
From the publisher
Mover (our product)
Plan details that outgrow a short CLAUDE.md need somewhere else to live, and Mover keeps your plan in plain files on your own computer and loads it into each session.
Mover is a £100-a-month planning tool that runs inside Claude Code or Codex, keeps your plan in plain files on your own computer, and says so when your work drifts from it. It is the wrong choice if you want something that keeps running while your computer is off.
Cancel any time. 30-day money-back guarantee.