Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k (systima.ai)

3 points by systima ↗ HN
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.

276 comments

[ 0.69 ms ] story [ 58.0 ms ] thread
> 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?

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.
OpenAI, to their credit, seems to be focusing pretty heavily on token efficiency in GPT 5.5 and beyond.
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.
Moreover, models are becoming more aggressive in their use of tools for simple tasks. E.g., saying "Hey" or "commit" can trigger 30+ tool uses:

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

Tokenflation seems very real. The number of tokens needed for simple things is increasing.

> prompts such as “Hey” or “commit” sometimes triggered 30+ tool calls

I read that this is because it wastes time looking through past conversations and other context to figure one what you might want it to do - a less ambiguous prompt would be better.

Why are you asking the LLM to commit? Can’t you do that yourself?
Why are you asking the LLM to code? Can’t you do that by yourself?
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...

Read through it an I'm curious whether setting the date and cmd on every system prompt call will cause the cache to invalidate.
I get 95% or more cache hit rate with pi and DeepSeek or MiMo so it doesn't invalidate.

But I'll investigate how that works in a session. You got me curious.

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...

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.
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.

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.
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.
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%)
Ah that makes sense, wasn't trying to be pedantic. Thanks for clarifying.
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.

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.
Interesting question - what I learned doing that is that sol ends up injecting its thinking traces as code and shell terminal comments. YMMV, but in my case what I saw was sufficient to use with my routine work in my projects
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.
> --system-prompt ""

Doesn't it need at least a basic system prompt to understand how to call tools?

The flag name is overloaded. It won't affect the tools available, just the other system instructions.
No, tool definitions are provided via some other mechanism.
Yep, have been using this for a long time now. No idea why everyone doesn’t.
Does it have any negative impact? If not, I’m not sure why this wouldn’t be the default behavior. It feels like Anthropic is just putting their foot on the scale to drive up costs or for the enterprise, or push consumers to higher subscription tiers.
Do you start Claude with this option? Or do you send this with every prompt?
yep I pass it to the CLI, I also pass --model
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?
You can't afford the best model. What are your specs and what models + quants have you tried?

Qwen 3.6 35B A3B and Qwen 3.6 27B can both do reliable tool calls on Pi at Q4_K_M using llama.cpp

I'm on a 48 GB M5 Macbook Pro. I use 4-bit quants with a context window of 16-32k. I tried Qwen 3.6 27B, but I can only get around 10 tokens per second, but it's painfully slow, and it often fails during `write_file` tool calls, even with Qwen Code.
Try an 8 bit quant of Qwen 35B, but temper your expectations. Those Qwen 3.6 models are impressive for the size, but you need an order of magnitude more parameters to actually be useful for more than trivial work in my opinion.
> and on-device model combination right now

That would depend entirely on what your device is. This sounds likely not to be an issue with the harness, but the capabilities of the models you've tried.

I experience almost no tool call failure using my nothing-special harness and DSv4 Flash.

I'm looking for something that runs on an M5 Macbook Pro with 48 GB of unified memory.
Pi.dev requires some plugins to work well. Using Qwen3.6-27B/35B locally at Q8, I was quite frustrated with failed tool calls and tried many things.

Ultimately this combo worked:

1. https://pi.dev/packages/pi-tool-guard —- corrects key name synonyms and common structure errors, so tool calls succeed automatically (e.g if the model hallucinates old_str instead of oldText). It also wraps top level oldText/newText in an edits array if the tool didn’t do it.

2. https://pi.dev/packages/@aboutlo/pi-smart-edit - white-space-tolerant edits, as Qwen would sometimes add a fifth space to a four space indent

Hashline edit tools didn’t work well for me at all, they confused the model and it still failed to edit correctly. Also line removals would invalidate the rest of the file requiring re-reads. I tried pi-hashline-edit-pro, though I see it now keeps a database of hashes to help keep them stable across edits. Regardless Qwen kept thinking that the hashline prefixes were part of the source.

