Thursday, August 27, 2026|20°C Partly Cloudy
Next edition scheduled
Your Personal Daily Intelligence
Edition 2026-07-13

TECHNOLOGY

Claude Code and OpenCode Token Overhead Vary in Initial Prompt and Costs

A technical analysis showed that Claude Code consumes roughly 33,000 tokens in its initial system prompt compared to about 7,000 tokens for OpenCode when both are run on the sam...

By Hacker News · 45d ago · Source: Hacker News

Full article

A technical analysis showed that Claude Code consumes roughly 33,000 tokens in its initial system prompt compared to about 7,000 tokens for OpenCode when both are run on the same model and hardware under identical baseline conditions. The study measured request payloads and usage metrics through a proxy that captured the exact JSON sent by each harness and the token counts reported by the API, using a local gateway to isolate baseline costs. Baseline tests (the floor) on Claude Sonnet 4.5 and OpenCode 1.17.18 indicated that Claude’s prompt included 27,344 characters of system instructions and tool schemas, while OpenCode’s prompt was 8,811 characters. When tools were disabled, Claude still required roughly 6,500 tokens versus OpenCode’s 2,000 tokens. A production instruction file of approximately 72 KB added about 20,000 tokens to each request, and five public MCP servers contributed an additional 5,000 to 7,000 tokens depending on the harness. Cache inefficiency emerged as a major cost driver for Claude Code. Its prompt was rewritten multiple times during a session, resulting in up to 54 times more cache write tokens than OpenCode, whose prefix remained byte‑identical across requests. On a multi‑step task that required nine requests, Claude Code’s cumulative metered input reached about 132,000 tokens, while OpenCode’s total was roughly 121,000 tokens, a convergence achieved because Claude batch‑processed tool calls while OpenCode made a separate request per turn. Additional multipliers included subagents, which added 4.2× token usage for Claude Code when two parallel agents were used, and instruction files that increased baseline token counts by over 20,000 tokens per request. Across all multipliers, a real‑world configuration with multiple MCP servers and the instruction file caused Claude Code to send a payload of roughly 75,000 to 85,000 tokens before any user input, compared with 90,000 tokens for OpenCode. The analysis noted that token cost translates to latency and context budget, and that the EU AI Act requires logging of system behavior; the captured audit log provided verifiable evidence of request composition. Quality was not a factor in the measurement, as both harnesses produced correct results on all evaluated tasks, indicating that the token disparity reflects pure cost rather than output quality. Findings suggest that developers using agentic AI should monitor token overhead, especially cache writes, and verify which instruction files and configuration elements are actually loaded to avoid unnecessary expense.

Source transparency

Publisher
Hacker News
Reliability
high
Published
7/13/2026, 10:00:36 AM
Retrieved
7/13/2026, 10:00:36 AM
Relevance
80%
Confidence
85%
Read original at Hacker News

Botwin's Morning Wire publishes the full source article for reading convenience. Please visit the publisher for the original presentation and any updates.