Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k

349 points - today at 6:25 PM


This started based off of a hunch. We usually use OpenCode, but were 'forced' to use Claude Code for a while due to issues with Meridian. In that time, we saw the usage meter rise much, much more quickly than when using OpenCode.

This was the initial anecdotal evidence, but we undertook this small study to collect empirical data:

We added logging between the agentic coding tool (Claude Code and OpenCode) and Anthropic's endpoint, and captured all requests (and the returned usage blocks).

With one caveat (toward the end of the post) we found unambiguously that Claude Code was far more inefficient in terms of its cache strategy and its harness token usage than OpenCode.

Source

Comments

mcv today at 7:24 PM
What really burns tokens is sub agents. I once gave Claude Code a pretty big task, and it immediately launched 7 sub agents which burned through my budget before even one of them was finished. Tried again 5 hours later: same result.

If I let the main agent do the same task sequentially, it was no problem at all. I don't know if it's really just communication and orchestration that makes sub agents so inefficient, or if Anthropic figured that most people using sub agents pay per token on a big corporate account, so this is an easy way to make more money from tokenmaxxers.

korrectional today at 7:09 PM
My opinion is that claude code uses more tokens simply because Anthropic makes more money that way and forces people into their subscriptions. This is supported by the fact that they won't let you use your sub on a different coding agent. I use pi btw.
cbility today at 10:19 PM
I recently started using cline instead of opencode and prefer the interface. I'm interested if anyone here here has any arguments for opencode or codex over cline?
systima today at 7:41 PM
UPDATE:

After reading PUSH_AX's valid comment: ``` This is like saying contractor (A) asked for $33,000 to undertake the work and contractor (B) asked for $7,000 Are we measuring and caring about the right thing? ``` We will update the post to include:

1) A more in-depth task. 2) Qualitative results comparison. 3) As soon as possible, a reproduction of the inputs and outputs.

jakozaur today at 6:55 PM
This isn’t limited to large system prompts. Coding-agent harnesses are also becoming more aggressive about using tools, even for trivial requests. In our tests, prompts such as “Hey” or “commit” sometimes triggered 30+ tool calls:

https://quesma.com/blog/the-true-cost-of-saying-hi-to-an-ai-...

Tokenflation seems very real: the number of tokens consumed by simple tasks keeps increasing.

estetlinus today at 7:20 PM
Recently switched to Codex after 6m in Claude. Codex seems more open, it’s easier to follow what the model is doing and the approvals have a better UX. Overall, it just feels more transparent. Cost of switching was close to 0.

I don’t like that Claude became more opaque around February, including the system prompts. 33k feels way too much.

bel8 today at 6:55 PM
And pi agent is even less.

The entire agent system prompt can be seen here:

https://github.com/earendil-works/pi/blob/main/packages%2Fco...

ramoz today at 8:56 PM
A harness is a part of the intelligence stack. It's no longer about raw access to the model

Also, I have seriously used most harnesses - One feels like it's being built in a place that truly understands AI and where agentic engineering is headed. You might not like it, but peak performance exists in CC when it comes to orchestration of bulk parallel work / subagents. The open source agents are catching up or accell in different way (Im preferable to pi.dev), but I'm not sure they're architecting orchestration the right why.

alex7o today at 7:00 PM
I am forced to use cloude code at work but a good solution is to just use --system-prompt "" and be done with it. I wish they allowed for other harnesses.
eigenblake today at 9:35 PM
We should discuss cache performance if we haven't already. That 33k tokens may be a cache hit (I am not certain it's automatically a cache hit) but after the first call, it should certainly be a cache hit. Cache hit tokens are billed at 1/10th the price of cache misses. This is quite opaque, but it's necessary when you're asking "is the system prompt worth its stay" if you can save 33k tokens worth of dynamic discovery across the next few turns, the break-even point is quick and if the system prompt makes task performance increase and/or makes the system more autonomous so that it can string together more cache hits in a row, it becomes way way better. On a personal note, I think of things as aa function of 'supervised time to desired result' and 'cost'. because I find it harder to reason about tokens. I do think they could introduce a "minimal" mode (something like this is probably doable with the Claude agent SDK today)
arjie today at 9:28 PM
I'm surprised most of that isn't cached token usage. It's true that increasing length is a problem on its own because the model needs to attend to it all, but with caching it should be pretty fast anyway. My system prompt is quite large and I haven't noticed much of a generation penalty in the range from 5k to 10k.
mft_ today at 6:57 PM
Early on in experimenting with local models, I found that hooking them up to Claude Code worked very well, but it was also really slow.

