HN
Today

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

A new analysis reveals that Claude Code is a token guzzler, consuming tens of thousands of tokens before even processing a user's prompt, vastly outstripping competitors like OpenCode. This detailed breakdown highlights the significant, often hidden, costs and context window impact of agentic AI systems. The Hacker News crowd is keenly interested in the practical and financial implications of these inefficiencies, especially in the context of growing production deployments and regulatory scrutiny.

119
Score
61
Comments
#1
Highest Rank
2h
on Front Page
First Seen
Jul 12, 7:00 PM
Last Seen
Jul 12, 8:00 PM
Rank Over Time
11

The Lowdown

A Systima study uncovers a significant disparity in token consumption between Claude Code and OpenCode, with Claude Code exhibiting much higher baseline token usage and less efficient cache management. This detailed investigation, spurred by anecdotal evidence of rapidly rising usage meters, provides empirical data on the "hidden" costs of agentic AI.

  • Initial Token Overhead: Claude Code sends approximately 33,000 tokens (system prompt, tool schemas, scaffolding) before the user's prompt, while OpenCode sends around 7,000 tokens for the same task.
  • Cache Inefficiency: OpenCode's request prefix is byte-identical, allowing efficient caching. In contrast, Claude Code frequently re-writes tens of thousands of prompt-cache tokens mid-session, leading to 5.9x to 54x more cache writes than OpenCode, which are billed at a premium.
  • Multipliers for Bloat: Factors like 72KB instruction files (adding ~20,000 tokens per request), MCP servers (~1,000-1,400 tokens per server), and framework templates further inflate token counts. Subagents are the biggest multiplier, increasing a task's token cost by over 4x due to each subagent's bootstrap cost and transcript ingestion.
  • Multi-step Task Convergence: For complex, multi-step tasks, Claude Code sometimes converged in total token cost with OpenCode due to aggressive batching of tool calls, despite its higher per-turn baseline.
  • Impact: High token overhead translates directly to increased cost, higher latency, and reduced effective context window, especially critical for real-world production systems.
  • Methodology: The study involved a logging proxy to capture exact JSON payloads and usage blocks, with results verifiable via a tamper-evident audit log, mirroring EU AI Act Article 12 requirements.

The findings underscore the critical need for developers to measure and understand the true token consumption at the API boundary, moving beyond anecdotal observations to data-driven insights for managing costs and performance in AI agent deployments.

The Gossip

Token Tax Tally

Many commenters expressed frustration and suspicion regarding the high token usage, especially from Claude Code and subagents. Users shared experiences of budgets being quickly depleted by subagents or trivial requests triggering excessive tool calls, leading to accusations of 'tokenflation' and providers intentionally increasing costs. There's a strong sentiment that this reflects a financial incentive for LLM providers rather than purely technical necessity.

Harness Hacking & Hands-on Hacks

The discussion included practical advice and alternative solutions for managing token costs. Many users highlighted the benefits of other, leaner harnesses like OpenCode and Pi, or even custom-built agents, often citing significantly lower token counts. Strategies like stripping system prompts, using smaller models for subagents, and employing dynamic context pruning were shared as ways to optimize efficiency and cost, demonstrating a community effort to reclaim control over token consumption.

Critique & Calibration Conundrums

Some commenters critiqued the study's methodology, questioning the use of an older model version and the impact of the author's local LLM gateway on the results. Others debated the underlying motivations of providers, arguing that high token usage for subscription models might be driven by lock-in rather than direct pay-per-token incentives, or that the 'hidden' costs are negligible due to caching.