I have just re-analysed most common failed tool-calls and adjusted the tool so that it works. I have a manual repair step on failure that programmatically attempts to fix some things. On failure, the harness reports the error, the repaired function, and the result. Overall, seems to work fine. But it's very model-specific. Most commonly the model fails on shell commands where it hallucinates some programs. If it does it often enough, I just promote those to commands in the PATH. Over time, it has happened less.
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.
You're making the opposite argument. Anthropic is incentivized to use less tokens in Claude Code because people are paying a fixed monthly fee for subscriptions.
Not really. The incentive is to make you hooked on the process, so you bring the same process to the workplace, and start paying corporate prices, not individual subscription prices. For that to work Claude Code, prompt, and the rest of the mechanics has to be more or less uniform.
the amount of system prompt wastage going on in orgs is insane. we identified 400k in annual burn for zero value in just one section of our large company.

and the interesting thing about system prompt wastage is its a cost that scales non linearly with subagent use.

The non-linearity is interesting. Is the default behavior for subagents in CC/OpenCode loading the same full system prompt (or AGENTS.md)?
I'm sorry, what! 400k...?
> I use pi btw

Not sure if intentionally meant as a reference, but it gives "I use Arch btw" vibes.

Pi is one of the ways out of this problem (OpenCode another) so I took it as an intentional reference as it is highly relevant. I also use Pi as my daily driver and I think it's a wise choice to figure out how to decouple yourself from lab-specific harnesses that you have little control or observability over.
Once I realized that Anthropic is a token merchant, I start to understand Anthropic’s decision more. They are always finding reasons for you to use more tokens through them unless the users revolt or demand some guardrails.
But they gave us double the tokens! Then a limited time more usage! Then even more tokens "off peak" times! Then some new model released but apparently it inherently used 1.69x tokens! Then Fable is here but "it uses much more usage". But only until ~~the US banned it~~ ~~7th July~~ ~~19th July~~ who even knows.

At this point I think Dario is just in his wellness retreat adjusting a revenue/profit dial.

Ah, the ol' retail switcharoo.

Increase the price by 70% and then cut it by 50%, resulting in a 15% cut that sounds like a major deal.

I bailed on Anthropic the moment they started blocking alternative harnesses like pi on their subscription plans.
If I were anthropic I’d force that too. They offer the harness and if they control the entire pipeline then they can optimize the entire experience. It doesn’t have to be nefarious.
Sounds like they're modeling their PR on the classic Apple playbook: "choice is bad, and you should appreciate the constraints we've generously imposed"
This is kind of a strange comment as it implies a false dichotomy.

Its not 'nefarious' in that its in their best business interests.

But it'd be difficult to take anyone serious who thinks Anthropic's motivation was to improve the UX, and the other effect were by accident. At the time they specifically started blocking based on openclaw prompt text. Its a walled-garden tactic.

A walled garden is nefarious to people who do not want to be inside one.

> if they control the entire pipeline then they can optimize the entire experience

So what? When you care about optimising the entire experience, you offer sane defaults.

When you prevent people from changing the defaults, it's about control, not experience.

> It doesn’t have to be nefarious.

The nefarious part is because it's non optional. They could give you an option and compete by being better, instead you're given the finger as the option is taken from you. Competition is hard and banning people to create more FUD serves business need better.

You've obviously been gaslit so badly you're desperate to find a way to defend a shitty move and pretend it's the only way to increase usability. But you don't have to deny really! You're allowed to admit control is easier for a company than competition, and that they didn't have to, but did because it increases their control of the ecosystem.

If you want to defend someone, good? But at least save it for someone who actually deserves it. They don't; and you insult you and your readers intelligence by trying.

> if they control the entire pipeline then they can optimize the entire experience

The only issue is that Anthropic optimizes the entire experience for their bottom line. User experience and price only suffer becaue of that.

