The Hidden Context Costs of Coding Agents

krishnan · x · 2026-07-15

This discussion highlights the "harness tax" of coding agents: the real expense often lies not in the model itself, but in the system prompts, tool schemas, MCP, memory layers, and repository instructions injected by the agent's wrapper before reaching the model.

Citing measurements by Systima under identical model, machine, and task conditions: Claude Code sends roughly 33,000 tokens of system prompts/tool scaffolding in the first round, whereas OpenCode uses about 7,000 tokens. For Claude Code, around 24,000 tokens come from tool definitions alone; a 72KB AGENTS.md / CLAUDE.md file adds roughly 20,000 tokens in a production setup. When a task is split between two subagents, total consumption can skyrocket from 121,000 to 513,000 tokens.

The author emphasizes that evaluating just the "minimal prompt" is insufficient; the entire request trajectory must be considered. An agent's cost is driven by baseline × request count + conversation growth + tool outputs + caching behavior. Bulky harnesses can sometimes be more cost-effective than leaner wrappers because they batch tool calls more efficiently. The conclusion is that production environments require rigorous tracking of token traces, cache hit rates, tool-call depth, prompt diffs, and per-task unit economics, rather than merely monitoring latency and errors.

Related event: Claude Code's Hidden Context Overhead Exposed(3 posts)→

Original post →

More from coding & agent

coding & agent channel →