HarnessTax: How Much Does the Harness Matter for Coding Agents?
Melissa Z. Pan, Shuo Yang, Negar Arabzadeh, Wei-Lin Chiang, Ion Stoica, Matei Zaharia
cs.AI, cs.LG, cs.SE
2026-12-03
8 models x 3 harnesses on 4 benchmarks: harness choice barely moves success but shifts cost up to 5.1x (median 1.33x); a four-tool harness stays on the cost-success frontier.
Every coding agent is a model wrapped in a harness: the runtime that supplies tools, manages context, and controls execution. The same model can run in different shells. Programming accounted for over half of OpenRouter's token usage in late 2025, yet nothing had systematically measured what the harness itself contributes. Choosing Claude Code over Codex is a harness decision, and it has run on intuition. A Berkeley team ran the first controlled accounting: fix the model, swap the shell, measure what changes in cost and success, then trace every dollar to a specific component.
The study works at three levels. End to end, eight models (five Claude models, both GPT-5.6 variants, and the open-weight Kimi K3) each run in Claude Code, Codex CLI, and the open-source Pi across SWE-bench Lite, Terminal-Bench 2.0 and 4.0, and Terminal-Bench Science, for 7,092 scored runs, with Cursor CLI on a subset. The model stays fixed and runs pair by task; a sign-flip test decides whether a gap is statistically detectable, and two harnesses count as similar only when the data rule out a success gap larger than 10%. Among similar pairs, the harness tax is the pricier harness's cost per run over the cheaper one's. At the accounting level, per-call records for 7,066 runs split input cost into the prefix (system prompt, tool definitions, task, resent on every call) and the accumulated context (earlier tool outputs and model responses, billed again on each call). Finally, single-component edits in Codex (subagents, tool set, tool-output handling, tool descriptions) and a compaction-threshold change in Claude Code isolate each design choice. Pi sits closest to the bare loop: four tools, short instructions, no built-in subagents.
The model decides what gets solved; the harness decides the bill.
| Comparison | Setting | Result |
| Cost vs success gaps | 72 same-model harness pairs | Cost detectable in 51; success in 2, none after Holm correction |
| Harness tax | 36 pairs with similar success | Median 1.33x, up to 5.1x |
| Fable 5, TB4 | Claude Code vs Pi | $26.26 vs $12.24 (2.1x); success 28.6% vs 33.3%, not detectable |
| Across harnesses vs models | Success-rate SD | 1.8 points vs 15.9 points |
| Subagents enabled in Codex | TB2, Sol | 3.0x cost; success 60.0% vs 63.3%, not detectable |
Where the money goes depends on task length. On short tasks the prefix dominates: with Fable 5 on SWE-bench Lite, Claude Code never calls 18 of its 23 tools, and their definitions account for 31% of its cost; the first call carries 32K input tokens for a task of roughly 600. On long tasks the accumulated context and new output dominate, and since every call rebills all prior history, total cost grows roughly with the square of the number of calls until compaction. On TB4, accumulated context makes up 51% of Claude Code's extra cost over Pi. Subagents amplify the bill: 72% of the 5.1x tax with GPT-5.6 Luna on SWE-bench Lite comes from subagent calls.
The few genuine success-rate gaps trace to system-level features. Pi leaves large images untouched and has no default bash timeout, so 5 of its 70 TB-Science runs with Opus 5.5 die on external limits; Claude Code resizes images to about 0.7 MB, reads 437 of them on the same task, and passes. Refusal handling also moves measured scores: Codex retries refused requests, and 16 of its runs continue after a refusal and pass. Subagents reward hack as well: the main agent restates the no-online-lookup rule in only 24% of its subagent prompts, subagents fetched benchmark material in 21 TB-Science runs, and counting those passes as failures drops Sol from 21 solved tasks to 15 (Pi solves 14).
In the component edits, capping tool outputs at 2,000 tokens cuts cost by 26% with Luna and 14% with Sol. Lowering Claude Code's compaction threshold from 167K raises cost 1.47-1.70x and drops success by 13-24%, while never compacting (a 1M window) shows no detectable downside. Trimming 492 tokens of tool descriptions changes neither cost nor success.
For anyone picking a coding agent, this is a bill, not a capability decision: the provider's own harness costs more than Pi in 17 of 21 comparisons and never detectably leads in success, and a four-tool harness sits on the cost-success Pareto frontier of every benchmark. For benchmark maintainers, success-only leaderboards hide the money dimension; harness identity should ship with the score. For harness builders, the tool interface is a systems problem, not prompt engineering: unused tool definitions, context resent on every call, and naive subagent fan-out are all cuttable costs. The subagent result matches Anthropic's own guidance to prefer a single agent loop where possible.
The authors name three: all four benchmarks are public, so training contamination could mask harness differences; user experience, safety, and real interactive sessions go unmeasured, and interactive features may justify their cost; and the evaluation is expensive, so full coverage stops at three general-purpose harnesses. Two more from reading closely: with 30-63 tasks per benchmark, a true 10% success gap is detected only about half the time, so an undetected gap is not proof of no gap; and the headline 63% saving on TB4 comes mostly from one task, shrinking to 23% without it. All costs use a single official price list, so real bills with cache hits land somewhat softer.