← Hacker News

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

Hacker News · systima · July 12, 2026
A comparative study of Claude Code and OpenCode found Claude Code to be significantly more inefficient in cache strategy and token usage. The research involved logging requests and usage data between the agentic coding tools and Anthropic's endpoint. Claude Code's usage meter rose much more quickly than OpenCode's during regular use.

Detailed Analysis

A comparative study of coding agents has surfaced a notable efficiency gap between Anthropic's own Claude Code tool and the third-party alternative OpenCode, both of which route requests through Anthropic's API. The researchers, who initially relied on anecdotal observation while temporarily switching from OpenCode to Claude Code due to unrelated issues with a tool called Meridian, noticed that Claude Code's usage meter climbed noticeably faster. To validate this hunch, they instrumented logging between each agentic coding tool and Anthropic's endpoint, capturing full request payloads and the usage metadata returned by the API. The headline finding: Claude Code sent approximately 33,000 tokens before even processing the user's prompt, compared to roughly 7,000 tokens for OpenCode performing equivalent work—a nearly 5x difference in overhead alone.

The core issue identified is inefficient prompt caching and bloated "harness" token usage—the scaffolding of system prompts, tool definitions, context-loading instructions, and boilerplate that agentic tools inject before a user's actual query reaches the model. Every additional token in this harness costs money and latency, and poor cache utilization compounds the problem: if a tool fails to properly reuse cached context across turns, it ends up resending large chunks of static instructional content on every request rather than leveraging Anthropic's prompt caching feature, which offers substantial discounts for repeated context. For a company like Anthropic that both builds Claude Code and sells the underlying API tokens that power it, this creates an awkward optics problem—critics could reasonably ask whether the first-party tool is optimized more for feature completeness and metered usage than for token efficiency, especially when a leaner, community-built competitor accomplishes similar outcomes at a fraction of the overhead.

This matters because token efficiency has become a central battleground in the rapidly growing category of AI coding assistants. As developers increasingly rely on agentic tools like Claude Code, Cursor, Aider, GitHub Copilot Workspace, and OpenCode to autonomously write, debug, and refactor code across entire codebases, the cumulative token cost of these tools—not just for the "thinking" but for the plumbing around it—directly affects usability, especially for teams on metered API plans or those hitting rate limits. A tool that silently burns 33k tokens of overhead per interaction can meaningfully erode the value proposition of subscription tiers like Claude Pro or Max, and it raises questions about how transparently vendors disclose the true cost of their harnesses versus the model inference itself.

More broadly, this finding fits into a growing pattern of independent scrutiny applied to AI vendors' own tooling, mirroring earlier community-driven investigations into system prompt leaks, context window bloat, and hidden instruction injection across various LLM products. As the agentic AI space matures, efficiency—not just capability—is emerging as a key differentiator, and open-source or community-maintained tools like OpenCode may increasingly compete on lean, transparent engineering rather than deep platform integration. The episode also underscores a structural tension for Anthropic: incentives around Claude Code's design may not be perfectly aligned with minimizing customer token spend, since the company profits from both the tool and the tokens it consumes, a dynamic likely to invite continued third-party auditing as agentic coding tools proliferate and usage-based pricing remains the dominant commercial model.

Read original article →