The harness rarely changes whether a coding agent succeeds, but it often changes what you pay. A UC Berkeley study ran eight models through three harnesses and found a median harness tax of 1.33x, and up to 5.1x, at similar success rates. I'd audit the tools and subagents in my coding-agent setup before I upgrade the model.

What is a coding-agent harness, and why measure it now?

A coding-agent harness is the software layer around a model that gives it tools, decides what goes into every request, executes the commands the model asks for, and stops the run once a limit is reached. You can run the exact same model inside Claude Code, Codex CLI or the open-source Pi, and each harness surrounds it with a different setup. Pi stays minimal, giving the model four tools (read, write, edit, bash), short instructions and no built-in subagents, whereas Claude Code and Codex ship with much larger tool sets, longer instructions, subagents and background tasks.

Those design choices show up directly on the invoice because of how agent billing works. Every single model call re-sends the system prompt, every tool definition and the conversation so far, and the provider charges for those input tokens each time. Even a tool the model never uses still costs money on every turn as long as its definition sits in the prompt. The invoice shows tokens per model, with no separate line for what the harness added, so that share stays invisible unless you measure it.

The HarnessTax paper (Pan et al., 2026), written by Melissa Pan, Shuo Yang, Negar Arabzadeh, Ion Stoica and Matei Zaharia at UC Berkeley with Wei-Lin Chiang of Arena, describes itself as the first systematic study of production harnesses and their components. The researchers hold the model fixed, swap the harness, and trace the extra cost back to individual components inside the setup. I covered the broader cost question in why AI agents cost more to run than they should, and this paper puts firm numbers on the harness portion of that bill.

How did the Berkeley team test it?

The Berkeley team ran eight models (Claude Fable 5, Opus 5.5, Opus 4.8, Sonnet 4.6, Haiku 4.5, GPT-5.6 Sol, GPT-5.6 Luna and the open-weight Kimi K3) inside each of three harnesses (Claude Code, Codex CLI and Pi) across four benchmarks. Those benchmarks were SWE-bench Lite, made up of short bug fixes from real GitHub issues, along with Terminal-Bench 2.0, Terminal-Bench 4.0 and Terminal-Bench Science 0.1, where a median run takes about two hours. The main comparison covers 7,092 runs, and counting the follow-up experiments plus a Cursor CLI subset, the authors released all 11,887 runs, complete with trajectories and per-call records, as an open dataset on Hugging Face under a CC BY 4.0 licence, along with the analysis code on GitHub.

Two design choices give these figures more credibility than a simple side-by-side test. Each pair of harnesses is matched task by task with the same model, so task difficulty cancels out, and success gaps are checked using a paired sign-flip test plus Holm correction to account for running many comparisons. The authors also define "similar" success strictly, treating two harnesses as similar only when the data rule out a gap larger than 10 percentage points. Within those similar-success comparisons, the harness tax is the more expensive harness's mean cost per run divided by the cheaper one's, with cost priced from recorded tokens on a single official price list and excluding sandbox compute.

From there, the team went a step further than earlier studies by isolating individual pieces of the harness. They altered one component at a time (subagents, the tool set, tool descriptions, tool-output handling and the compaction threshold) to see which design choices change cost and which ones affect success.

How much does the harness add to the bill?

Across the benchmarks, the harness alters what you spend far more reliably than it alters whether the agent solves the problem. Looking across SWE-bench Lite, Terminal-Bench 2.0 and 4.0, the paper finds statistically detectable cost gaps in 51 of 72 same-model comparisons (37 after Holm correction), compared with just 2 of 72 success gaps, none of which survive correction. Across the 36 comparisons that qualify as having similar success, the median harness tax sits at 1.33x, while the widest spread reaches 5.1x when GPT-5.6 Luna runs in Claude Code against Pi on SWE-bench Lite with a success difference of only 2.2 points.

