Context-tax prices what Claude Code sends before you type

The context-tax CLI, posted to Show HN on October 16, reads Claude Code’s session transcripts and lists everything the client sends on every turn before you type. That includes Claude Code’s own built-in tools, and on one real machine the author measured a single one at 11,402 tokens of a 47,700-token first request, almost a quarter. Our check found that on API pricing nearly all of the per-use totals it prints are prompt-cache reads, billed at 1/20 to 1/40 of the input price on current Anthropic models. So the README’s example of 17 million tokens for a server called once comes to $3.43 at Opus 5.5 cache rates.
The project is on GitHub and runs as npx context-tax. It needs no install, account or LLM call, sends no telemetry and has no runtime dependencies, and a test checks that last claim against the import graph. It works only with Claude Code. From the transcripts it reads what a recent session sent: the skill listing, tool names, instruction files, and the client’s own tools and system prompt. It then counts what you actually called in the same transcripts and multiplies. The per-turn total is exact because it comes from the usage your API calls were billed on. The rows are estimates at four characters per token, and whatever doesn’t add up goes in its own unattributed row.
Which lines you can switch off
Claude Code’s system prompt and session details are fixed, and nothing turns them off. Its built-in tools can be turned off. A permissions.deny rule naming a tool removes it from what is sent, and the 11,402-token figure was measured by running an interactive session with and without such a rule. context-tax fix --level lean denies the built-in tools and plugins you use in under 1 session in 20, and --level max goes up to under 1 in 5. Each line of the plan says what stops working until you take the rule out again. The default level only touches things you have never used.
Skills run into a different problem. Once the skill listing is over its budget, Claude Code sends a skill as a bare name with no description, which gives the model nothing to pick it by. Nothing on screen warns you. The budget is 1% of the context window, converted to characters at three per token on current models. By our check of the client, that is 6,000 characters on a 200K window and 30,000 on 1M. context-tax counts the bare names entry by entry from the listing a session sent and groups them by owner, because the usual cause is one large plugin crowding out your own skills.
There are two fixes. fix --restore-descriptions raises skillListingBudgetFraction so every description goes out. It is the one change that makes every turn more expensive, so a plain fix never includes it. The other fix is switching skills off, but while the listing is still over budget that recovers close to nothing, because the freed room goes to another description. A skill you only ever type as a slash command can be set to user-invocable-only, which keeps the command and drops its description from the prompt.
MCP servers get two numbers. One is the tool names and server instructions that every turn carries. The other is a deferred column for the schemas, which are loaded only when something reaches for them. The per-call column divides a server’s standing cost over all turns by its calls. When nothing dates the server, the count runs over every session on record and is printed as an upper bound. Each finding goes to the setting that actually controls it:
- A server from a repo’s
.mcp.jsonis added todisabledMcpjsonServersin.claude/settings.local.json. - For a server declared in
~/.claude.json, the tool prints aclaude mcp removecommand for you to run. That command removes the server from every project on the machine, so it is only suggested when the server is unused across the whole machine. - A claude.ai connector, which no local file declares, gets a pointer to where it is switched off.
In November 2025 a claude-code GitHub issue, filed on November 10, counted 67,300 tokens of tool definitions from seven MCP servers before the user typed anything. That was 33.7% of a 200,000-token window. Anthropic published its Tool Search tool on November 24, 2025, citing an 85% reduction in token usage. Claude Code 2.1.7, released January 13, turned on by default an auto mode that defers MCP tool descriptions once they pass 10% of the window. In 2.1.302 the default resolves to tool search on. With schemas deferred, a server’s every-turn cost is just its names and instructions, and the README notes that the client’s own tools and system prompt are now usually the largest lines on the screen.
How fix writes
Writing settings is a separate subcommand, fix, so you can’t turn a report into a write by adding a flag. --dry-run prints the literal diff and stops. A plain run shows the diff and asks before writing. It backs up each file it replaces to ~/.cache/context-tax/backups/, writes to a temp file and renames it, and sets mode 0600. Without a terminal it refuses to write unless you pass --yes. It skips any settings file that doesn’t parse, and running it twice changes nothing. The diff even shows a change nobody asked for: the whole file comes back with two-space indentation, so an array written on one line returns one element per line. It never writes ~/.claude.json and never backs it up, because that file sits beside API keys and bearer tokens. Once a new session has started after a fix, the report’s first lines show the median first request before and after.
Where the counts stop
context-tax can price your memory and instruction files but can’t tell which instructions in them the agent used. The README says no log can, because that depends on the model’s attention, not your history. To weigh an MCP server it has to start it, the same way your agent does. Results are cached for a week. --no-spawn uses the cache plus a bundled table, and project servers are never started from a directory you are not standing in. Versions before 0.4.0 counted transcript lines instead of replies, so their turn and per-call figures came out about twice the true value.
Our analysis
What we checked
On October 18 we built context-tax from source in a sandbox and ran its tests and every screen against a synthetic home directory. We also read the skill-listing code in the Claude Code 2.1.302 binary and checked it against real transcripts and Anthropic’s pricing page.
The tool works as described: it runs offline, its per-call arithmetic is right, and a dry run wrote nothing. Two of the README’s numbers need adjusting. On current models the skill-listing cap is a quarter smaller than the README says. And the per-use token totals are mostly cache reads, which cost a small fraction of fresh input.
- 458 of 459 tests passed. The one failure came from the sandbox, whose PID 1 doesn’t reap a killed process. On the synthetic home, a 419-token server called once in 120 turns came out at 50,280 per call.
fix --dry-runaddedWorkflowandAgent(reviewer)topermissions.deny, reindented the file and wrote nothing. - The README prints no dollar figures, on the grounds that “a wrong dollar figure is more convincing than a wrong token count”, and it never mentions caching. In two of our sessions, cache reads made up 99.4% (1,656 replies) and 96.3% (194 replies) of the context. Opus 5.5 costs $4 per million input tokens and $0.20 per million for cache hits. Subscriptions are not billed per token at all.
| README example figure | As uncached Opus 5.5 input | As cache hits |
|---|---|---|
| 17,160,000 tokens per call (sentry) | $68.64 | $3.43 |
| 1.7B tokens carried | $6,864 | $343 |
- The README puts the skill-listing cap at 8,000 characters on a 200,000-token window and 40,000 on a million. Claude Code 2.1.302 counts four characters per token only for Opus 4.6, Sonnet 4.6, Haiku 4.5 and older models, and three for everything newer, which gives 6,000 and 30,000. Real sessions on 2.1.296 to 2.1.302 with 115 skills sent listings of 29,949 to 29,991 characters, with 28 to 31 bare names. The same three-per-token rate means the tool’s rows can undercount by up to about 25% next to Claude Code’s own estimate. The billed total is unaffected, and the gap ends up in
unattributed. - By our reading of the tool’s window formula, which divides by four, a report on a current model would show a window of about 150,000 for a 200K model and about 750,000 for a 1M one.
Up next
AI industryHardware & infrastructureanalysis
Surface Laptop Ultra slows down on local AI once unplugged
99.6% of full performance on battery, Microsoft claims for the Surface Laptop Ultra. The New Stack’s local AI tests saw around a 20% to 25% drop once it was unplugged. Do you run local models on battery, or only plugged in at a desk?
Related stories
- claude-files-pane shows Claude Code’s file reads live
- Missing Claude’s cache on Opus 5.5 costs up to 40x more
- Tokendoctor cut its author’s Claude Code cost 38%
- memsaga gives Claude Code’s memory files a git history
- Intent-lens spells out Claude Code calls before they run
- Codedict cuts Claude Code tokens 63%, but cost only 26%
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