Seems unlikely they'd be this dumb. The way to get us to use more tokens is to make those tokens more useful, not less. Anthropic is full of people (including higher-ups) who know this.
now reealize that LLMs are trained to produce tokens and like the halting problem, cant be trained not to produce tokens and youll realiE the AI labs are the perfect essential capitalist and like cancer, will keep growing useless tokens until it kills its host.

no amount of alignment will stop aomeone drom just shutting up.

LLMs might be trained to produce tokens, but Anthropic don’t have to price by tokens. If an organization is a ‘non-profit’ and they decided to design their pricing to be tokens-based, I get it. If a for-profit design their pricing to be tokens-based, I don’t know where are they drawing the line between profit vs benefit. That doubts makes it hard for me to be a customer. Disclaimer, I still use Claude…
tokens definitely measure compute.
You can ask it to verbatim produce training data and that takes very little compute for a lot of output tokens
i dont think you understand how these models operate.
I've done a couple side by sides on web chat with the same prompt on Opus 4.6, 4.7, and 4.8 and the output gets longer/more verbose on version increment. The enerr variants are definitely much wordier.

On the other hand, the newer variants also tend to benchmark higher so it's not quite a clean argument of "hey the new version eats more tokens"

I think both things can be true: new models benchmark higher and eat more tokens.
From my experience new models are slower and use more tokens even on questions which gpt 4 answered correctly. It is mostly because newer models tend to be more verbose (even with prompt requesting short answers).
Unless somebody improved on the underlying transformer architecture... Surely AI is smart enough to do it by now
I've done a couple side by sides on web chat with the same prompt on local 4b, 14b, 32b open models and the output gets longer/more verbose on version increment.

Its rather frustrating, slower tokens and more tokens.

Serious Willy Wonka energy?
The Agents are more like Double Agents. Purporting to work for you, but with the primary goal of siphoning your wallet to its handler.
> My opinion is that claude code uses more tokens simply because Anthropic makes more money that way and forces people into their subscriptions.

OTOH, this makes typical subscriptions usages consume more tokens, which are included in their flat fee.

This sounds more like incompetence than malice.

It would be true if there was a unified "Anthropic" entity making every decision from pure rationality. Instead, more tokens increase Claude Code team's metrics of token usage, which most likely has a KPI around token usage and adoption.

To remind Goodhart's law: "When a measure becomes a target, it ceases to be a good measure".

..also to parent's point, yes the upsell is only appealing once user run's out of tokens.

> I use pi btw.

When using Pi, one way to significantly reduce input tokens it yields is to ignore common bookkeeping "dot directories", such as `.git`. How to do so can be found with the following interactive Pi prompt:

  How do I configure Pi to ignore git related artifacts, such 
  as the project's .git directory?
Other local assets to consider ignoring are `.pi`, `.agents`, `*.md`, and language specific output directories such as `__pycache__`, `bin`, `obj`, `target`, etc.
Anecdotally at least Claude code uses less api money for me than other harnesses. I think people might be missing some caching discount?
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.

So? it doesnt matter, after the first turn it's cached. We are probably talking about single digit cents.
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?

Mine sends even less - https://maki.sh
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?

Only once per compaction
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.
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.

What settings have you tried since it "became more opaque"? They've got a lot more settings now.
CC went from sane defaults in late 2025 to feature scope creep early 2026. So more features might be good, but sounds like an ick for me. But I have zero prestige, I might switch back.
Are you familiar with "the tyranny of the marginal user"? They have to add more features right now.
They’ve been hiding their thinking tokens more and more, and lately also which tools are being executed when and in which way. It makes it more difficult to assess what it’s doing and jump in to steer it into a different direction in realtime.
I use both now and agree they're basically interchangeable.

I appreciate that Codex is open source and OpenAI has explicitly said using the subscription with other agents is ok. OpenAI has been much more consumer-friendly recently.

