Short answer: under 200 lines, which is Anthropic's own target, and the reason is attention, not money. A line of CLAUDE.md is about 13 tokens and it's sent again on every turn. Priced over 190 of my real Claude Code sessions at Opus 5.5 API rates, one line costs about a tenth of a cent per session with caching, and about a cent without. A whole 200-line file comes to 21 cents a session.
Every guide answers this with a number. Sixty lines. A hundred. Two hundred. Three hundred. None says what a line costs, which is odd for a file that's sent again every time you press enter.
So I priced one. Not with a file size times a message count, which ignores the cache, but with the transcripts Claude Code already keeps on my machine: 190 sessions, 63,964 turns, and the caching they actually got.
A line of CLAUDE.md costs about a tenth of a cent a session. Keep it short for Claude's sake, not your bill's.
The numbers everyone quotes, and where 200 comes from
There's one official number. Anthropic's memory docs say to "target under 200 lines per CLAUDE.md file", because a longer file takes more context and gets followed less reliably.
The unofficial numbers come with a reason too. HumanLayer's guide keeps its own root file under sixty lines and reports a consensus of under 300. Its logic is a budget: frontier models follow roughly 150 to 200 instructions with reasonable consistency, and Claude Code's own system prompt already spends about 50 of them.
Two hard limits do exist. Don't confuse them with the 200:
The 200-line cutoff is for a different file. Claude Code's auto memory loads only the first 200 lines (or 25KB) of
MEMORY.md.CLAUDE.mdhas no line cutoff at all: Claude Code loads the whole thing and only skips a file over 4 MiB.Codex caps AGENTS.md at 32 KiB. Per its docs, Codex stops adding instruction files once they reach 32 KiB combined, unless you raise
project_doc_max_bytes.
So 200 is a target about attention. Nobody puts a price on it.
What one line of CLAUDE.md costs over a real session
Three numbers: tokens per line, how many times the line is sent, and what each send costs.
Tokens per line. Here's this site's own CLAUDE.md:
$ wc -l CLAUDE.md
114 CLAUDE.md
$ bridle agents CLAUDE.md | grep size
✔ size: 916 words ≈ 1474 tokens, re-sent every turn
1,474 tokens over 114 lines is about 13 a line. That isn't a quirk of my file. Across 350 public files (more on those below), the typical line ran 10 to 14 tokens at every size.
How many times it's sent. The file loads at the start of a session and stays to the end. It even comes back after /compact. And Claude Code sends the whole session again on every turn, where a turn is one API call: a request that runs ten tools is ten turns. Here's my whole history:
$ baggage --all
baggage — 190 sessions, all projects, 63,964 turns
before you typed anything 76k tokens
system prompt, every tool schema, every skill, CLAUDE.md.
paid again on all 63,964 turns = 4.8B tokens, 18% of the bill,
whether you called any of it or not.
Counting each session's turns from the same transcripts, the median session ran 213 turns. A quarter ran under 64, a quarter over 466, and the longest ran 2,943. So in a typical session, one line is sent 213 times: 2,769 tokens.
What each send costs. This is where the guesses go wrong, because of the cache. The first turn writes the line to Claude Code's one-hour cache at twice the input price. Every later turn reads it back at a twentieth of the input price on Opus 5.5 (Anthropic's rates). Unless the cache broke: an idle hour, a /compact, a model switch. Then the start of the session is written again at the write price. In my history, that happened on 1.8% of turns (1,137 of 63,453).
So for one line over a 213-turn session on Opus 5.5:
first write: 13 tokens at $8 per million = $0.0001
3.8 re-writes at the same price = $0.0004
208 cache reads at $0.20 per million = $0.0005
total: $0.0010. Uncached, all 213 sends at $4 per million: $0.011.
The same sum on three models, for one line and for a full 200-line file:
Opus 5.5: one line $0.0010 cached, $0.011 uncached. 200 lines: $0.21 cached, $2.22 uncached.
Sonnet 5.5: one line $0.0005 cached, $0.0055 uncached. 200 lines: $0.10 cached, $1.11 uncached.
Fable 5.1: one line $0.0019 cached, $0.028 uncached. 200 lines: $0.38 cached, $5.54 uncached.
Two things fall out of that. Caching cuts the price of a line by 11 to 14 times, so any figure that skips the cache is off by an order of magnitude. And on Opus 5.5, the five turns that write the line cost nearly as much as the 208 that read it, and a cache break re-writes the whole session, not just this file. If cost is the worry, keep the cache warm before you start cutting lines.
On a Pro or Max plan you see a limit, not dollars. In tokens, a 200-line file is about 554,000 tokens sent over a typical session. How heavily a cached token counts against the limit isn't published, so I won't guess.
One caveat on the ruler. bridle counts four characters a token, Anthropic's own rough estimate, but Anthropic also says Claude 4.7 and later produce about 30% more tokens for the same text. On current models, add about 30% to every figure here.
Does CLAUDE.md save tokens?
Only when it saves turns. A wasted turn re-sends at least the 76k floor from the block above, plus everything since. A line costs 2,769 tokens a session. So a line that prevents one wrong turn every 27 sessions has paid for itself in tokens. A line that never changes what Claude does never will.
How long real CLAUDE.md files are (350 repos)
Last month, for another project, I pulled 350 public instruction files from GitHub: 220 CLAUDE.md and 130 AGENTS.md, one root file per repo, no forks, every repo pushed this year. I picked them evenly across six file sizes, so they show the range, not the typical file on GitHub. Then I ran wc -l and bridle on every one. Median lines and tokens per line, by size:
under 800 bytes (41 files): 8 lines, 10.6 tokens a line
800 bytes to 1.5 KB (57): 26 lines, 10.2
1.5 to 3 KB (61): 49 lines, 11.6
3 to 6 KB (50): 83 lines, 12.7
6 to 12 KB (70): 150 lines, 12.8
12 KB and up (71): 312 lines, 14.4
Bigger files have denser lines, with tables and code blocks, but the typical line stays between 10 and 14 tokens. 73 of the 350 run past 200 lines and 11 past 500. The longest is 980 lines, about 8,700 tokens. At the prices above, that one costs about 69 cents a session on Opus 5.5 with caching, or $7.38 without. 11 of the 350 are past the 32 KiB that Codex reads by default.
My own 23 files have a median of 41 lines, and three run past 200. One of those, 311 lines and about 4,200 tokens, sits in a project where my sessions run a median 493 turns. That's 64 cents a session on Opus 5.5 with caching, $8.24 without, and under 5% of the 89k that project loads before I type anything.
In money, length barely matters. That leaves Anthropic's reason: a long file gets followed less. The research on that is mixed (I went through it in the AGENTS.md vs CLAUDE.md post), but every line still competes with the task for attention.
Cutting it without losing rules
Ask of each line: would Claude get something wrong without it? If not, delete it. If it would, check whether the line can live somewhere cheaper:
Rules for one part of the code go in
.claude/rules/with apaths:list at the top. Per the docs, they load when Claude reads a matching file, so they're carried only from that turn on, and only in sessions that touch those files.Procedures become a skill. Its description loads every session; the body loads only when it's used.
@importsdon't shrink anything. Imported files load at launch too. They tidy the file, not the bill.Notes for humans go in an HTML comment. Claude Code strips block-level comments before Claude sees the file, so they cost nothing.
Keep what you keep repeating. The lines worth their rent are the corrections you've typed three times. Your chat history already has them.
What I didn't do is trim a file and measure the difference. Trimming today and running baggage tomorrow compares two days of work, not two files. Done properly, it's a week of sessions on the shorter file: the floor, the share of turns that re-write the cache, and whether the cut rules start turning up in chat again.
Check yours
$ wc -l CLAUDE.md
$ npx -y github:manpreet171/bridle agents CLAUDE.md # or AGENTS.md
$ npm install -g github:manpreet171/baggage
$ baggage # this project's floor and turns
bridle prints the file's size in tokens, plus what's missing from it. baggage reads the transcripts already on your machine and prints your floor, your sessions and your turns. Both are free and send nothing anywhere. Then the sum is yours: tokens per line, times turns per session, times your model's cache price.
This is how we work. Price the thing before arguing about it. When an AI system we build for a business costs more than it should, we price each part before we cut any of them.
Sources: both terminal blocks with output are real runs on my machine on 9 Oct 2026, the baggage one trimmed to its first lines. Turns per session and cache re-writes are counted from the same transcripts baggage reads, the same way it counts a turn. The 350 files are public repos pulled on 24 Sep 2026. Token counts are estimates at four characters a token. Prices, cache multipliers and the tokenizer note are from Anthropic's pricing page; CLAUDE.md loading, rules and limits from Claude Code's memory docs; line counts and the instruction budget from HumanLayer; the 32 KiB cap from Codex's AGENTS.md docs.
Where this fits: memory and context, layer 2 of the Agent Ops Stack.
Read next: Where your Claude Code tokens actually go. Output is 0.2%. · AGENTS.md vs CLAUDE.md: Claude Code reads both now, just not at once.
Originally published at singhlabs.dev.
Top comments (0)