Claude Code Sends 33k Tokens Before Your Prompt - OpenCode Sends 7k

TL;DR
Claude Code sends about 33k tokens before your prompt, OpenCode about 7k. The methodology, cache economics and the HN debate over whether the overhead pays off.
Last updated: October 27, 2026
A benchmarking study from Systima.ai landed on Hacker News today with 330 points and 185 comments. The finding: Claude Code sends approximately 33,000 tokens to Claude Sonnet 4.5 before processing a single character of user input. OpenCode sends roughly 7,000 - a 4.7x difference.
The research sparked a heated discussion about whether Anthropic's coding harness is inefficiently designed or whether the extra context delivers proportionally better results.
The Methodology#
Systima added a logging proxy between their agentic coding tools and Anthropic's API endpoint. They captured all JSON payloads and the returned usage blocks, running tests across three task variants: simple replies, file summarization, and multi-step coding tasks.
Both harnesses were pinned to claude-sonnet-4-5, running through a local gateway called Meridian that bridges Claude Code to standard Anthropic endpoints. The researchers subtracted a 6,200-token constant introduced by their gateway infrastructure.
The Numbers#
Baseline token overhead:
- Claude Code: ~33,000 tokens (system prompt, 27 tools, scaffolding)
- OpenCode: ~7,000 tokens (system prompt, 10 tools, minimal scaffolding)
The gap narrows on Claude Fable 5, dropping to 3.3x instead of 4.7x, but Claude Code still consumes substantially more tokens before user input.
Production multipliers make it worse. In real-world configurations with instruction files and MCP servers, the numbers escalate:
- 72KB instruction files add ~20,000 tokens per request
- Five MCP servers add 5,000-7,000 additional tokens
- Subagent delegation multiplies costs 4.2x (121,000 to 513,000 tokens in their tests)
A production Claude Code setup can reach 75,000-85,000 tokens before any user input. On a 200k-token context window, that's 40%+ consumed by bootstrap alone.
Cache Economics#
The more interesting finding involves caching behavior. OpenCode maintains byte-identical request prefixes across sessions, enabling efficient API caching. Claude Code rewrites cache contents mid-session.
On identical tasks, Claude Code generated up to 54x more cache-write tokens than OpenCode. Since cache writes are billed at a premium, this explains why the researchers noticed their usage dashboard "climbing" significantly faster with Claude Code.
The study notes: "Byte-unstable prefixes (Claude Code) versus stable ones (OpenCode) create measurable cache-economics divergence when sessions resume after TTL expiration."
The Counterintuitive Finding#
Here's where it gets interesting. On multi-step tasks, Claude Code's whole-task cost approached OpenCode's. The reason: Claude Code's aggressive batching of parallel tool calls results in fewer total API requests, which can offset its higher per-request baseline.
Task structure determines final expenditure.
Update (October 27, 2026): Systima's revised write-up says this convergence did not survive a model change. Re-run on Claude Fable 5, Claude Code took six requests instead of three, including an 85,686-token mid-session cache re-write, and landed at roughly 298,000 tokens against OpenCode's 133,000. Systima concludes the batching advantage is model behaviour, not a harness constant. The Fable runs were small samples (two runs for the floor and cache tasks, one for the multi-step task), so read them as directional.
Simple prompts like "Hey" or "commit" can trigger 30+ tool calls in Claude Code. But complex multi-file refactoring might end up costing similarly across both harnesses because Claude Code makes fewer round trips.
What HN Is Saying#
The Hacker News thread generated several distinct response patterns.
Skeptics questioned the methodology. One commenter asked why the researchers used an older model (Sonnet 4.5) and speculated the article might be AI-generated with AI-driven testing. The Systima team responded that they ran through a Claude Max subscription for cost reasons, and pinning to a stable snapshot kept comparisons clean. They offered to rerun on Fable 5 and publish the diff.
Tokenflation concerns emerged as a pattern. Multiple commenters described noticing the same trend across different harnesses. One cited their own testing showing prompts like "Hey" or "commit" triggering 30+ tool calls. Another wrote: "Agents are becoming more aggressive about using tools, even for trivial requests. Tokenflation seems very real."
Pi advocates entered the chat. Several commenters pointed to the Pi agent framework, which sends roughly 1k tokens with its minimal system prompt. One commenter noted their $20/month subscription using GPT 5.6 with thinking disabled "lasts for hours" on Pi. Another estimated their OpenCode system prompt at around 4k tokens with some extras enabled, compared to the 162k JSON payload they captured from Claude Code via mitmproxy.
Build-your-own arguments surfaced. One highly upvoted comment suggested skipping existing harnesses entirely: "If you really want a minimal agent that you heavily customize, just write your own. You learn a bunch, and it's not hard." Others countered that Pi and similar minimal frameworks don't ship with essential tools - you have to add everything yourself.
The incentive alignment question. A commenter noted that Anthropic "wants to produce the best coding agent possible and doesn't care (is even incentivized) about high costs." Others pointed out there's no evidence Claude Code is actually a better agent despite the higher token consumption.
Cache-busting configurations. Technical discussion focused on practices that invalidate caching. One commenter noted that setting the date and current directory on every system prompt call would bust the cache, though day changes and directory changes are infrequent enough to minimize this. Another described using the --dangerously-skip-permissions flag with --lite to reduce token overhead.
The Broader Picture#
This research lands at an interesting moment. The AI coding tool market has bifurcated into two philosophies: comprehensive platforms like Claude Code that bundle orchestration, task management, and extensive tool libraries, versus minimal harnesses like Pi and Hermes that prioritize token efficiency and user customization.
The efficiency argument is straightforward: if 40% of your context window is consumed before you start working, you have less room for actual code context. On a complex refactoring task in a large codebase, that matters.
The capability argument is less clear. Does Claude Code's extra scaffolding - the 27 tools, the background-agent orchestration, the task management systems - produce measurably better outcomes? The Systima research doesn't answer this question directly, and the HN thread split on whether token consumption correlates with output quality.
One practical note from the thread: users running local models through Claude Code found it "very slow" due to the large initial system prompt. The 162k JSON payload makes local inference significantly less practical than with minimal harnesses.
Practical Implications#
If you're cost-sensitive or context-constrained, the research suggests several approaches:
-
Audit your configuration. Run
/contextin Claude Code to see actual token breakdown. Users in the thread reported seeing 23k tokens on fresh sessions, but that can balloon with MCP servers and instruction files. -
Consider minimal alternatives. Pi, OpenCode, and Hermes ship with smaller system prompts. The tradeoff is fewer built-in capabilities.
-
Mind your cache. Byte-stable request prefixes (OpenCode's approach) enable API caching. Configuration changes that modify the prefix invalidate cached context.
-
Task structure matters. Simple prompts may cost more in Claude Code due to aggressive tool calling. Complex multi-step tasks converged in cost on Sonnet 4.5 because of Claude Code's parallel batching, but not on Fable 5 (see the update above).
The debate ultimately reflects a broader tension in tooling philosophy. Comprehensive defaults versus minimal starting points. Neither is objectively correct - it depends on whether you value convenience or control, and whether token costs matter for your use case.
FAQ#
How many tokens does Claude Code send before your prompt?#
In the Systima.ai study, Claude Code sent approximately 33,000 tokens to Claude Sonnet 4.5 before processing any user input, covering its system prompt, 27 tools and scaffolding. OpenCode sent roughly 7,000 tokens with 10 tools, a 4.7x difference. On Claude Fable 5 the gap narrowed to 3.3x.
Is Claude Code more expensive than OpenCode on every task?#
Not always. On one multi-step task with Sonnet 4.5, Claude Code's whole-task cost approached OpenCode's because it batched parallel tool calls into fewer requests, but Systima's Fable 5 re-run did not reproduce that (about 298,000 tokens against 133,000). Simple prompts can cost more in Claude Code, while complex multi-file work may converge in cost.
Why does Claude Code generate more cache-write tokens?#
OpenCode keeps byte-identical request prefixes across sessions, which enables efficient API caching, while Claude Code rewrites cache contents mid-session. On identical tasks Claude Code generated up to 54x more cache-write tokens, and cache writes are billed at a premium.
How can I check Claude Code's token overhead in my own setup?#
Run /context in Claude Code to see the actual token breakdown. Instruction files and MCP servers add to the baseline - the study measured 72KB instruction files adding about 20,000 tokens per request and five MCP servers adding 5,000-7,000 more.
Continue Reading#
- Agent-Manager: A Tmux TUI for Running Claude Code, Codex, and OpenCode Side by Side
- AI Test Generation Tools Compared 2026: Which One Actually Catches Bugs
- Building and Shipping iOS and Mac Apps Without Opening Xcode
- Prime Agent: A Self-Improving Coding Harness Where Everything Is Python
- OpenCode - pricing, model support, and alternatives on one page
- Claude Code - plans, install routes, and alternatives on one page
Sources#
- Systima.ai Research - Original benchmarking study
- Hacker News Discussion - 185 comments as of publication
- Pi Agent System Prompt - Referenced minimal harness
- Systima: The Subagent Tax - Follow-up measuring Claude Code fan-outs at 2.6x to 5.9x the tokens of sequential work
- Quesma Token Cost Analysis - Related research on tool-call overhead
Get the next comparison like this in your inbox
One email a week on News and the rest of the AI dev stack. Free.
Read next on Claude Code
Agent-Manager: A Tmux TUI for Running Claude Code, Codex, and OpenCode Side by Side
Agent-Manager wraps tmux into a Go TUI that groups AI coding agents by project, shows live status for each, and lets you answer blocked agents or review their changes without attaching to their terminal.
7 min readClaude Code Cross-Session Messaging: Your Agents Can Now Talk to Each Other
Claude Code v2.1.224 lets one running session message another over a first-party channel - plain text, permission-aware, with approval dialogs when bypass-mode sessions talk to each other. Here is what ships, how delivery and inbound controls work, and where the feature stops.
7 min readSlack Code vs Claude Code vs Cursor vs OpenCode: When Agents Belong in Chat
Slack Code gives coding agents their own Slack channels with diffs, previews, and an audit log. When it beats Claude Code, Cursor, or OpenCode, and when not.
7 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.








