Why token overhead matters for enterprises

Token consumption is a direct line‑item on any LLM bill. Every token the harness sends reduces the context window available for actual code and incurs input or cache‑write charges. In regulated environments—especially under the EU AI Act’s logging mandates—knowing the exact payload is a compliance requirement, not a curiosity [1].

Baseline measurement

Systima logged every request from Claude Code 2.1.207 and OpenCode 1.17.18 to the same claude-sonnet-4-5 model on identical hardware. When the prompt was a simple “OK”, Claude Code transmitted roughly 33,000 tokens of system prompts, tool schemas, and scaffolding, whereas OpenCode sent ≈7,000 tokens [1]. Tool definitions dominate the payload: Claude Code’s 27 tools generate ~24k tokens, OpenCode’s ten tools ~4.8k tokens.

Cost and latency implications

Input tokens are billed at the model’s base rate, but cache writes—required when a new prefix is sent—carry a premium (1.25× for a 5‑minute TTL). Claude Code rewrote its prefix mid‑session up to 54× more cache tokens than OpenCode, inflating the bill each time the cache expired or changed [1]. In a multi‑step write‑run‑test‑fix loop, Claude Code needed three requests (batching tool calls) versus OpenCode’s nine. The larger baseline meant Claude Code’s total input tokens (~121k) approached OpenCode’s (~132k), showing that aggressive batching can offset a higher floor, but only for carefully shaped workloads.

Configuration multipliers

Real‑world setups add several layers:

  • Instruction file – a 72 KB AGENTS.md added ~20k tokens to every request for both harnesses, turning a 7k baseline into ~90k tokens for OpenCode and a 33k baseline into ~59k for Claude Code [1].
  • MCP servers – each public server contributed 1‑1.4k tokens per request; five servers added 4.9k tokens to Claude Code and 7k to OpenCode.
  • Framework templates – an 8.4 k‑char template (~2.1k tokens) is re‑sent on every turn, multiplying by request count.
  • Subagents – delegating to two subagents caused Claude Code’s token total to jump to 513k (4.2× the direct‑run cost) because each subagent repeats the full bootstrap [1].

Combined, a production configuration can push the first request beyond 75‑85k tokens before the user even types, consuming >40 % of a 200k window and raising latency.

Cache stability – the hidden cost driver

OpenCode emitted a byte‑identical prefix across all turns, so after the initial cache write it only performed cheap reads. Claude Code produced three distinct request classes per session and varied its system blocks, resulting in multiple cache rewrites. In the file‑summarise benchmark Claude Code wrote 53,839 cache tokens across five requests, whereas OpenCode wrote just 1,003 [1]. The instability directly drives higher premium‑rate writes.

Business takeaways

  1. Budget forecasting must include harness overhead. A 33k baseline can add $0.30‑$0.50 per 1k tokens on typical pricing, quickly dwarfing the cost of actual code generation.
  2. Cache design is a cost lever. Stable prefixes and fewer tool schema changes keep cache writes low.
  3. Configuration audit is essential. Instruction files, MCP servers, and template frameworks multiply baseline tokens; trimming unused tooling can halve the bill.
  4. Monitoring at the API boundary is non‑negotiable. Systima’s proxy captured payloads and usage blocks, providing an auditable log required by Article 12 of the EU AI Act [2].