Back to list
Claude Code vs. OpenCode Token Efficiency Analysis: Why Claude Code Uses 33,000 Tokens Before Your First Prompt
Industry NewsClaude CodeLLM EfficiencyAI Development Tools

Claude Code vs. OpenCode Token Efficiency Analysis: Why Claude Code Uses 33,000 Tokens Before Your First Prompt

A technical comparison between Claude Code and OpenCode reveals a significant disparity in token consumption and cache efficiency. The study found that Claude Code initiates sessions with approximately 33,000 tokens of system prompts, tool schemas, and scaffolding—nearly five times the 7,000 tokens used by OpenCode for identical tasks. While newer models like Claude Fable 5 narrow this gap to a 3.3x multiple, Claude Code remains substantially more "token-hungry." Furthermore, the analysis highlights severe cache inefficiencies in Claude Code, which rewrites up to 54x more cache tokens than OpenCode, leading to higher operational costs. With production configurations and subagents, token usage can balloon from 121,000 to over 513,000, raising critical questions about the overhead of agentic AI frameworks in regulated and high-scale industries.

Hacker News

Key Takeaways

  • Massive Initial Overhead: Claude Code sends roughly 33,000 tokens of system prompt and scaffolding before the user even enters a prompt, compared to just 7,000 for OpenCode.
  • Model-Dependent Scaling: The overhead gap narrows on newer models like Claude Fable 5 (3.3x difference) due to smaller system prompts, but Claude Code remains significantly less efficient.
  • Cache Inefficiency: OpenCode utilizes byte-identical request prefixes for efficient caching, while Claude Code rewrites tens of thousands of tokens mid-session, resulting in up to 54x more cache writes.
  • Configuration Bloat: Real-world setups involving instruction files (AGENTS.md) and MCP servers can push initial request depths to between 75,000 and 85,000 tokens.
  • Subagent Cost Multiplication: Utilizing subagents for small tasks can increase token costs by over 400%, jumping from 121,000 to 513,000 tokens due to bootstrap and transcript overhead.

In-Depth Analysis

The Bootstrap Token Disparity

The fundamental difference between Claude Code and OpenCode lies in their initial "handshake" with the underlying LLM. In a controlled test using the same model and machine, Claude Code demonstrated a high level of "token hunger." For a simple one-line reply task, Claude Code injected approximately 33,000 tokens of system prompts, tool schemas, and scaffolding. In contrast, OpenCode required only 7,000 tokens to achieve the same starting point.

This overhead is somewhat mitigated by the choice of model. When testing shifted from Sonnet 4.5 to Claude Fable 5, the gap between the two harnesses narrowed to a 3.3x multiple. This improvement is attributed to Claude Code sending a much smaller system prompt to newer models. However, even with these optimizations, the baseline consumption of Claude Code remains significantly higher than its counterpart, suggesting a more complex and resource-heavy internal architecture.

Caching Efficiency and Financial Implications

Beyond the initial token count, the way these tools manage prompt caching significantly impacts both performance and cost. OpenCode was found to be highly cache-efficient; its request prefix remained byte-identical across multiple runs. This allows the system to pay for the payload cache once per session and read it back at a fraction of the cost.

Claude Code, conversely, exhibited high cache volatility. It was observed rewriting tens of thousands of prompt-cache tokens mid-session, even when performing the same task repeatedly. Data showed that Claude Code wrote up to 54x more cache tokens than OpenCode. Because cache writes are billed at a premium rate by providers, this inefficiency directly translates to a rapidly climbing usage dashboard for developers. This "mid-session rewriting" behavior suggests that Claude Code’s internal state management is more dynamic—and expensive—than the static approach used by OpenCode.

The Impact of Configuration and Subagents

In production environments, the token overhead of Claude Code is further exacerbated by external configuration files and modular extensions. A standard 72KB instruction file, such as AGENTS.md or CLAUDE.md, adds an average of 20,000 tokens to every single request. Furthermore, the integration of Model Context Protocol (MCP) servers adds another 5,000 to 7,000 tokens for every five servers connected.

By the time a developer is ready to type their first word in a professional setup, the system may already be 75,000 to 85,000 tokens deep. The cost implications become even more pronounced when using subagents. A task that costs 121,000 tokens when handled directly can balloon to 513,000 tokens when fanned out to two subagents. This is because each subagent incurs its own bootstrap cost, and the parent agent must then consume the resulting transcript, creating a compounding effect on total token consumption.

