Live data from Hacker News

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

systima.ai

191–200 of 433 posts

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

#191
post #78

Earlier quoted context omitted.

> It's easy to add using plugins. Sure, but you have to add almost everything, no? It deliberately only comes with read, write, edit, and bash. My point wasn't that you can't add stuff, but that I'd just rather use an harness that's a bit more full featured from the start. (Pi is a bit like old 3D printing where fettling the printer to work is a central part of the hobby. I'd rather just buy a Prusa.)

I'd like to understand what features you're referring to that are missing from base-install Pi CLI.

The main ones missed immediately were web access/search. Then the to-do list features (it was a nice surprise to try OpenCode and see this working immediately.). There were a couple of other niggles but it was a few months ago. Also, this may not be common, but it seemed to struggle to edit effectively (driven by Qwen 3.6 35b/27b) and often rewrote whole files instead.

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

#193
post #76
post #53

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…

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…

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?

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

#194
post #96

Earlier quoted context omitted.

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.

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%)

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

#195

Earlier quoted context omitted.

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 subsy…

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.

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

#196

Earlier quoted context omitted.

If you really want a minimal agent that you heavily customize, just skip pi (130+ transitive dependencies on the "minimal" pi-coder package) and write your own. You learn a bunch, and it's not hard. You can even ask another LLM to help you get started.

Any tips on how to get started?

I have written a few myself to get an understanding.

To learn yourself:

Realize that these agent are REPL/while loops that maintain a conversation state and then based upon the tagging syntax like uptime for system run time and the agent extracts the tool and then does sub commands.

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

#197
post #185
post #53

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…

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 cl…

Very interesting approach. Thanks for sharing.

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

#198
post #53

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…

Spawning a bunch of agents seems to happen randomly. I almost never want this.

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.

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

#199
post #193
post #76

Earlier quoted context omitted.

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…

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.

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

#200

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.

I thought I read somewhere that according to filings for going public, subscription revenue is tiny… like 5%. Edit: consumer Claude subs are the 5%. I’d bet most all of CC subs lump in under enterprise. - API & Enterprise: 75% to 85% of total revenue. - Business Subscriptions: Roughly 10% to 15%. - Individual Subscriptions: About 5%.

So the incentive to have Claude Code use more tokens should be even stronger then as AI & Enterprise are using consumption based pricing.
Post reply on HN