Claude Code Sends 38,100 Tokens Before It Reads a File
A logged run in a 24,428-file Grafana clone puts Claude Code's first request near 38,100 tokens, with built-in tool definitions the largest single item.

A developer logged every Claude Code API call in a 24,428-file Grafana clone: the first request carried about 38,100 tokens, before any file was read.
The measurement, published 26 November on Dev.to by the developer behind the repowise code index, replaces a common guess — that context fills up because the agent reads too much — with a breakdown of what is already in the window when a session starts.
What was measured, and when
The setup is stated precisely enough to repeat. In the author's words: "I used Grafana (a shallow clone at 12c49a4d, 24,428 tracked files, Go backend and TypeScript frontend), Claude Code 2.1.288 and Sonnet, and ran everything headless with --output-format stream-json, which prints the token usage of every API call."
The numbers come from logs, not estimates: "Measured on 10 November 2026 from the usage field of every API request; some runs also had repowise, the code index I work on, connected over MCP." That last clause matters — some runs carried an extra MCP server, so treat the figures as one developer's instrumented runs rather than a vendor benchmark.
Where the tokens go
Four figures from the post, ordered by what they cost:
| Item | Tokens | What triggers it |
|---|---|---|
| Baseline first request | ~38,100 | Session start, nothing read yet |
| Built-in tool definitions | 23.3k | Always present, largest item in /context |
| Reading one 1,100-line file in full | 16,481 | A single full-file read |
| Cross-stack exploration task | 12,412 | A whole multi-file task |
310 KB git grep | 1,142 | Output written to file, 2 KB preview shown |
The ranking is the finding. The single biggest item was not anything the agent read — it was the built-in tool definitions at 23.3k tokens, which the author names as "the biggest item in /context".
One file read cost more than a whole task
Put two of those rows side by side. "A whole cross-stack exploration task added 12,412 tokens on top of it. Reading one 1,100-line file in full added 16,481."
So a single Read on a medium-sized file cost roughly a third more than an entire task that touched both a Go backend and a TypeScript frontend. For anyone budgeting a long session, that inverts the usual intuition: the expensive operation is not breadth of exploration, it is depth on any one file.
Why a 310 KB grep was nearly free
The cheapest row explains itself: "A 310 KB git grep added only 1,142 tokens, because Claude Code saved the output to a file and gave the model a 2 KB preview."
A 310 KB payload entering the window as 1,142 tokens means the tool never put the bulk in context at all. The practical read: search is cheap because its output is summarised on the way in, while a full-file read is not. Prefer grep to locate, then read the specific range — the cost difference is in the measurement, not in theory.
Check your own repo in one command
The post gives the check directly. "/context prints the breakdown of the current window. It also works in print mode, which is how I got it without opening a session":
cd grafana
claude -p "/context" --model sonnet
Run that at the root of your own repository and you get your baseline, not someone else's. Because the largest line item is tool definitions, the number you see will move with how many MCP servers you have connected — which is the one part of the baseline you control before writing any prompt.
The other lever: stop putting every question in the session
A separate Dev.to post published the same day, by a developer who runs a company in Japan and pays for both tools, arrives at the same problem from the workload side. Their framing: "Split your work into jobs (a start, many steps, an end) and moments (one question, one answer)."
They hand whole jobs to Claude Code and have Claude Code call Codex for moments — a drawing, a check of a drawing, a second opinion. Their own counts, dated explicitly and presented as personal figures from their Mac on 10 November 2026, give a sense of the volume involved:
- "Claude Code version on my Mac 2.1.321
claude --version, November 10" - "Codex CLI version on my Mac 0.164.0
codex --version, November 10" - "Claude Code chats open at once 48 I counted on November 7."
- "Codex session files, recount 8,471 in total I counted
~/.codex/sessionson November 10. The oldest folder is 2026/09/16."
They are candid where their own numbers disagree. On generated images they report "1,442 files in 1,420 folders" counted on 10 November against 221 in an earlier video, and write: "I could not reconcile the two, so trust today's count." Treat all of these as one practitioner's local counts, not as product telemetry.
The connection to the token measurement is direct. If a session's baseline is roughly 38,100 tokens before work starts, then every one-shot question asked inside that session pays the baseline again. Routing those elsewhere is a context decision as much as a tooling preference.
One detail worth copying
The same post notes a constraint on how skills are advertised to the model: "The combined description and when_to_use text is cut at 1,536 characters in the skill list, so put the main use first." The post also notes that "Skill descriptions are loaded into context so Claude knows what exists. The full text loads only when the skill is invoked."
Both lines point the same way as the token breakdown: what is always loaded costs you on every request, and what loads on demand does not.
What to watch
These are two developers' instrumented runs on specific versions — Claude Code 2.1.288 in one case, 2.1.321 in the other — and the built-in tool definition count is the kind of figure that moves between releases. Anyone relying on the 23.3k number should re-run /context after upgrading rather than carry it forward. The method is the durable part: log the usage field, read the breakdown, and decide what deserves a permanent seat in the window.
More from DangMua