And OpenAI didn't try to silently degrade performance of their top model if its (extremely sensitive) safety sensors went off ...
I like Codex for allowing auto_review.policy (basically a prompt to the classifier on what to allow/disallow) to be configured rather than the opaque auto mode in Claude.
6 minutes, 6 months, $6 million, 6 million tokens?
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.

As a counterpoint: in a complex project, Fable's "curiosity" may be exactly what you want for an exploration and planning stage - not just for the orchestrator that turns your prompt into different angles with which to explore, but for each subagent whose task is to search the codebase for one of those "angles." If you truly want no stone unturned, letting those subagents spawn their own discoveries, and recursively grow the surface area of the inquiry, then it's quite reasonable to want Fable throughout.

That said, if your project is "do this well-planned thing on a bunch of things in parallel" then you should absolutely be instructing to have subagents "step down" to less curious models. Their output may well be more cohesive as a result!

The curiosity is inefficient though. So many times I have to stop the agent and tell it to just fucking write the code and try compiling it. Otherwise it will fill its entire context tracing through the program logic to derive from the code itself whether the thing it is about to do would work. It completely fails to notice it can just… try.
It's tuned for the kinds of tasks where "just try" doesn't get good results.

A major complaint with AI code was that AIs struggle with complex codebases, don't respect existing conventions, reinvent functionality multiple times over, etc. So, newer high end AIs are tuned with the "explore/exploit" dial turned towards "explore".

You could probably get it to do things "quick and dirty" with prompting, but that, of course, requires prompting for it.

Perhaps what is missing is a better memory/caching layer to avoid doing the same for explorations over and over again.
I use the human-in-the-loop for managing the context.

Give it only what it needs and do things usually 1 file at a time.

Feels like I'm a sort of manual tape editor, if the context was a tape fed into machine, I assemble that and then watch the machine output the results I need.

That is the usual work of high end programmers, right? Growing codebases as consistent, dependable ontologies?

I feel like most mainstream programming languages do this sort of work for their standard libraries and their official docs. Go and Python come to mind, but plenty others do this reasonably well to the point where one mostly doesn’t need to read the implementation code to effectively use the standard library itself.

I get what you're saying, but these instances are of a different type. It is along the lines of "if I pass None for this parameter, will it default to X or return an error?" and it looks, but finds that the actual logic is distributed across multiple files. And so it quickly falls down that rabbit hole.

All the while, it could have just done a two-line probe test and see what happens when it calls the API with "None" for that parameter. Or just assum it would act as expected and wire in debug logs in case it doesn't.

Everything about LLMs is inefficient. They have their benefits but watching them reason over things that are painfully obvious, that they've literally investigated before (before a memory compaction), never take a step back aand be like 'this is going too slow let me look for a better way', etc. is painful.
It’s got worse though right? Older models from before everyone went off the deep end with CoT don’t do this and just write the code with 1/10 the token usage.

The downside is the code isn’t as good but it is produced a lot faster and more cheaply and often it’s actually fine.

CoT has made LLMs better (say 50% improvement or something) but increases cost by an order of magnitude. That graph is going in the wrong direction and has been for a while now

I think I use it differently. I still mainly stick to web UI.

I write a good prompt, paste the code then copy the output code and place it into my project.

So in the end I hand assemble and I only give it what it needs to know so no extra context wasted.

The human in the loop is of course the secret sauce but this way I am highly efficient, no vibecode and I work really fast too. Everything is audited.

I like it but how much context does it need for a complex program? If you're giving instructions and using its code, I imagine context is being passed back up in an exponential way. If not, and you give it a very thin context every time, how do you manage to prompt it enough?
Avoid making programs very complex. They can grow big and have a lot of features, but stay as simple as possible.

Depends what I want but I can give a completely new context for every generation.

I try to make everything as simple and human readable as possible because I want the audit to go fast.

I think for me I lean towards an audit optimized approach. Everything is still generated but revolves around the human-in-the-loop for review.

