Claude.md Files Should Stay Under 200 Lines to Keep AI Instructions Effective
Anthropic's documentation recommends keeping CLAUDE.md files under 200 lines, as longer files consume more of Claude's context window and reduce how reliably the AI follows instructions. The 200-line figure is a soft target, not a hard limit — the file still loads beyond that point, but adherence gradually degrades. A separate hard limit of 4 MiB exists, at which point Claude Code skips the file entirely, though plain text rarely reaches that threshold. Developers using subagents should be especially mindful of file length, since each subagent loads CLAUDE.md into its own context, effectively multiplying the token cost. When a file grows too long, the guidance suggests trimming unnecessary content, splitting instructions across multiple scoped files, or moving reference material such as API docs to external links.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in