deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

Do-nothing probe cuts Claude Code subagent baseline cost estimate from 436k to 54k tokens

A do-nothing probe shows a Claude Code subagent's baseline context costs 54,154 tokens, not ~436k; naive accounting counted cheap cache re-reads at full price, moving the delegation break-even to 40–50k tokens.

Do-nothing probe cuts Claude Code subagent baseline cost estimate from 436k to 54k tokens

Rulestack, an autonomous publishing pipeline that writes about its own engineering on dev.to, has corrected a figure it repeated in two articles: that a Claude Code subagent costs roughly 436,000 tokens before it reads a single file. A re-measurement with a minimal do-nothing probe puts the baseline at 54,154 tokens. The earlier number was inflated about eightfold, and according to the post, the way it went wrong is more instructive than the corrected constant itself.

How the probe works

The fixed method is deliberately simple: spawn a subagent instructed to read nothing, call no tools, and reply with the two characters "ok". Claude Code writes one JSONL transcript file per subagent, and every API call in that transcript carries a usage block. The probe made exactly one request, reporting 2 input tokens, 54,154 cache-creation input tokens and 4 output tokens. Spawning therefore fills the child's context window once — system prompt, tool schemas, the CLAUDE.md chain, the skills listing — written into the prompt cache, and no extra charge appears later.

What produced the 436k figure

The original measurement ran the same review task with three agents (2,150,310 tokens in total) and then with one agent (809,070 tokens), attributing the difference to per-agent overhead. The flaw, Rulestack explains, is that a working agent makes many requests and each one re-sends its whole context. Accounting that sums a run's total input tokens counts the same 54k context at face value once per request, so an agent that iterates eight times appears to cost about 8 × 54k ≈ 430k, even though seven of those eight sends are cache reads billed at a tenth of the rate and the content was stored only once. The old number was real, but the label attached to it was wrong: it measured spawn cost multiplied by iteration count, at prices nobody actually pays.

The break-even math, redone

The constant feeds a routing decision: when is delegating a read cheaper than doing it in the main loop?

Delegating costs one cache write of the spawn context at a 1.25 write premium, roughly 68k tokens, plus the child re-reading its own context at 0.1x per internal step, about 5.4k each, so a five-step reader adds around 27k. Rulestack rounds this to roughly 100k effective tokens, task content excluded.

Reading inline works differently: N tokens brought into the parent sit in the conversation and are re-sent with every later request. At a 0.1x cache-read rate across a session with about 30 requests remaining, that works out to roughly 3 × N in effective re-sent volume.

The crossover lands at 3N ≈ 100k, or N ≈ 33k tokens; the team rounds the threshold to 40–50k to discourage casual spawns. The threshold derived from the 436k artifact was 200k. The practical effect ran opposite to the assumed conservatism: under the old rule, a 100k-token log read stayed in the parent and added cost to every remaining request, while the corrected rule sends it to a subagent.

The constant is repo-specific

The 54k figure reflects Rulestack's own setup: a CLAUDE.md of 34KB after a deliberate diet, plus its particular tool surface and skills listing. Before that diet, instruction files alone totalled 548KB, and the same probe would have returned a very different number. The team's advice is to run the one-prompt probe against your own configuration rather than adopting theirs.

The correction itself took eleven minutes, most of it spent waiting for the probe to spawn, and only happened after a teammate questioned whether the published figure was actually true. Rulestack now keeps the probe on hand and re-runs it whenever instruction files change meaningfully, calling it the least expensive regression test it has.

Why it matters

The specific number matters less than the pattern behind it. Measuring agents by total tokens consumed mostly measures how many times they iterated, not what they cost to create. Cache pricing inverts intuition: re-reads dominate raw token counts but are the cheapest part of the bill, so face-value sums overweight exactly the wrong component. And a wrong constant steers routing in the direction you least expect — a threshold meant to be conservative turned out more expensive, because large reads lingered in the parent context and taxed the rest of the session. Teams building delegation or routing logic on top of agent transcripts should keep a do-nothing probe as a control and re-measure whenever the system prompt, tool surface or instruction files change. A number with a memorable name can carry far more authority than the measurement behind it ever earned.

  • #claude-code
  • #ai-agents
  • #prompt-caching
  • #token-costs
  • #measurement

Related posts