That's what the person you replied to is saying. You don't need this model.
Next time it does that expensive scan, run order it to keep or update an index on the codebase. It really helps prevent these expansive scans if you have additional markdown files for LLM navigation.
(comment deleted)
that's why i mostly use it for asynchronous work, the inefficiency is something i can bear with because the subscription costs are dirt cheap. if it's token-based, it wouldn't make financial sense.
I need the full context window to get the work done though.
But how is that better than a single agent searching those "angles" sequentially?

Unless they are orthogonal they most likely require similar context anyway so multiple sub agent is just wasteful.

If the assumption is that they can be searched in parallel and it takes the same amount of tokens as doing it sequentially. What you would gain is a speed up.

I vaguely understand you argument with the context, however is that not solved by sum agents handing their results in to the planner (or a third agent) to run on them again? I'd assume that's what is happening anyway. Let me know if that's wrong

Fable and sub agents are two different things. There are many situations for which Fable is great, but Fable doesn't have to run in a sub agent. You can use it for your main agent and that works fine.

Or are you saying my sub agents burned so many tokens because they were all using Fable, whereas my main agent could do the same job with a lesser model?

I think the commenter (who is not me) is saying to use Fable as the main agent but then use lesser models for your subagents so that you get the advantages of Fable to plan but then the subagents don’t cost as much, and may be more focused because they lack Fable’s thinking modes.
I’ve heard the proper pattern is to have Fable write a software design doc and then tell Opus to follow that doc strictly in implementation and testing.
I hear that too, but I'm much more ad-hoc about what model I use for what. Opus can be good at planning too, and Fable is remarkably good at figuring out obscure complexities in the code.
(comment deleted)
How do I get it to spend fable tokens on “curiosity” then switch to cheaper models? Preferably based on its own judgment of what model is truly needed.

Using VS code if it matters.

Just ask it to. If you want, you can also give it pointers to how to read .claude jsonl/metadata so it keeps track of usage and self-adjusts. It's not perfect, but it's pretty dang good if you just say 'This project is allotted X% of my 5h limit'.
Sub agents each have to read part of your code base again to get enough context for the task. And if they take too long, your orchestrator's context is no longer in cache so you pay full price for that again once the subagents finish

If you do it sequentially you only read those files approximately once, and everything hits the same prefix cache

Yes but one of the key things about subagents is they keep all of their tool calls and exploration out of the parent context.

If you plan on continuing on in the parent, and aren't going to necessarily be touching the systems the other agents are exploring, it can be worth it.

It's useful in certain situations where the parent context may need the "10,000 foot" view of something without going back in there. But subsystem-specific AGENTS.md/CLAUDE.md files are still superior and accomplish the same thing. The problem with those is they can become stale.

They are just making the point that it makes sense that subagents would use more tokens because they have none of the parent's context.
Right, so it’s a trade off between contexts. There are two reasons to use subagents, parallelism and tailoring of context. For the second, there is the “personality” of the subagents as well as how much context is injected from the main agent. Ignoring the personality, you ideally want the injected context to be small and focused on a single task so the subagent doesn’t get distracted. You want the main agent to be orchestrating all the subagents, but not reading all the same files they are reading, otherwise you’ll be paying for the same tokens in multiple contexts. IMO, this is where prompt engineering comes in, to be able to guide the main agent as to where subagents are desired and where not.
That is true of Anthropic's implementation but not inherent in sub-agents in general.
It seems like there could be a useful strategy of writing a plan with a main agent, and then instead of spawning subagents to implement, fork the main context to write each part. Then use one last fork to verify the work. That way you keep reusing the same context without polluting your main context for when you are ready to continue.
I've started doing this by hand in OpenCode and it works pretty well. But there's no UI support for maintaining a tree of related session forks so there's a little bit of manual fussing involved with session naming to keep organized. I also like to end a session with an "AI-friendly terse but detailed summary" (or some equivalent prompt) that I can then dump out to a Markdown file and then the mainline session can still get info back from the branch session. I don't know how much of this is automatable with OpenCode plugins, or in another hackable harness like Pi.
> 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.

