Claude Code sends 33k tokens before reading the prompt; OpenCode sends 7k
TL;DR Highlight
Same model, same tasks: Claude Code sent about 4.7x more baseline tokens than OpenCode.
Who Should Read
A backend developer using coding agents like Claude Code or OpenCode who wants to know why token and cache costs keep climbing
Core Mechanics
- 33k vs 7k on the very first request
- For a one-line reply ("Reply with exactly: OK"), Claude Code sent about 33,000 tokens of system prompt, tool schemas and injected scaffolding.
- OpenCode sent about 7,000 tokens for the same task.
- Both were pinned to claude-sonnet-4-5, with 27 tools for Claude Code and 10 for OpenCode.
- Tool schemas are most of the weight
- About 24,000 of Claude Code's ~33,000 tokens are tool definitions.
- For OpenCode it is about 4,800 of ~6,900.
- With all tools off, the system prompt alone is ~6.5k tokens for Claude Code and ~2.0k for OpenCode.
- Claude Code breaks its cache often
- OpenCode's request prefix was byte-identical in every run, so it wrote cache once and then only read it.
- On the same file-summarise task, Claude Code wrote 53,839 cache tokens and OpenCode wrote 1,003.
- That is up to 54x more cache writes, and writes are billed at 1.25x the input price.
- Config adds more than the baseline
- A 72KB AGENTS.md/CLAUDE.md added about 20,000 tokens to every request.
- Each small MCP server added about 1,000-1,400 tokens per request.
- A real working setup sent 75,000-85,000 tokens on the first request, roughly 12x OpenCode's ~7,000 floor.
- Subagents are the biggest multiplier
- The same task cost 121,000 tokens directly and 513,000 when fanned out to two subagents (4.2x).
- Each subagent re-reads its own system prompt and tools on every turn.
- The parent only ingests each subagent's returned result, not its whole transcript.
- The gap closed on a multi-step task
- On a write-run-test-fix task, Claude Code batched tool calls into 3 requests and ~121,000 tokens.
- OpenCode made one tool call per turn, 9 requests and ~132,000 tokens.
- Re-run on a newer model (Fable 5), Claude Code took 6 requests and ~298,000 tokens versus OpenCode's 133,000.
Community Reactions
- Subagents burned the budget first
- One commenter gave Claude Code a big task and it launched 7 subagents that used up the budget before any finished.
- A retry 5 hours later gave the same result, while a sequential main-agent run was fine.
- The cache makes 33k less scary, some argued
- One commenter said that after the first call the prompt should be a cache hit at 1/10 the price.
- They argued the break-even is quick if the system prompt improves performance or autonomy.
- Is token count the right metric?
- One commenter compared it to contractor A asking $33,000 and contractor B asking $7,000 for the work.
- The author replied in an update that they will add a deeper task, quality comparison, and reproducible inputs and outputs.
- Workarounds and alternatives from users
- One user said --system-prompt "" in Claude Code works around the large prompt.
- Another said switching to Codex cost almost nothing, and another used Pi.
- One commenter recommended the Dynamic Context Pruning plugin for OpenCode to save tokens.
How to Apply
- Measure your harness's first request size
- Within 30 minutes, put mitmproxy or a logging proxy between your harness and the model endpoint.
- Send "Reply with exactly: OK" and record input tokens and cache writes/reads from usage.
- Use an empty workspace so your config doesn't skew the result.
- Check instruction file name and size
- Confirm whether your harness reads AGENTS.md or CLAUDE.md.
- Trim instruction files that are tens of KB, since they add about 20,000 tokens per request.
- Cut MCP servers and tools per task
- Detach MCP servers you don't use, since even small ones add over 1,000 tokens per request.
- For tasks that need no tools, run with tools disabled, e.g. Claude Code's --tools "".
- Use subagents only after measuring cost
- Measure tokens for the same task done directly and fanned out to subagents.
- Use fan-out only when the parallel gain outweighs a roughly 4x token cost.
Try It
# Paste into a Claude Code or OpenCode session (simplified version of the article's measurement, as a prompt)
# Use it to have the agent audit how heavy its current context is
Make a table of the items below. Do not call any new tools; use only what is visible in your current context.
1. Approximate character count of the system prompt
2. Number and names of available tools
3. Connected MCP server names and tool count per server
4. Whether a project instruction file (CLAUDE.md/AGENTS.md) is loaded and its approximate character count
5. Approximate tokens (characters divided by 4.2)
At the end, list up to 3 tools/MCP servers that this task does not need.
Task: {{the task I'm about to do}}Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls