In an agent session, tool output costs more than the model's own words, and the cheapest fix is at the tool, not the model.
Abstract.
Most LLM cost work targets the model: a cheaper tier, a shorter prompt, a router. We look at the other side of the call. In an illustrative 40-turn coding-agent session on Claude Opus 5.5, tool output accounts for 67% of the $1.98 bill, because every result is written to the cache once and reread on every later turn. We compare seven tool-output policies by cost per successful task. A blind 2,000-token cut lowers session cost 23% but nearly doubles cost per success, since the agent loses the line it needed. A 25,000-token default cap does almost nothing. Concise response formats plus a 4,000-token cap that leaves a file pointer cut cost per success 35% at unchanged success in our model. Shape tool output at the source, and never truncate without a way back.
All figures come from our own illustrative model. It is not measured production traffic, and nothing here comes from Nadir customer data.
Introduction.
An agent turn has two authors. The model writes a few hundred tokens and a tool call. The tool writes back whatever it returns: a 300-line file, a test log, a 50-field JSON payload. Most cost conversations are about the first author.
The second is getting louder. A June 2026 write-up described a single MCP scraping call that returned 278,649 tokens and hit Claude Code's limit. Claude Code warns when MCP output passes 10,000 tokens and caps it at 25,000 by default, adjustable with MAX_MCP_OUTPUT_TOKENS. When GitHub audited its own agentic workflows, 37% of tokens were waste, and unpruned context was one of the top offenders.
Anthropic's guidance on writing tools for agents treats this as a design problem. It recommends "some combination of pagination, range selection, filtering, and/or truncation with sensible default parameter values," and a response_format switch. In its Slack example, a concise response used 72 tokens against 206 for the detailed one, "~⅓ of the tokens."
It doesn't price those choices against each other, or against the risk of cutting the wrong thing.
Research question.
How much of an agent's bill is tool output, and which ways of shrinking it lower cost per successful task rather than just cost per session?
Methodology.
We simulated 3,000 sessions of a coding agent on Claude Opus 5.5. Each session is 40 turns over a 15,000-token prefix of system prompt and tool schemas. Each turn the model emits 400 tokens and calls one tool. Context is cached: new tokens are billed once as a cache write, then as cache reads on every later turn.
| Tool | Share of calls | Median raw output | Concise factor | Decision-critical info |
|---|---|---|---|---|
| File read | 35% | 2,500 | 1.0 (no change) | Anywhere |
| Test/build log | 15% | 5,000 | 0.15 | Near the end |
| API JSON | 20% | 3,000 | 0.25 | Anywhere |
| Web/doc search | 15% | 2,000 | 0.5 | Anywhere |
| Shell/grep | 15% | 1,200 | 1.0 | Anywhere |
Sizes are lognormal around those medians (σ = 0.8), so some run past 20,000 tokens. Prices are Anthropic list, retrieved November 16, 2026: Opus 5.5 at $5 cache write, $0.20 cache read and $20 output per million tokens. Haiku 5.5 at $0.10 input and $0.50 output.
Seven policies:
- Raw. The tool returns everything.
- 25K default cap. Raw, cut at 25,000 tokens.
- Blind 2K cut. Keep the first 2,000 tokens, with no notice and no pointer to the rest.
- 2K cap + file pointer. Same cut, but the full output is saved and the agent gets a path. When it needs something past the cut, it spends one extra turn reading an 800-token slice.
- Small-model summarizer. Haiku 5.5 condenses every non-file output over 1,000 tokens to 300 tokens.
- Concise format. The tool returns only the fields and lines the agent needs, using the factors above.
- Concise + 4K cap + pointer. Policies 6 and 4 together.
Quality model: base success is 85%. When a cut hides decision-critical information, the agent notices and re-calls 80% of the time, and an unnoticed miss fails the task half the time. A cut test log hides the failure 90% of the time. For other tools, the miss chance is half the fraction cut. The summarizer drops a critical detail 4% of the time. Concise formats are assumed lossless. Every number in this paragraph is an assumption.
Results.

Tool output is two-thirds of the bill. Of $1.98 per session, $1.32 is tool output, written once and reread on later turns. The model's own reasoning and tool calls are 23%. This is the rereading pattern seen from the tool's side.

A big result early costs more than many turns of thinking. A 20,000-token log that enters at turn 1 costs $0.256 by turn 40, about 32 turns' worth of model output.