Probably because the general purpose subagents inherit the parent model.

I tell Claude explicitly to use Explore subagents, which use Haiku only, now.

They changed it with the release on July 1 Explore now inherits the model, it isn't always haiku.

https://code.claude.com/docs/en/changelog#2-1-198

> The built-in Explore agent now inherits the main session’s model (capped at opus) instead of running on haiku

This is why I happily use Codex.

I run it basically 24/7 on a ~500k line repo, and only rarely run out of quota before the end of the week.

My experience with Claude Code was very good until about 2.5 months ago, and then it suddenly turned unbelievably terrible for me.

I have not and will hopefully never look back.

I still have PTSD from how ungodly terrible it was that last week of using it.

> I still have PTSD from how ungodly terrible it was

Please, for the sake of everyone suffering from actual PTSD: Don't. It's hard enough already for victims to communicate what difficulties they are facing without people watering down terminology like that.

They have Coder PTSD or CPTSD.... Is that a better acronym???

Sorry just teasing.

Please don't act as the hyperbole police. People exaggerate all the time (I'm starving, etc). It's normal, and you are being a jerk to call them out.
I am asking them to reconsider and reflect on what that kind of language use does. You're the one reading it as "calling them out".

How else are we supposed to learn from each other, voice our opinions, point out our mistakes to each other? For me, this is communication. And currently 8 upvotes seem to agree with me and my request. Feel free to ignore it, or consider it, for your own use of language. But, sorry, to me, you're the one acting like a jerk and trying to "police", not me.

PTSD sucks on its own. Trying to blame other people for its symptoms is a deflection. It would be like someone with ADHD blaming his inability to concentrate on everyone else in the room making noise or moving around. People with OCD tried this, acting like it's a Monopoly property that you have to pay rent for if you land on it / say its name.

If anything, it's a net positive people are talking about mental health and recognize different ailments such as OCD, PTSD, and others.

I agree with what you say? I think you're reading something into my writing that I didn't mean to imply. A headache is not a migraine is not cluster headache. We have vocabulary so we can express ourselves, and attempt to communicate. I am inviting people to consider their use of language. If you find that offensive, so be it.
I agree with you that it's a low effort, repetitive drone when people say "that cable job irritates my OCD" or "I still have PTSD from dealing with that annoying person". I don't like hearing it because it makes me think that person is a parrot that repeats common phrases instead of developing their own voice. So at least we agree partially.

I disagree that it's insensitive to those or have the illness. If it hurts you when people use PTSD as a literary special effect, I invite you to articulate why exactly it makes you feel (however it makes you feel - I don't want to put words in your mouth). I get the sense that some people take offense the same way a religious fundamentalist doesn't want to hear their Prophet or Messiah used disrespectfully. The source of the anger is built on faith and dogma.

Have you ever said "I'm starving"? Do you think that undermines the experience of people actually starving in war or famine?
This has been my experience as well. Something happened 2-3 months ago with Claude Code. It got slower, starting spinning and getting stuck more and more. I gave codex another shot out of my Claude frustrations, and have never looked back again.

Just tried Claude Code yesterday, and nope, it's the same old bad.

Spawning a bunch of agents seems to happen randomly. I almost never want this.
I think there's some setting to restrict the number of them, or maybe turn them off. Doesn't happen for me ~ever and it's not my $$ (work) so I haven't really looked at it much.
In my CLAUDE.md I put:

> CRITICAL: Do NOT spawn sub-agents for any reason. Perform all work in the main session. If a task is too large, ask me to break it down manually.

> This is a big task, and can easily get too large. However, sub-agents make the situation worse, and eat through our token budget way too fast. Do not use them.

> Take on manageable tasks. Don't try to do everything at once. When you start on a big task, break it down into smaller tasks, and make sure you finish each task before starting on the next one.