I used mitmproxy (setup assisted by Claude, natch) to capture Claude Code's entire initial system prompt and the whole thing was (I just double-checked) 162k of JSON.

This led me to start experimenting with Pi, OpenCode, and Hermes...

temp7000 today at 9:56 PM
But Claude Code in my experience results in more tool calling for smart efficient file reading. Meanwhile Opencode pulled an entire 500kb file (GPU assembly dump) at once. Kilo is better than both, as it uses indexing.
drtournier today at 6:57 PM
pi sends 1k (or less) -> https://github.com/earendil-works/pi/blob/main/packages/codi...

My $20 sub using gpt 5.6 sol thinking-off lasts for hours using pi.

tontinton today at 7:16 PM
Mine sends even less - https://maki.sh
roncesvalles today at 9:28 PM
I still think the best way to build software using LLMs is to copy-paste snippets/files into the chat and manually guide the work. Humans are still the best orchestrators. Yes the human has to now be hyper-focused and juggle various workflows, but the end result (quality of product and throughput) becomes very good.
ricardobeat today at 8:46 PM
> based off of a hunch

This is posed as some sort of discovery, but both Claude Code and OpenCode display token usage clearly after starting a chat or agent, and 30k and 7k is exactly what you see.

luciana1u today at 7:16 PM
Claude Code sending 33k tokens before reading the prompt is the AI equivalent of a consultant who bills you for the time spent reading your email before they even open it.
hackingonempty today at 7:43 PM
Is it not a conflict of interest for a model provider to supply the harness? They are not motivated to minimize your costs.
PUSH_AX today at 7:15 PM
This is like saying contractor (A) asked for $33,000 to undertake the work and contractor (B) asked for $7,000

Are we measuring and caring about the right thing?

anonu today at 8:29 PM
This is all heading in the right direction. Much of AI coding feels magical. But when the costs begin to accrue we start asking questions. We dig into it and try to understand what's going on. I can't help but feel Anthropic is "token maxing" from its side: it controls the levers and with every version upgrade it can build in its own token growth almost unbeknownst to the user. This actually harms it on the long run because it necessitates a cheaper option.
syntaxing today at 7:50 PM
The reasoning built into the models matter so much too. I recently swapped my Qwen3.6 27B to ThinkingLabs’ fine tune and it does what it publishes. I cut my token usage in half, which is a big deal since I only get ~20 TPS for token generation.
clutter55561 today at 8:58 PM
Claude Code is not just a harness. It is a different product. You pick the smallest subscription that allows you to do your work. My “multiplier” on a $100 subscription is 5+.

If you’re using API, on the other hand, there is absolutely no reason to use Claude Code, or Codex.

stuaxo today at 9:14 PM
Why don't we have some equivalent of "fork" if we are talking the same context and tokens, you'd think that could all just be loaded into the gpu.
andai today at 7:11 PM
With Fable being per token instead of on the subs (unless they changed it again?), I decided to test Claude code on OpenRouter where I had some credits, with Opus 4.8 and Fable 5.

I asked both a trivial question (summarize last commit). Opus cost 50 cents, Fable about $1.

That checks out because Fable's twice as much in the API (though I think its emphasis on correctness makes the difference larger for bigger tasks).

