Zero Labs
Industry News / AI

The Effort Leak: Why Your Subagents Cost as Much as Your Main Session

Source · Towards AI By Ali Süleyman TOPUZ

From the publisher’s feed, collected in the ZeroLabs newsroom.

Once a team gets a spending cap, the conversation changes. Before the cap, nobody asks where the tokens went. After it, someone hits the limit on a Wednesday afternoon and the whole team starts reading usage screens like bank statements.This week I went through the newsletters and docs with one question: where do coding-agent tokens actually go, and which knobs move the number? This is not a benchmark post. I did not run anything for it. Every number below comes from a named source, and I label what kind of number it is. Where I give an opinion, it is reasoning, not a measurement.The leak: subagents inherit your effort levelThe thing that started this was a line in The Code’s Sunday Special (8 November). The newsletter summarizes a post by Boris Cherny on X: subagents inherit the main session’s effort level by default. So if your main session runs at max effort, every subagent it spawns runs at max effort too.That is a newsletter summary of a social post, so I treat it as a pointer, not proof. But it matches how the docs and two independent write-ups describe resolution order, and it explains something I had seen people complain about without a name for it: a cheap-looking “go find the file that does X” subagent costing as much as the main reasoning turn.How big can the gap be? Wmedia’s Claude Code Hub published a small test (author-run, one task): the same subagent explaining a file in five lines spent 586 output tokens at low effort, 701 at high, 656 at xhigh and 10,921 at max. One task is not a distribution, but it shows the shape of the risk. Max effort on a lookup is not a few percent more. It can be an order of magnitude more.The Code also says /usage now offers a "press f to fix" option for this. I have not found that in any documentation, so I am passing it on only as the newsletter's claim.The documented controlsThere are two layers here, and it took me a while to keep them apart: effort (how hard the model reasons) and model (which model runs).EffortThree places can set a subagent’s effort, plus a new fallback:CLAUDE_CODE_EFFORT_LEVEL, an environment variable that applies to the whole session and to every child.The per-call effort parameter that Claude passes on the Agent tool call when it is asked to launch an agent at a specific level.The effort: field in the agent's frontmatter in .claude/agents/.The fallback. Until recently that was the session level (/effort, --effort, or settings). Claude Code 2.1.316 adds CLAUDE_CODE_SUBAGENT_EFFORT, which a subagent now uses when none of the first three sets a level, instead of looking at the session.That precedence comes from the official subagents docs as summarized by Pasquale Pillitteri’s write-up and Wmedia’s tip page, which agree with each other. Read rung 1 carefully, because it is the trap. If you put CLAUDE_CODE_EFFORT_LEVEL=medium in your shell profile to "save money", you have also overridden every effort: low in your agent files. Wmedia notes that with that variable set, the per-call parameter disappears entirely. One global setting flattens all your per-agent tuning.Two version caveats. Pillitteri’s write-up says the stable channel was still at 2.1.309 when the variable shipped, so check claude --version before you trust it. And Wmedia says the per-call effort parameter needs v2.1.292 or later, while the frontmatter field is older.Which effort levels exist depends on the model. Pillitteri lists low, medium, high, xhigh and max for Opus 5.5, Opus 4.8 and Opus 4.7, and no xhigh for Opus 4.6 and Sonnet 4.6. I am not going to hard-code that list. Check the model configuration page for whatever you run.ModelCLAUDE_CODE_SUBAGENT_MODEL is a separate variable. It picks the children's model and has nothing to do with effort. You can combine them: children on a smaller model at low effort.For model resolution, a guide that checked the official docs gives this order: the model parameter Claude passes for that invocation, then model in the frontmatter (inherit means the main model), then CLAUDE_CODE_SUBAGENT_MODEL, then the main conversation's model. Notice the asymmetry with effort: for the model, the environment variable sits below the frontmatter. For effort, the session-wide variable sits above it. I would not trust my memory on this, and you should not trust mine either. Open the docs page once and confirm it for your version.The knob table+------------------------------+---------------------------+-----------------------------------+------------------------------+| Knob | Where it lives | What it changes | Default |+------------------------------+---------------------------+-----------------------------------+------------------------------+| CLAUDE_CODE_EFFORT_LEVEL | Shell env / settings env | Effort for session AND all | Unset || | | subagents; beats everything below | || Agent tool `effort` param | Per call, set by Claude | Effort for that one invocation | Absent unless asked || | (e.g. from CLAUDE.md) | | (v2.1.292+) || effort: (frontmatter) | .claude/agents/.md | Effort every time that agent runs | Unset || CLAUDE_CODE_SUBAGENT_EFFORT | Shell env / settings env | Effort for subagents nothing | Unset: subagents fall back || | | else configured (2.1.316+) | to the session level || /effort, --effort | Session | Main session effort; subagent | Model/plan dependent || | | fallback if nothing else is set | || model: (frontmatter) | .claude/agents/.md | Model for that agent | Unset (inherit) || CLAUDE_CODE_SUBAGENT_MODEL | Shell env / settings env | Model for subagents without their | Unset: main session model || | | own model | || tools: (frontmatter) | .claude/agents/.md | Which tools the agent can call | Unset: inherits all tools |+------------------------------+---------------------------+-----------------------------------+------------------------------+Where else the tokens goEffort is the newest leak, not the only one. Three other numbers shaped how I think about this.The status line. On 28 October, Flamerix AI published a gist arguing that Claude Code’s agent_summary feature, which writes the three-to-five word label next to each background agent, resends each agent's full transcript to the model roughly every 30 seconds and eats about 15 to 20 percent of tokens. A Level Up Coding author then tested 2.1.312 with three background agents and reported 14.6 percent of the session going to those labels. Both are author-run numbers. A Claude Code team member replied on Hacker News that across users it was closer to 2 percent of cost (6 percent in the terminal), and that 16 percent looked like a team running mostly background agents. Both can be true: the average is small, the tail is not, and the tail is exactly where a capped team lives if it leans on background agents.The week’s digest attributes a fix to the same 2.1.316 release, while one write-up tells readers to update to 2.1.311 or newer. I could not find changelog wording that settles which. If this matters to you, run /release-notes and read your own version's entry.Agent teams. Anthropic’s own costs page, as quoted by Automation Labs and others, says agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode, because each teammate keeps its own context window and runs as a separate Claude instance. That is a vendor doc figure for a specific configuration, not a general multiplier. Outside plan mode the docs only say usage is roughly proportional to team size.Cache reads. Max Woolf’s analysis argues that cache reads, not output, dominate agent bills. I could not open his page from where I was working, so I lean on two pieces that make the same argument with visible arithmetic. The exe.dev blog’s simulated conversation (their model, their pricing assumptions) ends with cache reads at 87 percent of a $12.93 total, crossing half the cost at 27,500 tokens. Martin Alderson makes the same case: every turn re-reads the whole context, so cost grows quadratically with turns. This changes how I read every other number in this post. A subagent at max effort is not just expensive because of its own output. Its long, chatty transcript is rent you pay again on every turn it runs.There is also harness overhead. Cekikj’s piece on Microsoft’s agent harness reports, from his own runs on a quiet night, a plain agent using 6 calls and about 26k input tokens versus 15 to 31 calls and 169k to 344k input tokens with the harness. His numbers, his setup. I mention it because it is the same pattern from another angle: the scaffolding around the model can cost more than the work.The routing pattern: strong plans, cheap executesThe obvious response is routing. A strong model plans and verifies. A cheaper model does the mechanical edits. The Code’s example is an executor.md with model: haiku and tools: Read, Edit, Grep.Warp’s founder claims this kind of split took them from about $80 to $20 per PR. That is an unverified founder claim, and I would not put it in a budget.The better evidence is Naresh Jain’s acceptance-test experiment, as reported by Wasowski. One disclosure first: Jain is behind Specmatic, which sells the kind of harness being tested. Wasowski flags that conflict, and so do I. The published numbers:+-------------------------------+-----------+---------------+----------------------------+| Setup | Pass rate | Cost per run | Cost per accepted change || | | | (my arithmetic) |+-------------------------------+-----------+---------------+----------------------------+| Cheap model, no harness | 3/10 | $0.086 | $0.086 / 0.3 = ~$0.287 || Cheap model, with harness | 10/10 | $0.273 | $0.273 / 1.0 = $0.273 || Strong model, with harness | 10/10 | $2.679 | $2.679 / 1.0 = $2.679 |+-------------------------------+-----------+---------------+----------------------------+Source: Naresh Jain via Wasowski. Pass rates and per-run cost are theirs; last column is division.The cheapest call is not the cheapest change. The cheap model without a harness looks three times cheaper per run, and ends up slightly more expensive per accepted change, before you count the human who has to notice the seven failures and redo them. That human time is the real cost and it does not show up in any of these columns.So the number I would watch is cost per accepted change, not cost per call. Routing to a cheap executor only pays if something catches the executor’s mistakes cheaply. That is a design decision, not a model decision.Why the executor gets no BashThis is the part of The Code’s example I like most, and I think it is deliberate. The executor has Read, Edit, Grep. No Bash. It cannot run the tests, so it cannot decide it is done.I read that as: verification stays with the planner. The cheap model edits. The strong model, or better, the test suite invoked by the strong model, decides whether the edit is accepted. If the executor could run Bash, two bad things would happen. It would start “fixing” test failures in a loop, each loop re-reading its growing transcript (cache rent again). And it would report success on its own terms. Taking Bash away keeps the loop short and keeps the judgement in one place.The cost of that choice: the planner has to run the checks, which means planner tokens on every edit. I think that is the right trade. A strong-model turn that reads a test result is cheap compared with a cheap-model loop that never converges.The agent files I would start withThree files in .claude/agents/. Comments in the YAML explain the reasoning. Note the effort: values only take effect if you have not set CLAUDE_CODE_EFFORT_LEVEL..claude/agents/explorer.md---name: explorerdescription: Finds files, symbols and call sites. Use for "where is X", "what calls Y", "list the files involved in Z". Returns paths and short notes, never edits.# Read-only. Lookups do not need to change anything.tools: Read, Grep, Glob# Lookups are the classic case where max effort buys nothing.# This line wins over CLAUDE_CODE_SUBAGENT_EFFORT and the session level,# but loses to CLAUDE_CODE_EFFORT_LEVEL if that is set.effort: low# No model line: falls back to CLAUDE_CODE_SUBAGENT_MODEL, then the main model.---You locate code. Answer with a list of file paths and line ranges, plus onesentence per item on why it is relevant. Do not summarize whole files.Do not propose changes. Stop as soon as you have enough to answer..claude/agents/executor.md---name: executordescription: Applies a specific, already-planned edit to named files. Use only after a plan exists that names the files and the change.# Cheaper model for mechanical edits (The Code's example uses haiku).model: haiku# No Bash on purpose: the executor cannot run tests or builds,# so it cannot declare its own work done. The main session verifies.tools: Read, Edit, Grep# No effort line: effort support differs by model, so leave it to# CLAUDE_CODE_SUBAGENT_EFFORT or the session fallback.---You apply the edit you are given, exactly as described, to the files named.If the instruction is ambiguous or the code does not match the plan,stop and report what does not match instead of guessing.When finished, list each file you changed and one line on what changed.Do not claim the change works; you cannot test it..claude/agents/reviewer.md---name: reviewerdescription: Reviews a diff against its plan before it is accepted. Use after the executor finishes and after tests have been run by the main session.# Read-only. The reviewer judges, it does not fix.tools: Read, Grep, Glob# Review is where reasoning depth pays for itself, so it gets high effort.effort: high# Inherit the main (strong) model for judgement.model: inherit---You review a change against the plan it was meant to implement.Check: does the diff do what the plan says, and only that? Are there edgecases the plan names that the diff misses? Do the test results you weregiven actually cover the change?End with a single line: ACCEPT or REJECT, followed by the main reason.And one line in CLAUDE.md, which Wmedia reports is enough for Claude to start passing per-call effort on its own:Run search and lookup subagents at low effort. Run review subagents at high effort.The shell profileThe goal is a cheap default for any subagent nobody thought about, without flattening the agents you did think about.# ~/.zshrc or ~/.bashrc# Requires Claude Code 2.1.316 or later. Check with: claude --version# Subagents with no effort of their own (no frontmatter, no per-call param)# start at low instead of copying the main session's effort.export CLAUDE_CODE_SUBAGENT_EFFORT=low# Subagents with no model of their own run on a cheaper model.# Agents that set model: in frontmatter keep their own choice.export CLAUDE_CODE_SUBAGENT_MODEL=haiku# Deliberately NOT set. It applies to the whole session and all subagents,# and it overrides every effort: line in .claude/agents/.# export CLAUDE_CODE_EFFORT_LEVEL=mediumIf you want to check whether a given machine is old enough to ignore the first variable, put a guard in front of your claude alias:claude_effort_check() { local v v="$(claude --version 2>/dev/null | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -1)" if [ -z "$v" ]; then echo "claude not found" >&2; return 1 fi if [ "$(printf '%s\n%s\n' "2.1.316" "$v" | sort -V | head -1)" != "2.1.316" ]; then echo "Claude Code $v predates 2.1.316: CLAUDE_CODE_SUBAGENT_EFFORT is ignored." >&2 fi}The same idea in .NET: a planner/executor routerPlenty of teams run their own agents in .NET rather than inside Claude Code, and the same rule applies: strong model plans and verifies, cheap model executes, and a policy decides, not the model itself. Here is how I would wire it with Microsoft.Extensions.AI, with the executor swappable between a hosted model and a local Ollama model through OllamaSharp.Setup:dotnet new console -n StepRoutercd StepRouterdotnet add package Microsoft.Extensions.AI.OpenAIdotnet add package OllamaSharpIf your feed only has a preview of Microsoft.Extensions.AI.OpenAI, add --prerelease.For the local executor:docker run -d --name ollama -p 11434:11434 -v ollama:/root/.ollama ollama/ollamadocker exec ollama ollama pull qwen2.5-coder:7bConfiguration is all environment variables, so nothing is hard-coded:export HOSTED_LLM_ENDPOINT="https://api.openai.com/v1" # any OpenAI-compatible endpointexport HOSTED_LLM_API_KEY="..." # your keyexport PLANNER_MODEL="..." # your strong model idexport EXECUTOR=local # local | hostedexport EXECUTOR_HOSTED_MODEL="..." # used when EXECUTOR=hostedexport OLLAMA_URL="http://localhost:11434"export OLLAMA_MODEL="qwen2.5-coder:7b"export EXECUTOR_MAX_FILES=2Program.cs:using System.ClientModel;using Microsoft.Extensions.AI;using OllamaSharp;using OpenAI;var task = args.Length > 0 ? string.Join(' ', args) : throw new ArgumentException("Pass the task as arguments, e.g. dotnet run -- \"Rename Foo to Bar in src/Billing\"");var hostedEndpoint = new Uri(Require("HOSTED_LLM_ENDPOINT"));var hostedKey = Require("HOSTED_LLM_API_KEY");IChatClient Hosted(string model) => new OpenAIClient(new ApiKeyCredential(hostedKey), new OpenAIClientOptions { Endpoint = hostedEndpoint }) .GetChatClient(model) .AsIChatClient();IChatClient planner = Hosted(Require("PLANNER_MODEL"));var executorMode = Environment.GetEnvironmentVariable("EXECUTOR") ?? "local";IChatClient executor = executorMode switch{ "local" => new OllamaApiClient( new Uri(Environment.GetEnvironmentVariable("OLLAMA_URL") ?? "http://localhost:11434"), Environment.GetEnvironmentVariable("OLLAMA_MODEL") ?? "qwen2.5-coder:7b"), "hosted" => Hosted(Require("EXECUTOR_HOSTED_MODEL")), _ => throw new InvalidOperationException($"EXECUTOR must be 'local' or 'hosted', got '{executorMode}'.")};var policy = new RoutingPolicy( MaxFilesForExecutor: int.TryParse(Environment.GetEnvironmentVariable("EXECUTOR_MAX_FILES"), out var max) ? max : 2, ExecutorEnabled: true);var router = new StepRouter(planner, executor, policy);var plan = await router.RunAsync(new Step(StepKind.Plan, task));Console.WriteLine($"[{plan.Route}] PLAN\n{plan.Output}\n");var edit = await router.RunAsync(new Step( StepKind.Execute, $"Apply only step 1 of this plan. Return a unified diff and nothing else.\n\n{plan.Output}", FilesTouched: 1));Console.WriteLine($"[{edit.Route}] EDIT\n{edit.Output}\n");// Verification always goes to the planner. In a real pipeline you would run// `dotnet test` here and pass the result in; the executor never sees a shell.var review = await router.RunAsync(new Step( StepKind.Verify, $"Plan:\n{plan.Output}\n\nDiff:\n{edit.Output}\n\n" + "Does the diff implement step 1 of the plan and nothing else? " + "End with a single line: ACCEPT or REJECT, then the reason."));Console.WriteLine($"[{review.Route}] REVIEW\n{review.Output}");static string Require(string name) => Environment.GetEnvironmentVariable(name) is { Length: > 0 } value ? value : throw new InvalidOperationException($"Environment variable {name} is not set.");public enum StepKind { Plan, Execute, Verify }public enum Route { Planner, Executor }public sealed record Step(StepKind Kind, string Instruction, int FilesTouched = 0, bool TouchesPublicApi = false);// The policy is plain data plus one method, so it can be unit tested// and changed without touching any client code.public sealed record RoutingPolicy(int MaxFilesForExecutor, bool ExecutorEnabled){ public Route Decide(Step step) => step.Kind switch { StepKind.Plan => Route.Planner, StepKind.Verify => Route.Planner, // judgement never goes to the cheap model StepKind.Execute when !ExecutorEnabled => Route.Planner, StepKind.Execute when step.TouchesPublicApi => Route.Planner, StepKind.Execute when step.FilesTouched > MaxFilesForExecutor => Route.Planner, _ => Route.Executor };}public sealed class StepRouter(IChatClient planner, IChatClient executor, RoutingPolicy policy){ public async Task RunAsync(Step step, CancellationToken ct = default) { var route = policy.Decide(step); var client = route == Route.Planner ? planner : executor; List messages = [ new(ChatRole.System, SystemPromptFor(step.Kind)), new(ChatRole.User, step.Instruction) ]; var options = new ChatOptions { // Short ceilings for execution keep a confused executor from rambling. MaxOutputTokens = step.Kind == StepKind.Plan ? 4000 : 2000 }; var response = await client.GetResponseAsync(messages, options, ct); return (route, response.Text); } private static string SystemPromptFor(StepKind kind) => kind switch { StepKind.Plan => "You plan code changes. Produce numbered steps. Each step names the files it touches.", StepKind.Execute => "You apply one planned step exactly. If the code does not match the plan, say so instead of guessing.", StepKind.Verify => "You review a diff against its plan. Be specific. End with ACCEPT or REJECT on the last line.", _ => throw new ArgumentOutOfRangeException(nameof(kind)) };}A few choices worth explaining. The executor gets no tools at all, which is the .NET version of “no Bash”. Verification is a routing rule, not a convention. Swapping EXECUTOR=local for EXECUTOR=hosted changes one environment variable, which is the point: I want to compare cost per accepted change between the two on my own tasks without rewriting anything. And TouchesPublicApi is the kind of flag I would expect to grow over time; any step a human has had to redo twice probably deserves its own escalation rule.What I would put in the team README1. Never set CLAUDE_CODE_EFFORT_LEVEL in shared configs. It overrides every agent's effort: line.2. Set CLAUDE_CODE_SUBAGENT_EFFORT=low (2.1.316+) so unconfigured subagents stop copying the main session's effort. Check your version first.3. Every agent in .claude/agents/ declares tools:. Read-only by default.4. Lookup agents: effort low. Review agents: effort high. Write it in CLAUDE.md too.5. Executors run on a cheaper model and have no Bash. The main session runs tests and decides.6. Agent teams only when teammates actually need to talk to each other. Budget roughly team size, and treat Anthropic's 7x (plan mode) as real.7. Background agents are not free even when idle-looking. If you run many, check your version's notes on agent_summary.8. Long transcripts are rent. End and restart subagents rather than letting one grow all afternoon.9. Report cost per accepted change, not cost per call or per session. An accepted change is merged and not reverted within an agreed window.What I am still unsure aboutThe biggest gap: none of the sources here measure quality loss at low effort. Wmedia’s test shows the token difference on one explanation task. Nobody in this week’s reading shows what an explorer at low effort misses compared with high, or how often a cheap executor’s edit needs rework. Jain’s experiment is the closest thing, and it measures model and harness, not effort, and comes from someone with a commercial interest in the harness. I am setting effort: low on lookups because it seems reasonable, not because anyone has shown it is safe.I am also unsure about the precedence details holding still. Two rungs of the ladder changed in the last month (the per-call parameter in 2.1.292, the subagent fallback in 2.1.316). I would re-read the docs page before trusting this table in a month.And I do not know how much of the status line cost is fixed in the version you are running. The reports disagree about both the size of the problem and which release addresses it.What I am fairly confident about is the direction. Effort and model are per-agent decisions now, and the default of “copy whatever the main session is doing” is the expensive one.SourcesThe Code, Sunday Special, 8 November 2026 (newsletter; Boris Cherny’s X post via newsletter summary; /usage "press f" claim unverified)Claude Code subagents docs: https://code.claude.com/docs/en/subagentsPasquale Pillitteri, CLAUDE_CODE_SUBAGENT_EFFORT write-up: https://pasqualepillitteri.it/en/news/28714/claude-code-subagent-effort-variable-sub-agentsWmedia, subagents at low effort (author-run token counts): https://wmedia.es/en/tips/claude-code-subagents-cheaper-low-effortModel resolution order summary: https://alexcloudstar.com/blog/claude-code-subagents-guide-2026/Flamerix AI gist on agent_summary: https://gist.github.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efceLevel Up Coding, “15% of my bill was a status line” (author-run): https://levelup.gitconnected.com/i-ran-a-background-check-on-claude-codes-agents-15-of-my-bill-was-a-status-line-e0e8b7eb4769Claude Code team response summarized here: https://www.buildmvpfast.com/blog/claude-code-background-agent-tokens-agent-summary-2026Automation Labs on the 7x agent-teams figure (doc-based): https://medium.com/@automation.labs/claude-code-subagents-vs-agent-teams-vs-workflows-one-costs-7x-912f547d8bb7Max Woolf: https://minimaxir.com/2026/10/cheap-llms/exe.dev, “Expensively Quadratic”: https://blog.exe.dev/expensively-quadraticMartin Alderson, “Watch out for cache read costs”: https://martinalderson.com/posts/watch-out-for-cache-read-costs/Wasowski on rework rate and cost per accepted change (Jain’s numbers, Specmatic conflict flagged): https://medium.com/gitconnected/spec-driven-development-spec-rework-rate-and-cost-per-accepted-change-instead-of-ai-agent-speed-43e4718a1d86Cekikj on Microsoft’s agent harness (author-run): https://aiadvances.org/the-agent-harness-explained-what-microsoft-shipped-and-how-to-build-on-it-in-python-f07081f40f4cTags: ClaudeCode, AIAgents, LLMCost, Subagents, DotNet, MicrosoftExtensionsAI, Ollama, DeveloperProductivity, PromptCachingThe Effort Leak: Why Your Subagents Cost as Much as Your Main Session was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.