Or actually Claude put it there for me. Maybe it's a bit much, but it seems to work.

If there's some "find the file" task, using full context for that isn't ideal.
Subagents with a fat tailed latency distribution completely masks the trough filling that puts the most downwards pressure on per-token COGS.

This is why the subscription plans are forced through the harness (the "OpenClaw Wars"): it creates a false equivalence in the minds of many customers between API tokens (latency sensitive, easy to measure) and Claude Code tokens (remnant backfill to stay to the right of the roofline, marginal cost often zero).

Selling sausage as sirloin is a great business if people go for it. And there's nothing inherently wrong with spot pricing, as long as you're honest about it...

It's in the best interest for AI companies to gobble up tokens. I feel like every new release - Fable, etc - is just a way to extract more tokens/money.
Of course it is. How could it be anything different? Clearly, that’s how these companies make money.
it's a very handwavey way to "explain" anything. Yes, they make money. But they have competition. And if someone runs out of tokens and switches to deepseek or just goes for a friggin hike in the woods, that does not benefit them. If they get a public image of a ripoff that burns all shit on trivial tasks, that does not do them good either. So there is a limit to this "companies make money" thing.
Sure, fair enough. Clearly, if they increase costs by too much, people will go to their competitors, but those competitors also make money selling tokens, so the whole industry is incentivized to inflate token consumption up to the point of driving people to the competition. And nobody is incentivized to reduce token count.
Any AI service that people (and to some extent companies) can afford to pay for today is being heavily subsidized. Will that last forever? I really don't know how those economics work, but I know that bubbles do burst having lived through the dot com burst in 2000. And I know this current one is going to hurt if/when it bursts.
On the issue of the bubble, I’m right there with you, 100%. I’m not sure that “subsidized” is the right word for Anthropic’s or OpenAI’s pricing, though. I’d say it’s forward-priced. Supposedly, they have claimed that inference by itself is profitable; it’s the ongoing training that is not. I don’t know what nuances apply to that, however.
(If) something like the current LLM/agent paradigm remains in a few years, and companies settle down into their respective niches, I imagine more user-friendly tools will be built, with more control over subagent spawning, context, caching, etc.

What's happening this year, with secrecy and all, is saddening, but expected.

For a while everyone was saying sub agents is how you save tokens, use lower quality models with limited context to do simple parts of the job after a smart planning agent has put it all in place. Is that no longer true or is this just the result of sub agent being used at the wrong time?
No, you can definitely configure low cost search and apply subagents. CC and Codex do not. Not sure if this is to improve the reliability of their subagents, or just a play to increase user consumption.
Well, Anthropic and OpenAI make money selling tokens, so…
It’s funny too because I’ll ask fairly simple things and it’s fine, similarly simple question might spin up a bunch of sub agents and I don’t know why….

I feel like maybe it could have asked for clarification or something rather than go and try to calculate all the digits of pi all of a sudden.

They did recently change it so the default explorer agent inherits the session agent (capped at Opus). Before Explore was always haiku. I had Claude write a skill that extracts the built in Explorer agent skill, and then writes an identical Explore agent that uses Haiku
Same for me. I never use them. I use Fable on highest effort to plan things and then record the plan in tickets. I use Kata, which is CLI and agent oriented, but I suppose Jira or other systems would work too. I tell it to put enough context in each ticket to on-board a fresh coding agent to implement it. Then I just do /goal, telling to to run `kata ready` to get new tickets to work and continue until they're all closed according to acceptance criteria or until they're blocked on actions from me. I need to play around with getting it to switch to smaller models (or spawning 1 subagent) to do ticket implementation and then auto compact after each. Either way, it results in really easy workflows and uses very few tokens compared to the built in subagent flows that doing this completely avoids.
Very interesting approach. Thanks for sharing.
I had learnt that trick, so now I explicitly disallow Fable subagents.

