Claude Code vs OpenCode Token Overhead Analysis

Claude Code vs OpenCode Token Overhead Analysis

Claude Code exhibits significantly higher token overhead than OpenCode

Claude Code requires approximately 33,000 tokens of system prompts, tool schemas, and scaffolding before a user prompt is even processed, whereas OpenCode requires roughly 7,000 tokens. This baseline overhead consumes a substantial portion of the model's context window and increases costs, particularly when prompt caching is inefficient or when tasks are fanned out to subagents.

Baseline Token Consumption

In a controlled test where both harnesses were asked for a one-line reply ("OK"), the following overhead was measured:

Component Claude Code OpenCode
System prompt ~6.5k tokens ~2.0k tokens
Tool schemas ~24k tokens ~4.8k tokens
Scaffolding ~2.5k tokens None
Total First-Turn Payload ~32,800 tokens ~6,900 tokens

Claude Code's overhead is primarily driven by a larger set of tool definitions (27 tools versus OpenCode's 10) and a more extensive behavioral doctrine including tone rules and safety guidance. Even when tools are disabled, Claude Code's system prompt remains over three times larger than OpenCode's.

Impact of Configuration Multipliers

Real-world usage adds layers of token consumption that compound the baseline overhead:

Instruction Files

Adding a 72KB instruction file (e.g., CLAUDE.md or AGENTS.md) adds approximately 20,000 tokens to every single request for both harnesses.

MCP Servers

Each small Model Context Protocol (MCP) server adds between 1,000 and 1,400 tokens per request. In a configuration with five servers, this adds roughly 5,000 to 7,000 tokens to the baseline.

Subagents

Delegation to subagents is the most significant token multiplier. Because every subagent requires its own bootstrap prompt and the parent agent must then ingest the subagent's transcript, costs detonate. One test showed a task costing 121,000 tokens when done directly, but 513,000 tokens when fanned out to two subagents—a 4.2x increase.

Performance and Cost Trade-offs

While Claude Code has a higher baseline, it employs a different orchestration strategy that can reduce total tokens on complex, multi-step tasks.

Parallel Batching vs. Serial Execution

In a write-run-test-fix loop, Claude Code batched multiple tool calls into a single round trip, whereas OpenCode performed one tool call per turn. Because the baseline is re-sent or re-read on every request, Claude Code's aggressive batching resulted in fewer total requests (3 vs 10), leading to a convergence in total tokens spent despite the higher per-request cost.

Prompt Caching Efficiency

Prompt caching reduces the cost of repeated prefixes, but its effectiveness depends on prefix stability.

  • OpenCode maintained byte-identical prefixes across requests, resulting in high cache hit rates and minimal cache writes.
  • Claude Code exhibited prefix instability, emitting different request classes (warmup probes, main conversation, subagent calls) and varying its first-message scaffolding. This led to significantly more cache writes—ranging from 5.9x to 54x more than OpenCode—which are billed at a premium.

Community Insights and Counterpoints

Users and developers have noted several qualitative differences in the value proposition of these harnesses:

"Claude Code is not just a harness. It is a different product... If you’re using API, on the other hand, there is absolutely no reason to use Claude Code."

Some users argue that the raw token count is less important than the resulting intelligence and efficiency of the work performed. Others suggest that the high overhead of Claude Code may be a strategic choice by Anthropic to drive users toward subscriptions or increase API revenue.

Additional alternatives mentioned by the community include Pi, which reportedly sends 1,000 tokens or fewer, and Cline, which is preferred by some for its user interface and transparency.

Sources