But, at $1 per question, I think I will stick to the subscription for now! I was certainly glad GPT-5.6-Sol is included in OpenAI's subscription, and I'm curious if they'll be able to do the same for GPT-6.

All the VC money appears to have run out a few weeks ago.

docheinestages today at 7:06 PM
I've been trying various harnesses like Pi, OpenCode, Qwen Code, and Nanocoder. A common problem I keep running into is failed tool calls, regardless of the model. What is the best harness and on-device model combination right now?
alansaber today at 9:09 PM
Nothing about the time taken to complete the task? Users are definitely sensitive to time, not only token consumption.
cesarvarela today at 8:45 PM
I think this doesn't mean much; the axes that matter are intelligence x dollars x time; tokens by themselves mean nothing.
skeledrew today at 7:25 PM
I feel like this article isn't saying much. Even with tools disabled, Claude Code still has a crap load of commands and other things that Claude (the model) should know the availability of since it's optimized for them. All of that has to be disabled if this is to be a real harness comparison. And of course the system prompt can be completely replaced, making it a no-brainer to use a more minimal prompt similar to OpenCode. And beyond that nothing else really matters because the rest (cache behavior, etc) lies with the provider's platform, not the harness.
gslin today at 7:58 PM
Cider9986 today at 8:01 PM
Grok 4.5 is really fast, has more usage at $10/month than $20/month Claude pro, and Opus-level. Claude pro feels like a demo.

Claude is much better in OpenCode then in Claude Code, OpenCode is just better than Claude Code. Claude Code feels like a complete mess to use comparatively.

himanshumehra today at 7:43 PM
that makes sense, claude code actually does inflates token usage
deleted today at 7:42 PM
token_roast today at 7:34 PM
Why don't people fix their costs (rent a gpu) and just write their own harness (about 200 lines of code).

Supposed to be hacker news and half the posts are like "this harness steals this" like it cant be avoided.

These API costs are mad.

bigyabai today at 6:56 PM
I recommend that Opencode users try Dynamic Context Pruning as well: https://github.com/Opencode-DCP/opencode-dynamic-context-pru...

It works great for long-horizon tasks, and feels like it saves a boatload of tokens.

piokoch today at 6:55 PM
No surprise, I've noticed that "agents", not only CC (I am using Copilot) are trying to be "clever", searching for a lot of data. This is good for LLM providers as this eats a lot of tokens.
kotberg today at 9:39 PM
FUCK U AI DORKS
MariusGjerd today at 8:58 PM
not even surprised
rvba today at 8:17 PM
Sorry for asking here, but nobody seems to know.

If I self host a local model is there some way to make Android studio not time out after 10 minutes?

deleted today at 9:51 PM
slopinthebag today at 6:55 PM
Anthropic wants to produce the best coding agent possible and doesn’t care (is even incentivized) about high costs. Other harnesses have to make trade offs between performance and cost.
nubg today at 7:13 PM
So? it doesnt matter, after the first turn it's cached. We are probably talking about single digit cents.
yojo today at 8:39 PM
[dead]
gokselu today at 7:41 PM
[flagged]
siddhxrth today at 7:07 PM
[flagged]
MallocVoidstar today at 6:54 PM
> Claude Code 2.1.207 and OpenCode 1.17.18, both pinned to claude-sonnet-4-5

So not only is this article AI-written, but the testing was entirely done by AI, too? I can't see any other reason to use such an old model.

> Our traffic passes through a local LLM gateway that wraps requests in its own envelope, a constant we measured at roughly 6,200 tokens with bare calibration requests

Why do you need to do calibration requests to figure out how your own gateway is affecting requests?

> Its subagent lane did not complete cleanly through our gateway

> We attempted to toggle extended thinking in both harnesses and are declining to publish numbers. Our gateway applies its own thinking policy, neither harness's toggle demonstrably survived the path, and anything we quoted would be noise.

Why is your own gateway screwing with your testing?