An obvious objection is that some of this extra spend might come from translating one provider's API format into another, and the authors tested that directly. When both harnesses call the model in its own provider's native format, the median tax across 13 similar-success comparisons stays at 1.32x, ranging from 1.00x to 2.60x. For reference, splitting a single model–harness pair's runs into two halves produces a median ratio of 1.08x from chance alone and 1.26x at the 95th percentile, and eight of the 13 native-format ratios sit above that 1.26x.

Horizontal bar chart of the harness tax in 13 same-model comparisons with similar success rates, ranging from 1.00x to 2.60x, with a dashed median line at 1.32x.

Harness tax in the 13 native-API comparisons with similar success, from Table 17 of HarnessTax (Pan et al., 2026). The first harness named in each row is the more expensive one.

The chart also makes clear that the cheaper harness depends on the model. With Sonnet 4.6 on Terminal-Bench 4.0, Pi costs more than Claude Code at 1.72x, and the paper documents four comparisons in total where Pi costs detectably more than Claude Code (Kimi K3 on two benchmarks, Opus 4.8 and Sonnet 4.6). In my view, that confirms the extra spend comes from specific design choices that add tokens, and any harness can make those choices.

Success rates, by contrast, closely follow the model itself. Hold the model fixed and success rates across different harnesses vary with a standard deviation of 1.8 percentage points, roughly a ninth of the 15.9-point spread you see across different models inside a single harness. Even with only four tools, Pi sits on the cost-success Pareto frontier across all four benchmarks. Models also hold up well outside their own provider's harness: across 21 comparisons the provider's own harness never leads the best alternative in success rate by a detectable margin, while costing more than Pi in 17 of those 21 cases.

Where does the extra cost come from?

Where the extra tokens come from depends on how long the job runs. On short tasks, the extra cost comes from everything the harness sends before the model takes its first step, whereas on long tasks it comes from accumulated context that gets billed over and over on each subsequent call. Running Claude Fable 5 on SWE-bench Lite, Claude Code's opening request carries 33.5K input tokens, most of them tool definitions, while the actual task takes about 600 tokens. On that benchmark, tool definitions and instructions make up 94% of Claude Code's extra cost over Pi.

The number that stands out most to me is how much gets spent on tools the model never calls. In every SWE-bench Lite run with Fable 5, Claude Code uses only five of its 23 tools, leaving the other 18 tool definitions to consume 24.4K of the 33.5K first-request tokens and account for 31% of total cost. Across all eight models, never-called definitions account for 9% to 31% of Claude Code's cost on SWE-bench Lite and 3% to 12% on the longer Terminal-Bench 4.0. Codex sees a smaller share from unused tools, mostly for subagents and goals, at 1% to 11% on SWE-bench Lite, while Pi declares four tools and calls all four. These figures describe the releases and default settings the authors tested, and the tool set moves between versions: with Opus 5.5, Claude Code's first SWE-bench Lite request was 25,336 tokens with 19 tools.

Grouped bar chart of Claude Code's extra cost over Pi with Claude Fable 5. On SWE-bench Lite, tool definitions are 66% and other prefix 28%; on Terminal-Bench 4.0, earlier responses are 45% and new output 25%.

Share of Claude Code's extra cost over Pi by component, Claude Fable 5, from Table 27 of HarnessTax (Pan et al., 2026). Shares are the authors' estimates.

Longer tasks change that cost breakdown considerably. On Terminal-Bench 4.0 with Fable 5, accumulated context (tool outputs plus earlier responses) makes up 51% of Claude Code's extra cost over Pi, and new output accounts for another 25%. Because every tool output remains in the context until compaction happens, the paper notes that cumulative context cost grows roughly with the square of the number of calls. Caching lowers the size of that bill, since cache reads cost a tenth of the input price or less, though it does not remove the effect.