Yesterday, I wanted to review a complex piece after a large refactoring, and requested a review plan beforehand. The first step was 8 agents + one more to verify the findings (all Fable). Looks good, approved.

The verification step turned into an attempt to throw a party with 41 Fable verifiers.

It will find a way.

I just instructed Fable to use cheaper agents. Fable subagents is a good way to kill your usage.

Part of my prompt:

---

Start of your prompts...

If a dynamic workflow is used, set its subagents to Opus 4.8 — do not inherit Fable 5. This applies only to dynamic-workflow subagents; leave ordinary subagents (Plan, Explore, etc.) on their defaults or current configuration.

... rest of your prompts.

Probably both. The default subagent orchestration is designed for infinite pockets.

Maybe when they realize there is need to change this they come up with a more configurable interface for us mere mortals who can't afford to gamble their house on a pay as you go subscription.

lol I asked fable to help me estimate my TAM and it launched 102 agents and blew my $120 quota in 6 minutes. I do realize I can limit the agent count , hah
There is a negative incentive to fix problems that result in customers picking a more expensive plan to work around it. There are probably several engineers who have ideas about fixing this and they get apathy from many people and obstruction from a few, and sometimes active hostility by a manager somewhere in the chain.

The best you can do in such an environment is seek to introduce new features at the top tier, and then pull old features down the stack as the cost of those features has been amortized out, or to hurt your competitors by raising the ladder.

I’ve had similar experiences. I now have an explicit line in AGENTS.md to not use subagents unless explicitly requested. It also helps that for the tasks that are big enough to benefit from subagents are also the ones with high chances of going off-rails and/or a poor review phase. I’d rather do the orchestrator role and that way I can split up the review phase in a much more manageable chunk.
Yesterday I gave Claude Fable a difficult task. It then proceeded to spawn 415 agents. It got it done, but damn was it expensive.
(comment deleted)
They optimized it to burn more token in the recent months I feel. I made a small ~100 line change to a codebase by hand and threw claude at it to review. It spawned several sub-agents and burnt a ton of tokens. I guess the word 'review' now triggers some sort of in-built skill or something. It's absurd how rapid enshittification is taking over.
Indeed it feels like I do the same work, ask the same questions, get the same result.

But somehow the cost has doubled in the last few months.

True. For Claude Code, I disabled explore subagents globally by adding this to ~/.claude/settings.json:

  "permissions": {
    "deny": [
      "Task(Explore)"
    ]
  }
Is Explore the only thing subagents are ever used for?
Subagents are quite inefficient and the lossy context transfer between them does lead to more cost and more waiting. However I have found it to produce more reliable output, whether that is worth it for a given task has been a consideration.
I like to use subagents a lot, but I find them to be most useful when explicitly specified. E.g. "assign these tasks to 2 Sonnet, 2 Opus and 1 Fable subagent". Helps keep allocation consumption under control.
Not only a Claude Code issue. Started using OMP with GPT 5.6, and gave up, but it loves to use subagents, and it's basically unusable subagents with GPT 5.6 Sol there with Plus limits.
i have globally disabled subagents for claude. otherwise one prompt ended my Pro account
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.
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.

GLM isn't good enough yet.

It pays to be marginally ahead of people stuck on open models.

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.

Thanks, I'm looking forward to this!

I wonder if a lot of the 33k is context, like from recent conversations.

If cost were the only factor of course you'd use B, but presumably you also care about quality quite a bit.
This isn't accurate since the main reason I'm using Claude Code instead of these other interesting sounding harnesses is the subscription service with highly discounted token usage. With OpenCode, you're paying the full price.

Therefore, you should include the actual costs associated with the task in API token usage or subscription level. Is there a reasonable way to do apples to apples cost comparison?

We are using Claude Max with OpenCode. See the post for details.
(comment deleted)
Is it not a conflict of interest for a model provider to supply the harness? They are not motivated to minimize your costs.
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.