Top
Best
New

Posted by systima 5 hours ago

Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k(systima.ai)
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.

324 points | 184 commentspage 2
ramoz 2 hours ago|
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.

mft_ 4 hours ago||
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...

mh- 4 hours ago|
This is interesting, because if I start a fresh session of Claude Code right now and run /context, I see the following:

   Opus 4.8 (1M context)
   claude-opus-4-8[1m]
   23k/1m tokens (2%) 

   Estimated usage by category
   System prompt: 3.9k tokens (0.4%)
   System tools: 13.9k tokens (1.4%)
   Custom agents: 235 tokens (0.0%)
   Memory files: 28 tokens (0.0%)
   Skills: 4.9k tokens (0.5%)
   Messages: 8 tokens (0.0%)
   Compact buffer: 3k tokens (0.3%)
   Free space: 974k (97.4%)
4k tokens is 15-20kB. I'd ask you to paste that into a gist, but it might have sensitive data in it, because I suspect what you're seeing is not just the system prompt.
mft_ 3 hours ago||
Apologies, you're right - I used imprecise terminology. The entire initial JSON structure that was sent from Claude Claude to the LLM at the start of a session was 162k. This included the system prompt together with a list of tools (some with very extensive explanations), MCP server details, etc.

I was simply supporting the article's data - their reported 33k tokens is probably roughly 150-165k.

ricardobeat 2 hours ago|||
That’s entirely dependent on how many plugins, MCP tools, agents you have, and if you have pre-filling of all available tools enabled. Best way to avoid unnecessary expense is to avoid it all and use CLI tools instead.
mft_ 1 hour ago||
Agree. It's a fairly minimal list with very few extras added.

Current /context on a fresh session (compare to that above) is:

  Opus 4.8
  15.8k/1m tokens (2%)
  System prompt: 4.5k tokens (0.4%)
  System tools: 7.9k tokens (0.8%)
  Memory files: 441 tokens (0.0%)
  Skills: 3.1k tokens (0.3%)
  Messages: 8 tokens (0.0%)
  Free space: 984.2k (98.4%)
iamflimflam1 2 hours ago||||
A lot of people will just add as many tools as they can think of. I don’t think it’s obvious that this costs money.
mh- 2 hours ago||
A smarter approach (progressive disclosure) for tools has been implemented by (I presume all) the harnesses over recent months, but you're 100% right in any case.

I enable tools specific to each project only in that project, and have very very few in my global config. Like <5k tokens worth.

mh- 2 hours ago|||
Ah that makes sense, wasn't trying to be pedantic. Thanks for clarifying.
roncesvalles 2 hours ago||
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 work and throughput of usable code) becomes very good.
drtournier 4 hours ago||
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.

SwellJoe 2 hours ago||
Why turn thinking off? I mean, yes, it uses less tokens, but you're using the best model OpenAI offers, but then making it as dumb as cheaper models.
systima 4 hours ago||
We are yet to try Pi!
tontinton 4 hours ago||
Mine sends even less - https://maki.sh
tmalsburg2 4 hours ago|
Nice!

> When context gets too long, maki compacts history automatically: strips images, thinking blocks, and summarizes older turns.

Don’t the summaries of older turns effectively invalidate the context cache, such that you consume less tokens but more expensive tokens?

dymk 4 hours ago||
Only once per compaction
ricardobeat 3 hours ago||
> 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 4 hours ago||
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.
estetlinus 4 hours ago|
Well, I have to open the lid on my computer and remember my password, no?
hackingonempty 4 hours ago||
Is it not a conflict of interest for a model provider to supply the harness? They are not motivated to minimize your costs.
robbie-c 3 hours ago|
They sort of are, in that they want subscription users to have clients that behave well with the KV cache etc.

If you don't use a subscription, and pay per token instead, you can easily move to another harness.

anonu 3 hours ago||
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.
clutter55561 2 hours ago|
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.

More comments...