
The bill for what surrounds the model
Harness cost
Built on Berkeley's HarnessTax measurements: how many tokens go to tool schemas before the agent does anything at all. An estimate, not a provider invoice.
What this calculator counts
Every time you hand an agent a task, the description of every tool it can use travels with it — before it has done anything at all. This works out what that opening payload costs you.
In detail
A harness is the program around the model: Claude Code, Codex CLI, Pi. Each declares its own set of tools, and the full description of every tool rides in the request. Claude Code declares 23 tools and spends 27,000 tokens on them, Codex CLI 7 tools and 11,000, Pi 4 tools and under two thousand.
Every connected MCP server adds its tools on top. The study did not measure those, so the weight of one server is a parameter you set. Two thousand tokens is a cautious estimate; large servers such as GitHub run several times higher.
On a subscription nobody bills you for these tokens, but they take up room in the context window: the heavier the harness, the less is left for your code and the conversation, and the sooner compaction kicks in. On the API you pay for them on every request.
Tool schemas do not change between requests, so they are cached. The first call of a session writes the cache and costs a quarter more than usual; the ones after it read the cache and cost ten times less. The cache lives five minutes. Counting without it puts the figure at roughly three times the real one.
Scenario
Harness
Model
How you pay
Our own assumption: the study did not measure MCP
Only the opening context is counted: the tool schemas that ride in every request. HarnessTax measurements (Berkeley), 630 attempts per harness. Direct API prices as of 1 September 2026. Check the current ones.
What the opening context of Claude Code and MCP servers costs
Every request to an agent carries the description of all its tools before it has done anything. Claude Code declares 23 tools and spends around 27,000 tokens on them; Codex CLI declares 7 and spends 11,000. This calculator shows what that payload costs you — in dollars on the API, or as a share of the context window on a subscription.
How to use it
- 1Pick the harness, the model, and how you pay: subscription or API
- 2Set how many tasks a day you run and how many MCP servers are connected
- 3Compare the harnesses in the table and copy a link to the calculation
The details
- Claude Code
- 23 tools, ≈27,011 tokens
- Codex CLI
- 7 tools, ≈11,308 tokens
- Pi
- 4 tools, ≈1,972 tokens
- Cache write
- 1.25× the input price
- Cache read
- 0.1× the input price
- Context window
- 200,000 tokens
Common questions
Does it account for prompt caching?
Yes, and it matters. Tool schemas ride in the system prompt, which is cacheable: the first call of a session writes the cache and costs a quarter more, the ones after read it and cost ten times less. Counting without the cache overstates the bill by roughly three times, so caching is on by default and visible as a switch.
I am on a Max subscription, why would I care?
On a subscription you pay in context window, not money. A harness with three MCP servers takes about 17 percent of the window on every request, and those tokens are gone before you type a word. The heavier the harness, the sooner compaction kicks in.
Where do the harness numbers come from?
From Berkeley's HarnessTax study: 630 attempts per harness, counting declared tools and the tokens of the first main call. API prices are as of 1 September 2026 and should be checked against current ones.
Why set the MCP server weight by hand?
The study did not measure MCP, and servers vary widely: a small one may cost a couple of thousand tokens, a large one such as GitHub several times more. So it is a parameter rather than a constant — put in your own number if you know it more precisely.

