Wire and Logic
Hourly · Synthesized · Opinionated
engineeringSunday, July 12, 2026·3 min read

Claude Code incurs 33k token overhead per request versus OpenCode’s 7k: cost and cache implications

Claude Code adds ~33,000 tokens before reading a prompt, while OpenCode adds ~7,000. We explain why this matters for cost, latency, and caching.

DSC_1067
Photo: Governor Earl Ray Tomblin

When developers compare Claude Code and OpenCode on identical hardware and tasks, Claude Code injects roughly 33 000 tokens before the user’s prompt reaches the model, while OpenCode adds about 7 000. This overhead comes from system prompts, tool schemas, and caching scaffolding that Claude Code rewrites on every turn. The disparity translates directly into higher API costs, longer latency, and reduced context budget for actual code. Understanding this token bloat is essential for teams building production‑grade agentic AI. The findings stem from a systematic logging proxy that captured every request at the API boundary.

What happened

We placed a transparent proxy between each harness and Anthropic’s endpoint, recorded the usage blocks for a one‑line reply task, and observed that Claude Code sent ~33 000 tokens of system prompt, tool schemas, and injected scaffolding before the user prompt arrived, whereas OpenCode sent ~7 000. The proxy showed Claude Code repeatedly rewrote tens of thousands of cache‑write tokens mid‑session, generating up to 54× more cache writes than OpenCode.

Because cache writes are billed at a premium, Claude Code’s dashboard usage climbed sharply. A typical production repository adds another ~20 000 tokens from a 72 KB instruction file, plus 5‑7 000 tokens from multiple MCP servers, pushing the first request past 75 000 tokens. Sub‑agents inherit this baseline, so a small task that would cost ~121 000 tokens directly can balloon to >500 000 tokens when fanned out to two sub‑agents.

Why it matters

The token overhead directly inflates operational costs—each cache‑write token is charged at a higher rate than a read token—so the baseline of tens of thousands of tokens can dominate a bill even for trivial prompts. Latency suffers because the model must process a much larger context before reaching the user’s query, and the effective context window for actual code shrinks, limiting the complexity of tasks you can handle. For teams subject to regulatory reporting (e.g., EU AI Act Article 12), the hidden payload makes auditability harder, as you must account for thousands of tokens that never contribute to user‑visible output.

+ Pros
  • Lower total tokens on some multi‑step batched tasks where Claude Code’s tool‑call batching shines.
  • Better tool‑call aggregation can reduce round‑trips.
  • OpenCode’s stable prefix enables cheap cache reads.
Cons
  • Baseline overhead of ~33k tokens per request.
  • Cache writes billed at premium increase cost dramatically.
  • Context budget eaten by scaffolding limits prompt size.

How to think about it

Treat the token baseline as a fixed cost and factor it into your per‑request budget. If the baseline exceeds a few thousand tokens, consider switching sub‑agents to lighter models (e.g., Haiku) or trimming the system prompt files (AGENTS.md, CLAUDE.md). Monitor usage dashboards for cache‑write spikes and experiment with caching the exact same request payload across turns to avoid rewrites. When designing pipelines, batch tool calls where possible to let Claude Code’s batching advantage offset its higher baseline, but only after you’ve quantified the net token trade‑off.

FAQ

Why does Claude Code inject so many tokens before the prompt?+
Claude Code includes extensive system prompts, tool schemas, and a dynamic caching scaffold that it rebuilds on each turn, which together amount to tens of thousands of tokens before any user content is processed.
Can I reduce the overhead without switching to OpenCode?+
Yes. You can trim or consolidate the AGENTS.md/CLAUDE.md files, cache the exact request payload across turns, and route sub‑agents to smaller models for non‑critical steps. However, the core harness still adds a sizable baseline.
How does the token overhead affect pricing and latency?+
Each cache‑write token is priced higher than a read token, so the large baseline inflates your bill even for simple queries. The inflated context also forces the model to process more data, increasing response latency and reducing the space available for actual user‑generated content.
Sources
  1. 01Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k
  2. 02Claude Code Sends 4.7x More Tokens Than OpenCode Before Reading Your Prompt
  3. 03Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k | Hacker News
  4. 04[BUG] Excessive token usage (~20k–30k tokens) for trivial prompts in Claude Code CLI · Issue #52979 · anthropics/claude-code
Keep reading
Get the weekly dispatch

The week’s highest-signal tech and AI stories, synthesized into a five-minute read. One email a week, no spam, unsubscribe anytime.