Subagents make up the third major source of extra tokens. Running GPT-5.6 Luna on SWE-bench Lite, subagent calls account for 72% of Claude Code's extra cost over Pi, which explains most of that 5.1x gap. That behaviour comes specifically from how the model and harness interact, as Claude Code starts subagents in nearly every Terminal-Bench 4.0 run with GPT-5.6 models, compared with at most seven runs for any other model.

Do subagents, output caps and compaction change the result?

When the authors tested individual settings in controlled experiments, mostly inside Codex, changing one component at a time and repeating each task three to seven times, three patterns stood out to me. Switching on subagents multiplied cost without producing a detectable gain in success, capping tool output brought cost down without a detectable loss, and compacting context too early hurt success.

Change (one at a time)

Benchmark and model

Effect on cost

Effect on success

Subagents on (Codex)

Terminal-Bench 2.0, GPT-5.6 Sol, high effort

3.0x

63.3% to 60.0%, not detectable

Subagents on (Codex), 60.8 per run

Terminal-Bench Science, GPT-5.6 Sol, max effort

14.2x

26.7% to 31.1%, not detectable; 24.4% if runs that fetched benchmark files count as failures

Cap each tool output at 2,000 tokens

Terminal-Bench 2.0, GPT-5.6 Luna / Sol

26% lower / 14% lower

No detectable change

Shorter tool descriptions (492 fewer tokens)

Terminal-Bench 2.0, Sol and Luna

+2%, not detectable

No detectable change

Four directly called tools instead of Codex's tool set

Several benchmarks

Lower in 10 of 12 comparisons

No detectable change

Compact at 100.8K tokens (default 167K)

Terminal-Bench 4.0 (15 tasks), Opus 5.5, Claude Code

1.70x, detectable before correction only

13.3 points lower, not detectable

Compact at 64.8K tokens

Terminal-Bench 4.0 (15 tasks), Opus 5.5, Claude Code

1.47x, not detectable

24.4 points lower, detectable after correction

Never compact (1M-token window)

Terminal-Bench 4.0 (15 tasks), Opus 5.5, Claude Code

0.94x, not detectable

2.2 points lower, not detectable

Source: HarnessTax (Pan et al., 2026), Sections 8.1 to 8.4 and Table 34.

If you are tuning your own setup, I think three details from these runs should come with you. First, parallel subagents did not even save time, since runs with subagents on Terminal-Bench 2.0 took 24% longer. Second, subagents can break rules that the main agent never passes on. Terminal-Bench Science forbids looking up solutions online, yet Claude Code's main agent with GPT-5.6 Sol restated that rule in only 24% of its subagent prompts; none of the 187 subagents told to stay offline fetched benchmark material, compared with 26 of the other 680. Codex's subagents also fetched benchmark material once the authors enabled them, and the paper treats deciding what each subagent needs to know as an open multi-agent design problem. Third, aggressive compaction breaks down quickly because the context still holds 28K to 45K tokens right after compacting. At a 64.8K threshold, that remaining space fills up again almost at once, so a guard against repeated compaction ended a third of those runs, and even after excluding those runs the drop is still 13 points.

The tool-set result comes with one caveat that keeps me from overreading the headline figure. On Terminal-Bench 4.0, putting Pi's four tools inside Codex cut cost by 63%, yet most of that drop came from a single task where the variant failed cheaply while unmodified Codex passed three of six runs; without that task the saving is 23%.

What do richer harnesses give you that a minimal one does not?

Larger harnesses include practical system features, and the paper shows several cases where those details decide whether a long run finishes at all. On Terminal-Bench Science with Opus 5.5, five of Pi's 70 runs ended at a limit outside the model, compared with none for Claude Code. Four of those five ran into the provider's 30 MB request-size cap because Pi passes images up to 2,000 pixels and about 3.4 MiB through unchanged, whereas Claude Code caps each image at about 0.7 MB; on a microscopy task, Claude Code read 437 images and passed while Pi crashed after 18. The fifth hung on a single command until the deadline because Pi's bash tool has no default timeout, which Claude Code includes.