Industry Impact

The findings of this comparison highlight a growing challenge in the AI industry: the hidden costs of "agentic AI." As tools like Claude Code become more sophisticated, the scaffolding required to manage tools, schemas, and subagents is consuming a larger share of the context window and the project budget. For industries operating under strict cost controls or regulated environments, the 54x difference in cache writes and the massive bootstrap overhead of Claude Code may necessitate a shift toward more lightweight alternatives like OpenCode.

Furthermore, this data underscores the importance of model-specific optimization. The fact that Claude Fable 5 receives a smaller system prompt indicates that AI providers are aware of the overhead issues and are attempting to streamline interactions for newer architectures. However, for developers, the choice of harness—and how that harness manages its internal state—remains a primary driver of operational efficiency.

Frequently Asked Questions

Question: Why does Claude Code use so many tokens before the user even types?

Claude Code sends a large amount of "scaffolding" which includes the system prompt, tool schemas, and internal instructions. In a standard setup, this totals about 33,000 tokens, but it can rise to 85,000 tokens when including instruction files (like CLAUDE.md) and MCP servers.

Question: How does Claude Code's caching compare to OpenCode?

Claude Code is significantly less efficient at caching. While OpenCode uses byte-identical prefixes that are easy to cache, Claude Code frequently rewrites cache tokens mid-session. This results in Claude Code writing up to 54x more cache tokens than OpenCode, leading to higher costs since cache writes are billed at a premium.

Question: What is the cost impact of using subagents in Claude Code?

Using subagents significantly increases the total token count. Because each subagent has its own bootstrap cost and the parent agent must process the subagent's transcript, a task that would normally cost 121,000 tokens can increase to 513,000 tokens when using two subagents.

Related News

Harvard Business School Foundry Launches $699 Startup Bootcamp Featuring AI Instructor Avatars for Pitch Feedback
Industry News

Harvard Business School Foundry Launches $699 Startup Bootcamp Featuring AI Instructor Avatars for Pitch Feedback

Harvard Business School's Foundry program has introduced a new startup bootcamp priced at $699, distinguished by the integration of AI avatars modeled after its instructors. These digital counterparts are designed to provide real-time feedback to entrepreneurs during critical practice sessions, specifically focusing on startup pitches and simulated board meetings. By leveraging generative AI technology, the program offers a scalable way for students to interact with faculty expertise in high-stakes scenarios. This initiative represents a significant step in the evolution of executive education, utilizing automated guidance to enhance the learning experience for founders during the essential stages of startup development and corporate governance training.

DeepMind Alumni Startup Inherent Unveils Faraday: An AI Agent Outperforming OpenAI and Anthropic in Research Replication
Industry News

DeepMind Alumni Startup Inherent Unveils Faraday: An AI Agent Outperforming OpenAI and Anthropic in Research Replication

Inherent, a British AI laboratory founded by former DeepMind researchers, has announced the release of Faraday, a specialized AI agent designed to replicate scientific research. According to the startup, Faraday has demonstrated the ability to outperform industry leaders Anthropic and OpenAI in the specific task of research replication. This development marks a significant milestone for the UK-based lab, positioning Faraday as a vital "teammate" for researchers. By focusing on the rigorous process of reproducing scientific findings, Inherent aims to create a foundational tool that facilitates faster innovation and ensures the reliability of AI-driven scientific discovery. The launch highlights a growing trend of specialized AI agents designed to handle complex, high-stakes academic and technical workflows.

Why Local Large Language Models Underperform: An Analysis of Hardware and Software Inference Hazards
Industry News

Why Local Large Language Models Underperform: An Analysis of Hardware and Software Inference Hazards

Local Large Language Model (LLM) users often find that models perform significantly worse than official benchmarks suggest. This discrepancy is not merely a result of quantization but stems from "implementation-specific hazards" during inference. According to technical insights from Level1Techs, the gap between a "reference implementation"—the original lab's environment—and a home lab setup is vast. Key factors include the use of diverse hardware, such as mixed GPU generations, which utilize different instruction sets. These variations lead to differences in how mathematical calculations for token generation are executed. Consequently, even when using identical model weights, the specific hardware and software configuration of a local system can fundamentally alter the model's output and perceived intelligence, making it feel "dumber" than its advertised capabilities.