CLAUDE.md per-turn token cost is a flat number. Here is the table.

Your CLAUDE.md is re-sent in full on every turn. That means its per-turn token cost is not a range and not a guess: it is the file's entire token count, every turn, for the life of the session. Once you know that, the cost is a lookup, not a mystery.

M
Matthew Diakonov
6 min
Direct answer (verified 2026-05-18)

Per turn, your CLAUDE.md costs its entire token count, because 100% of the file is re-sent in the system prompt on every API call. The dollar figure is tokens x input_rate / 1,000,000. At Opus 4.7's $5 per million input rate, a 6,000-token file costs about $0.030 per turn with no cache and about $0.003 per turn with a prompt-cache hit. To estimate token count: file characters divided by 4.

Rates from platform.claude.com/docs/en/about-claude/pricing. Firing model from src/lib/analyzer.ts line 264.

Why it is flat: the analyzer never uses a fraction

People expect per-turn cost to be complicated, like only the headings count or the model skims it. It is not. The token cost of CLAUDE.md per turn is the whole file. Our analyzer encodes exactly this: it estimates tokens as characters over 4, then sets the per-turn figure equal to the total.

src/lib/analyzer.ts

The Messages API is stateless. Every turn, the harness rebuilds the whole context and prepends the system prompt, and your CLAUDE.md (project file, any nested files, the global ~/.claude/CLAUDE.md) sits inside that prefix. There is no mechanism that sends half of it. So per-turn token cost is a property of the file, not of the turn, and that is what makes it tableable.

The per-turn cost table, by file size

Find the row closest to your file. The first column is rough file size on disk; tokens is characters over 4. Dollar columns are input cost onlyat the Opus 4.7 rate of $5 per million ($0.50 per million on a cache hit). The last column is the file's share of a 30-turn session, the round-number long session the analyzer assumes.

File sizeTokens / turn$ / turn$ / turn cached30-turn session
~4 KB1,000$0.0050$0.0005$0.15
~8 KB2,000$0.0100$0.0010$0.30
~16 KB4,000$0.0200$0.0020$0.60
~24 KB6,000$0.0300$0.0030$0.90
~32 KB8,000$0.0400$0.0040$1.20
~48 KB12,000$0.0600$0.0060$1.80

Other models, same token counts: Sonnet 4.6 input is $3 per million (multiply the $/turn column by 0.6), Haiku 4.5 is $1 per million (multiply by 0.2). Output tokens are billed separately and are not part of CLAUDE.md cost. These are the per-turn cost of the configuration file itself, not the whole request.

A 6,000-token CLAUDE.md, in three numbers
0%

of the file fires every turn. No partial firing.

$0

per turn, Opus 4.7, no cache.

$0

across a 30-turn session, uncached.

The formula, and why the analyzer's dollar number runs high

The cost math is four lines of source. The only subtlety is the rate constant: it is pinned to the older Opus 4.1 price, so the analyzer's absolute dollars are 3x too high for anyone on a current Opus model. The token counts and the relative ranking are correct; divide the dollars by 3.

src/lib/analyzer.ts

The chars/4 estimate is a floor, not the real Opus 4.7 number

Characters over 4 is the heuristic every CLI uses, and it is good enough for a ranking. But Opus 4.7 shipped a new tokenizer that can produce up to 35% more tokens for the same text than older estimates. Code, punctuation, and non-English content tokenize heavier. So a file that chars / 4 calls 6,000 tokens can actually bill closer to 8,000 per turn on Opus 4.7.

Practically: read the per-turn cost off the table for your chars / 4 number, then treat the table value as the low end of the range. If your CLAUDE.md is dense with code blocks and config snippets, assume the high end. The exact rate is on Anthropic's pricing page; the tokenizer change does not move the per-token price, only the token count.

Read your own per-turn cost

Paste your file into the analyzer on ccmd.dev. It runs in your browser, no upload, no signup. Here is what the per-turn breakdown looks like for the sample 6,042-token file:

ccmd score

Three steps to your own number without a tool: count the characters in your CLAUDE.md, divide by 4 for the per-turn token cost, multiply by your model's input rate ($5 per million on Opus 4.7) and divide by a million. That is the cost the file adds to every single turn before Claude reads a line of your code.

When the per-turn number is too high

If the table puts your file uncomfortably high, the per-turn cost itself is not the thing to attack first. Two cheaper moves come before cutting content:

  • Fix prompt-cache busting.A volatile string (an ISO date, "today", "this session") in the first 20 lines forces every turn to pay the full uncached rate instead of the 10x-cheaper cached rate. One edit, the whole $/turn-cached column.
  • Move conditional rules off the every-turn surface. A rule that only matters during one workflow does not belong in a file that fires every turn. Skills load only when their description matches the request, so a rule moved into a skill stops counting toward per-turn cost entirely.