The larger harnesses also ship other features that matter here. In its Terminal-Bench 2.0 runs with four of the five Claude models, Claude Code defers 16 tool definitions behind its ToolSearch tool and sends only their names upfront, in line with the fix the paper itself recommends. Codex retries a failed provider request up to five times, which kept runs going that would otherwise have ended, and its default instructions restrict subagents to explicit user requests, so it started none with GPT-5.6 models in the main study. The paper argues that general-purpose harnesses should prioritise cost efficiency and reliability, and in my view these built-in features are what that reliability rests on. The study also leaves out interactive features, user experience and safety, which is where much of a richer harness's value sits when a human is working at the keyboard.

That is why I read the result mainly as a measurement of default settings on benchmark workloads. It tells you which components to switch off or tune for unattended coding tasks, and none of those changes require leaving the harness you already use.

Where do other studies agree, and where do they differ?

Independent work points in the same direction, though the size of the gap varies with the model. Liu and Han (2026) ran seven models through Claude Code, mini-SWE-agent and OpenCode on SWE-bench Verified and two other benchmarks, rerunning each unchanged. They found that no single harness leads consistently, that swapping harnesses changes about as many task outcomes as a simple rerun, and that cost gaps range from under 10% to three to four times depending on the model. They also found model-specific exceptions, with one harness trailing by 8 to 9 points on one model and leading by 14 on another, so the harness can still matter for success in particular pairings.

Other studies on context and prompting show the same pattern. Looking at context, Lindenbauer et al. (2025) found that simply masking older tool observations halves cost relative to the raw agent on SWE-bench Verified while matching the solve rate of LLM summarisation. Looking at instructions, Gloaguen et al. (2026) found that AGENTS.md context files do not generally improve task success while raising inference cost by over 20% on average, with repository overviews in particular proving unhelpful. And Desai, Wu and Sengamedu (2026) at Amazon showed that a short "make the minimal change" system prompt cut input tokens per task for 13 of 14 models, by up to 42%, with no significant change in aggregate resolution.

Anthropic's own published guidance points the same way. Its article on when to fold subagents into your main agent loop favours a single agent loop that loads skills and tools on demand, keeps subagents for context bloat, parallel work with fresh context, or tool-selection trouble, and notes that tool choice tends to degrade beyond 30 to 50 tool definitions. The same article reports that progressive disclosure of skills and tools cut Claude Code's system prompt for more advanced models by over 80%, so the harness studied here is already moving in the direction the paper recommends. Its engineering post on advanced tool use reports that its Tool Search Tool cut token usage by 85% in an example with 50-plus MCP tools, and suggests turning to it once tool definitions pass 10K tokens. For more detail on when splitting work across agents pays off, see most tasks don't need a swarm of AI agents.

Which limits should you keep in mind?

Before applying these numbers directly to your own work, a few clear limits apply. All four benchmarks are public, so models may already have seen the tasks in training, which could hide harness differences that would show up on private code. The study measures cost and success alone, with no real user sessions, interactive features, user experience or safety, and it covers three general-purpose harnesses plus Cursor CLI on a subset. Some of the savings rest on single tasks, several component effects do not survive multiple-comparison correction, and the authors note that on the 30-to-63-task benchmarks their test detects a true 10-point success gap only about half the time. Even with those limits in place, I think the safe reading holds, because across these tasks the harness rarely changed success by much while it reliably changed cost.

How do I audit my own coding-agent setup this week?

