OpenCode
OPEN-SOURCE AGENTIC CODING
Claude Code
ANTHROPIC’S FRONTIER OFFERING
VS
Claude Code Is Way More Token-Hungry Than OpenCode. We Measured Exactly How Much
We put Claude Code and OpenCode on the same model, the same machine, and the same tasks, then examined everything sent and received.
Subscribe to the Systima blog
Be the first to know when we publish original research or thought pieces on AI and quantum governance. NOTE: To reach out, please "Book a call" instead.
No spam. Unsubscribe at any time.
Claude Code is far hungrier:
When we asked both harnesses for a one-line reply, Claude Code used roughly 33,000 tokens of system prompt, tool schemas, and injected scaffolding before the prompt even arrived. OpenCode used about 7,000.
Claude Code is far more cache inefficient:
OpenCode's request prefix was byte-identical in every run we captured; it paid to cache its payload once per session and read it back for pennies.
Claude Code on the other hand re-wrote tens of thousands of prompt-cache tokens mid-session, run after run, and on the same task wrote up to 54x more cache tokens than OpenCode.
Cache writes of course are billed at a premium, which accounted for the usage dashboard climbing when using Claude Code.
Config further bloats the prompt:
A production repository's 72KB instruction (AGENTS.md or CLAUDE.md) file adds another (avg) 20,000 tokens to every single request. Five modest MCP servers add 5,000 to 7,000 more. By the time a real working setup sends its first request, it is 75,000 to 85,000 tokens deep before the user has typed a word.
Subagents add to the cost:
A small task that cost 121,000 tokens done directly cost 513,000 tokens when fanned out to two subagents. This is because each subagent is its own agent that re-reads its own system prompt and tools on every turn it takes, so a fan-out multiplies the number of full baselines in flight.
Having said that, the parent ingests only each subagent's returned result, not its whole transcript.
We found one result in favour of Claude Code:
On a multi-step task Claude Code's whole-task total came out lower than OpenCode's, because it batches tool calls into fewer requests while OpenCode re-pays its smaller baseline turn after turn. The meter starts higher; how the session unfolds decides who spends more. That advantage held on the first model we tested; re-run on a newer one, the same task took twice the requests and cost roughly 298,000 tokens against OpenCode's 133,000.
Every finding above was cross-checked on a second model family. The pattern held, with one nuance we cover below.
The rest of this post shows how we measured all of this at the API boundary, where the tokens go, and what prompt caching does and does not save you.
Why measure this at all
Every token of harness payload is a token of working context you cannot spend on your task.
If you operate agentic AI in production, particularly under the EU AI Act where Article 12 expects you to log and understand your system's behaviour, "what does my agent actually send" is a question you should be able to answer with data.
Method
We spliced a logging proxy between each harness and the model endpoint.
harness (Claude Code / OpenCode)
→ logging proxy (captures request payloads + response usage)
→ model endpointThe proxy records two things per request. The first is the exact JSON payload the harness emitted, meaning the system blocks, tool schemas, and messages. The second is the usage block the API returned, covering input tokens, cache writes, cache reads, and output tokens.
The payload capture is ground truth for what the harness sends. The usage block is ground truth for what was metered.
We tested under these conditions.
- <strong…
Leave a Reply