After those two, trimming actual lines is the third lever. Every line you cut is its own token count off the per-turn total, every turn, for every session from now on.

Want the per-turn cost of your actual CLAUDE.md, line by line?

Paste it on ccmd.dev for the free in-browser scan, or book 20 minutes and we will read your file and rank its per-turn cost with you.

Frequently asked questions

How much does my CLAUDE.md cost per turn?

Per turn it costs its entire token count, because the whole file is re-sent in the system prompt on every API call of the session. The dollar figure is token_count x input_rate / 1,000,000. At the current Opus 4.7 input rate of $5 per million tokens, a 6,000-token CLAUDE.md costs about $0.030 per turn with no cache and about $0.003 per turn with a prompt-cache hit. A 2,000-token file is $0.010 per turn, a 12,000-token file is $0.060. To estimate your file's token count without a tool, divide its character count by 4.

Does only part of CLAUDE.md fire each turn?

No. There is no partial firing. Our analyzer at src/lib/analyzer.ts line 264 sets estimatedTokensFireEveryTurn = totalTokens. It is not a fraction of the file and it is not just the headers. The Messages API is stateless, so the harness rebuilds the entire context on every call, and your full CLAUDE.md is part of that prefix on turn 1 and on turn 100. That is what makes the per-turn cost a flat, predictable number rather than something that varies turn to turn.

How do I estimate my file's token count without running a tool?

Divide the file's character count by 4. That is the heuristic the analyzer uses at src/lib/analyzer.ts line 37: Math.ceil(text.length / 4). A 24,000-character CLAUDE.md is roughly 6,000 tokens. The caveat: Opus 4.7 shipped a new tokenizer that can produce up to 35% more tokens for the same text than older estimates. So chars/4 is a floor for Opus 4.7. A file the heuristic calls 6,000 tokens can bill closer to 8,000 per turn on Opus 4.7 depending on how much code, punctuation, and non-English text it contains.

Why does the ccmd analyzer report $15 per million when Opus 4.7 is $5?

The cost constant at src/lib/analyzer.ts line 267 is OPUS_IN_PER_M = 15, which was the Opus 4.1 input rate documented when the analyzer was written. Anthropic's current Opus 4.7 input rate is $5 per million tokens. The analyzer's relative ranking of which lines cost the most is still correct, but the absolute dollar figure is 3x too high if you are on a current Opus model. Divide the analyzer's reported cost by 3 for the real Opus 4.7 number. The paid tier pulls the live rate instead of the pinned constant.

Does prompt caching change the per-turn cost?

Yes, by about 10x on the cached portion. Anthropic's prompt cache reads bill at 10% of the base input rate, so on Opus 4.7 a cached CLAUDE.md costs $0.50 per million instead of $5. A 6,000-token file drops from $0.030 to $0.003 per turn. The catch is that the cached prefix has to be byte-identical between requests within the cache window. A single ISO date or 'today' string in the first 20 lines of CLAUDE.md mutates the prefix every session and forces every turn to re-pay the full uncached rate. The analyzer flags that as a cache_bust finding.

What does CLAUDE.md cost per turn on Sonnet 4.6 and Haiku 4.5?

Same token count, different rate. Sonnet 4.6 input is $3 per million, so a 6,000-token CLAUDE.md is about $0.018 per turn uncached. Haiku 4.5 input is $1 per million, so the same file is about $0.006 per turn. Cache reads are 10% of base on every model: $0.30 per million on Sonnet, $0.10 on Haiku. The per-turn token cost (6,000 tokens) does not change with the model; only the price per token does.

Does AGENTS.md, .cursorrules, or .grokrules have the same per-turn cost?

Same firing model, different price per token. The analyzer detects type by content at src/lib/analyzer.ts line 41 and treats all four formats the same way, because Codex (AGENTS.md), Cursor (.cursorrules), and Grok Build (.grokrules) all inject their rule file into the host model's system prompt and re-send it on every turn, exactly like Claude Code injects CLAUDE.md. The per-turn token cost is still the file's full token count. The dollar rate depends on whichever model that host routes to.

How do I see the per-turn cost for my own file?

Paste it into the textarea on ccmd.dev. The analyzer runs in your browser with no upload and reports totalTokens and estimatedTokensFireEveryTurn (always equal to totalTokens). Multiply totalTokens by your model's input rate and divide by 1,000,000 for the per-turn dollar cost. It also returns a per-line findings array so you can see which specific lines are inflating that per-turn number and which ones can move to a skill that only loads on demand.

Related guides

How did this page land for you?

React to reveal totals

Comments ()

Leave a comment to see what others are saying.

Public and anonymous. No signup.