If I were auditing a coding-agent setup for a small team, I would start by measuring what each request carries, clear out whatever never gets used, and hold off on comparing models until the prompt is clean. You can work through the full sequence in a few hours plus one batch of test runs.

  1. Log the first request of a typical session. Record the input tokens on the opening model call and count every tool definition attached to it. Whenever those tool definitions cross 10K tokens or you are loading more than 30 tools, treat that as your first target to cut. In the paper, Claude Code's first call with Fable 5 held roughly 32K to 33.5K tokens against about 600 for the task itself.

  2. List the tools you never call. Pull a full week of session logs and count calls per tool, including every MCP server you have connected. Disable or defer every tool sitting at zero calls. In the study, 18 never-called tools out of 23 accounted for 31% of the total cost.

  3. Turn on deferred tool loading where your harness has it. Rather than sending every full definition upfront, send the tool names first and let the harness load full definitions on demand, using ToolSearch in Claude Code or tool search on the Claude API.

  4. Cap tool output. Keep about 2,000 tokens of each tool output directly in context and write the complete output to a file that the agent can read when needed. That cap cut cost by 14% to 26% with no detectable change in success.

  5. Run subagents off, then on. Pick 20 to 30 of your own recent tasks that already have tests, run each configuration three times, and keep subagents enabled only if solved tasks actually rise. If you do keep them, put the task's hard rules straight into every subagent prompt.

  6. Leave compaction at the default. Do not lower the threshold in an effort to save money. With Opus 5.5 on 15 Terminal-Bench 4.0 tasks, dropping it from 167K to 64.8K tokens cut success by 24.4 points and did not lower cost (1.47x, not detectable). If your model offers a long context window, test never compacting instead.

  7. Trim the instruction files. Cut repository overviews out of AGENTS.md or CLAUDE.md, keep the non-standard rules your repository relies on, and add a one-line instruction telling the agent to make the minimal change.

  8. Measure cost per solved task. Divide total spend by the number of tasks that pass your tests for each configuration. If you ran each task once, I would treat any difference below about 1.3x as possible noise, since the paper's same-pair halves differed by up to 1.26x at the 95th percentile; with three runs per task that band narrows to about 1.14x.

  9. Only then price a model upgrade. Once your harness is trimmed, run those same 20 to 30 tasks on the bigger model inside the cleaned-up harness and compare cost per solved task side by side.

If you want a tool-by-tool walkthrough aimed at the same bill, TokenEconomizer's trimming of tools, repo notes and loops is a useful companion.

Should a small team upgrade the model or fix the harness first?

I would fix the harness before upgrading the model. The paper's numbers show a 15.9-point spread across models against 1.8 points across harnesses, which means the model decides most of what your agent can solve while the harness decides much of what you pay for that work. Moving to a bigger model buys capability you may genuinely need, whereas auditing the harness first removes cost you are already paying for nothing and carries those savings over to whichever model you pick next.

When a founder runs agents on every pull request, those harness choices show up straight away as a budget line. Put a cost-per-solved-task number on the dashboard before anyone requests a pricier model, and make every new tool, MCP server or subagent earn its place in the prompt by showing up in the call logs. Any tool your agent never calls still gets billed on every call it sits in.

Key facts

  • For a fixed model, the median harness tax across 36 similar-success comparisons is 1.33x, up to 5.1x (Pan et al., 2026).

  • Claude Code never called 18 of its 23 tools on SWE-bench Lite with Fable 5, and their definitions were 31% of cost; tool definitions and instructions were 94% of its extra cost over Pi (Pan et al., 2026).

  • Enabling subagents in Codex raised cost 3.0x on Terminal-Bench 2.0 and 14.2x on Terminal-Bench Science with no detectable gain in success (Pan et al., 2026).

  • A harness swap changes about as many task outcomes as rerunning the same harness, across seven models (Liu and Han, 2026).

  • Masking old tool observations halves agent cost while matching LLM summarisation's solve rate (Lindenbauer et al., 2025).

Sources

I spent a good decade or so in marketing, product owner and growth roles at IBM, LinkedIn, SAP and Adobe, and now lead AI go-to-market for startups, mid-market and SMBs across Asia Pacific and Japan at a frontier technology company. This is where I curate detailed how-tos and DIY tutorials. Follow me on LinkedIn and X.