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.

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.
- 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.
- 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?+
Can I reduce the overhead without switching to OpenCode?+
How does the token overhead affect pricing and latency?+
- 01Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k
- 02Claude Code Sends 4.7x More Tokens Than OpenCode Before Reading Your Prompt
- 03Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k | Hacker News
- 04[BUG] Excessive token usage (~20k–30k tokens) for trivial prompts in Claude Code CLI · Issue #52979 · anthropics/claude-code
- engineering·5 min readUnpacking GPT-5.6 Sol Ultra in Codex: Alias or Advanced Pro Model Integration?
The integration of GPT-5.6 Sol Ultra into OpenAI's Codex sparks debate: is it a simple alias for existing features or a true 'pro model' with advanced capabilities? This matters for developer…
- engineering·3 min readMicrosoft Cancels Claude Code Licenses
Microsoft is canceling Claude Code licenses, shifting developers to GitHub Copilot CLI, in a move driven by financial and strategic considerations
- security·5 min readUnpacking Potential Session and Cache Leakage in LLM Workspace Environments
A recent incident points to potential session and cache leakage in LLM workspaces, raising serious concerns about data isolation and privacy. This post examines the technical implications and how to…
The week’s highest-signal tech and AI stories, synthesized into a five-minute read. One email a week, no spam, unsubscribe anytime.