The blind cut is the cheapest session and the most expensive result. It lowers session cost from $1.98 to $1.52, but success falls from 85% to 35%, so each successful task costs $4.39, 88% more than raw.
The 25K default barely binds. Few outputs exceed it. It is a safety rail, not a cost control.
Concise formats do most of the work. Returning only what the agent needs drops cost per success to $1.62, 31% under raw, with no recovery turns. Adding a 4K cap with a pointer on top reaches $1.50, 35% under raw.
The summarizer is cheap and fragile. At a 4% drop rate it reaches $1.55 per success, with success at 78%. At 15% the figure rises to $2.08, and at 25% it costs more than raw, $2.71.

The cap needs a way back. Across caps from 500 to 25,000 tokens, a blind cut never beats raw on cost per success. A cap with a pointer beats or matches it at every size, in dollars. But a 500-token cap adds 17 extra model turns to a 40-turn session, and a 2,000-token cap about 9. Tight caps trade dollars for latency.
Discussion.
Shape at the source before you truncate. Concise formats are the only policy here that cuts tokens with no recovery turns, and they need the most design work. A field projected away on turn 3 is gone on turn 30. Anthropic's concise Slack format excludes IDs, and a later call may need one.
Truncation without a pointer moves cost into failure. A blind cut looks good on a token dashboard and bad on a task dashboard. If you must cut, keep the tail and say where the rest is.
Small models are not free filters. A summarizer costs a little per call and a lot per dropped detail, the retry tax again. Never summarize content the agent will edit.
Shaping doesn't replace context management. Masking or clearing old results limits how long a result is reread. Shaping limits how big it is. They stack, with the cache caveats we covered before.
This is not an argument for less reading. An agent that can't see the stack trace will guess.
Implementation guide.
- Instrument token usage by stage. Log tokens per turn split into prefix, model output, and tool output, with the tool name attached.
- Separate reasoning tokens from context tokens. Output is billed once. Tool output is billed once, then reread. Rank tools by size times turns remaining, not size alone.
- Find the over-readers. Look for tools whose median output is large and whose next model turn quotes little of it: whole-file reads, unfiltered logs, full API payloads.
- Add a concise mode to the worst offenders. Field projection for JSON, failures-only for test runs, line ranges for files, top-k for search.
- Cap only with a pointer. Save the full output, return head and tail plus a path and a hint for how to get more.
- Route the cheap steps. Summarizing, filtering, and classifying a tool result rarely need the session's frontier model. Add a confidence threshold and fall back to the full output when unsure.
- Monitor cost, latency, and success together. Report cost per successful task and extra turns per session next to tokens.
Where Nadir fits.
Steps 1 and 6 are the parts a routing layer handles. Instead of treating every call in a session as an Opus-level problem, Nadir's gateway classifies each request and routes it, with model="auto", to a model sized for it. Observe mode records what it would have routed without changing anything. For coding agents, Nadir Lens shows spend by session and agent loop, which is where a 20,000-token log shows up.
Nadir doesn't rewrite your tool output; that fix belongs in your tools. We don't publish a savings rate, and nothing here forecasts yours.
Limitations.
- One synthetic tool mix and session length.
- Every read is a cache hit at the 5-minute write rate. No compaction, masking, or context editing.
- Recovery behavior, miss rates, and the summarizer's drop rate are assumed. Concise formats are assumed lossless.
- Success is modeled only through information loss. Long contexts can also hurt quality (context rot), which would favor shaping further. We did not model it.
- Latency is counted in extra turns, not measured seconds.
Conclusion.
In our model, the most expensive thing in an agent's context was what its tools returned. The fix that held up was boring: return less from the tool, and never cut without a way back. The future of LLM cost optimization is not just cheaper models. It is better orchestration, better routing, better retrieval discipline, and better measurement.
Run the audit on one week of your own agent logs, ranking tools by output size times turns remaining. Then get a free key and benchmark your own workflow in observe mode, or estimate savings from your current spend.
Sources: [Anthropic, "Writing effective tools for agents — with agents," September 11, 2025](https://www.anthropic.com/engineering/writing-tools-for-agents). [Claude Code Docs, "Connect Claude Code to tools via MCP"](https://code.claude.com/docs/en/mcp), retrieved November 23, 2026: output warning at 10,000 tokens, 25,000-token default maximum, `MAX_MCP_OUTPUT_TOKENS`. ["A single MCP call returned 278,649 tokens," Level Up Coding, 2026](https://levelup.gitconnected.com/a-single-mcp-call-returned-278-649-tokens-heres-the-proxy-i-built-to-stop-it-dfaa9b5282e0). [Claude API Docs, Pricing](https://platform.claude.com/docs/en/about-claude/pricing), retrieved November 16, 2026. Charts were generated with Python and seaborn from the illustrative model described above.