Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k
Source Entity
Hacker News

<a href="https://news.ycombinator.com/item?id=48883275">Comments</a>
The Hidden Cost of Agentic AI: Analyzing Token Overhead in Claude Code and OpenCode
The recent discovery regarding the token usage of AI coding assistants has sparked a significant technical debate within the developer community. Specifically, reports indicate that Claude Code sends approximately 33,000 tokens as a system prompt before it even reads the user's specific request. In stark contrast, OpenCode utilizes a much leaner approach, sending only 7,000 tokens. This disparity highlights a fundamental tension in the development of Large Language Model (LLM) agents: the trade-off between comprehensive instruction sets and computational efficiency.
Understanding the "System Prompt" Bloat
To understand why Claude Code requires such a massive upfront token investment, one must look at the nature of "agentic" workflows. Unlike a simple chatbot, a coding agent must be equipped with a complex set of tools—such as the ability to read files, execute shell commands, and navigate directory structures. These capabilities are not innate to the model but are defined via detailed instructions and API schemas provided in the system prompt. A 33k token prompt likely contains exhaustive guidelines on safety, coding standards, tool-use protocols, and error-handling strategies designed to make the agent autonomous and reliable across diverse environments.
The Efficiency of Minimalist Architectures
OpenCode's significantly lower overhead of 7,000 tokens suggests a more minimalist philosophy. By stripping away excessive instructions or utilizing a more streamlined tool-definition format, OpenCode reduces the initial latency and computational load. For users, this often translates to faster response times and lower costs, especially when using pay-per-token APIs. However, the critical question for developers is whether this efficiency comes at the cost of "steerability" or reliability. A leaner prompt may lead to more frequent hallucinations or a failure to adhere to complex project-specific constraints that a more robust prompt would have prevented.
Impact on the Context Window and Performance
Every token consumed by the system prompt is a token taken away from the available context window. While modern models like Claude 3.5 Sonnet boast massive context windows, 33,000 tokens still represent a non-trivial amount of "real estate." In massive codebases where the agent needs to ingest thousands of lines of existing code to understand a bug, this overhead can accelerate the point at which the model begins to "forget" the earliest parts of the conversation. This creates a ceiling on the complexity of the tasks the agent can handle in a single session without aggressive context management.
The Role of Prompt Caching
It is highly probable that Anthropic relies on Prompt Caching to mitigate the performance hit of a 33k token system prompt. Prompt caching allows the model to "remember" the static part of the prompt (the system instructions) so it does not have to be re-processed from scratch for every subsequent turn in the conversation. This technology effectively nullifies the latency penalty of large prompts after the first interaction. The comparison between Claude Code and OpenCode thus becomes less about raw speed and more about the underlying architectural strategy: one favoring exhaustive guidance backed by caching, the other favoring lean, lightweight execution.
Future Trends in AI Agent Engineering
This comparison signals a broader trend in AI engineering toward "Dynamic Prompting." As agents become more sophisticated, the industry will likely move away from static, monolithic system prompts toward modular systems that inject only the necessary tool definitions based on the user's current intent. Instead of sending 33k tokens every time, a future iteration of these tools might send 2k tokens for a simple query and scale up to 50k tokens only when performing a complex architectural refactor.
Summary
The gap between Claude Code's 33k tokens and OpenCode's 7k tokens underscores two different philosophies of AI agent design. While Claude Code prioritizes a comprehensive, highly-guided agent experience—likely leveraging caching to maintain speed—OpenCode prioritizes lean efficiency. As the ecosystem evolves, the winner will be determined by who can provide the highest level of reliability without suffocating the model's context window.