Guides

How to Save 40% of Tokens in Your Coding Workflow

One Opus 5.5 orchestrator sends task briefs to four Claude Code subagents, a Haiku scoper and researcher, a Sonnet implementer and an Opus reviewer, cutting the cost per delivered change from $3.59 to $2.14

Keep your main coding session small and send the verbose work to short-lived subagents. When we split Claude Code work between one Opus 5.5 orchestrator and four specialist agents on Haiku 5.5, Sonnet 5.5 and Opus 5.5, the API-equivalent cost of a delivered code change fell from $3.59 to $2.14, about 40%.

We expected Sonnet 5.5's lower price per token to carry that saving. The numbers point at the main session instead: it made 54 requests per session instead of 75, at 107,000 tokens of context per request instead of 119,000, while each session shipped more code.

Measured on a Claude Pro subscription, October 2026
API-equivalent cost per delivered code change
Opus 5.5 alone
24 sessions
$3.59
Opus 5.5 with subagents
10 sessions
$2.14
About 40% less per change
75to54requests per session in the main context
119kto107kaverage tokens of context per main-session request
10%to6%of a five-hour usage window per delivered change
Main session on Opus 5.5 at medium effort in both setups. Dollar figures are the API-equivalent estimate Claude Code reports per session, not the subscription price paid. One change is one code change shipped for review.

Where do the tokens go in a coding session?

A coding agent works in turns. Each turn sends the whole conversation so far, plus the system prompt, to the model. The conversation grows with every file read, test run, error message and fix, so by the fortieth turn of a feature a single request can carry over 100,000 tokens of history, most of it irrelevant to the question being asked.

Prompt caching lowers the price of that history without removing it. A cached prefix is billed at a fraction of the input price, 5% on Opus 5.5 and Sonnet 5.5 according to Anthropic's pricing page, yet every cached token is still paid for on every turn, and any change to the start of the prompt, such as an edited system prompt or a compacted history, writes the cache again. Output quality also drops late in a long session, as the context fills with stale detail. The bill and the drop in quality come from the same history.

The expensive part of an implementation task is the loop in the middle: edit, run the tests, read the failure, edit again. That loop produces thousands of tokens nobody needs once the tests pass, and in a single session every one of them is re-sent on every later turn. Context engineering is the wider discipline of deciding what a model sees; this setup applies it to your own coding sessions.

What did splitting the work save?

We measured both setups on a Claude Pro subscription over several weeks in October 2026, using the API-equivalent cost Claude Code reports for each session. The main session ran Opus 5.5 at medium effort both times. The only difference was whether implementation, scoping and shipping went to subagents on Sonnet 5.5 and Haiku 5.5.

MeasureOpus aloneWith subagents
Cost per delivered change$3.59$2.14
Sessions measured2410
Lines added per session248392
Usage window per changeAbout 10% of five hoursAbout 6% of five hours
Context per main request119,000 tokens107,000 tokens
Requests per session7554

On the five-hour usage window, that moves a subscriber from about 10 delivered changes per window to about 16. The scoping agent joined late in the measurement, so most delegated sessions used the implementation agent alone, and the sample is small: ten delegated sessions on one personal subscription with a light system prompt. A heavier instruction set in your main session should make the main-context saving larger, but test that on your own work before you quote it.

The architecture: one orchestrator and four subagents

One session acts as the orchestrator. It holds the plan, talks to you, and reviews routine results. Four specialist subagents, the workers, do the context-heavy work. Each one starts with an empty context, reads one short project brief, does its job and returns a report in a fixed shape. The orchestrator sees the report and nothing else.

The architecture, tap any agent
One orchestrator, four agents that start empty
Humangoal, decisions
task brief outshort report back

Implementer Sonnet 5.5

Brief out
Goal, acceptance criteria, file list, decisions already made, validation commands.
Report back
Changes, validation, notes. Typically 20 to 40 lines.
Tools
Read, Write, Edit, Grep, Glob and a shell. Fixes until the tests pass or two rounds fail.
Context
Starts empty, reads the shared brief, and is thrown away after the report.
RoleModelJobReturns
OrchestratorOpus 5.5The session itself. Plans, routes work, reviews routine diffs, talks to the human.Decisions
ScoperHaiku 5.5Turns a task into facts before planning: files with line numbers, acceptance criteria, risks. Plan mode, 12 turns.Goal, acceptance criteria, relevant code, scope, validation, risks, possible split
ResearcherHaiku 5.5Facts from outside the repository: library behaviour, API contracts, version differences, error messages.Question, answer, sources, confidence, open points
ImplementerSonnet 5.5Builds exactly the plan it is given, runs the validation commands, fixes until green or two rounds fail.Changes, validation, notes
ReviewerOpus 5.5Risky changes only: security, concurrency, data migrations, state machines, payment logic, public APIs.Verdict, findings, not checked

Why does this setup cost less?

Context isolation

According to the Claude Code subagent documentation, each subagent starts with a fresh context window that holds none of your conversation, and returns only its summary. The implementer's edits, test output and fixes stay in its context and disappear when it reports. The orchestrator's history grows by one report of typically 20 to 40 lines instead of by the whole loop.

Reports, not transcripts

Every worker returns the same fixed sections every time, so the orchestrator never parses a narrative or pastes worker output into its own context. The fixed shape also makes the small models more reliable, because the headings tell them what counts as done.

One model per role

Fact finding and documentation lookup need a model that cites paths and URLs and admits when it does not know, which is Haiku 5.5 work at $0.10 per million input tokens on prompts up to 100,000 tokens. Implementation needs a model that can hold a plan and a test loop, so it runs on Sonnet 5.5. Judgment on risky changes gets Opus 5.5, and only there. Matching the model to the role saves less than context isolation does, and it costs nothing once the roles exist. Our benchmark of Haiku, Sonnet and Opus as Claude Code subagents graded which delegated jobs each model can carry.

Hub and spoke, with no nesting

Claude Code lets a subagent start subagents of its own, up to three layers deep by default. Here every worker's tool list leaves out the Agent tool, so every handoff passes through the orchestrator. Nested delegation hides cost, because a worker starting a worker is invisible to you, and it lets two agents bounce a task between them. With a hub you see every dispatch and every report in one place.

Resume instead of respawn

When a review finds a problem, the fix goes back to the same implementer by name. A resumed subagent keeps its full history, including the files, the failing test and its own decisions, so the fix costs a fraction of a fresh run. In Claude Code the orchestrator resumes it with its agent ID or name.

When should the orchestrator delegate?

Delegation does not happen on its own. A model with a capable context does the work itself unless it has standing rules, so the rules live in the project's instruction file, where the orchestrator reads them at the start of every session. These are the ones that held up.

The delegation rules, pick a task
Who gets this task?
SCOScoper firstUnfamiliar code, or more than three files not yet read, goes to the scoper before any plan. Spot-check two file paths from its report, because small models misremember paths.
  • Bug in code nobody has read yet: Scoper first. Unfamiliar code, or more than three files not yet read, goes to the scoper before any plan. Spot-check two file paths from its report, because small models misremember paths.
  • How does this library retry?: Researcher. Library, API and framework questions go to the researcher. A documentation page is thousands of tokens that would otherwise sit in the main context for the rest of the session.
  • Rename a field in two open files: Orchestrator, directly. A change under about twenty lines in files already in context costs less to make directly than to write a brief for.
  • Build an endpoint from an agreed plan: Implementer. Send the goal, acceptance criteria, file list, decisions already made and the validation commands. The orchestrator then reviews the diff itself.
  • Change the payment logic: Implementer, then Reviewer. Payment logic is on the risky list with security, concurrency, data migrations, state machines and public APIs, so the Opus 5.5 reviewer reads the diff.
  • Tests still red after two fix rounds: Back to the human. Two fix rounds per task, then stop and show the human the diff and the failing output. An unbounded retry loop spends the saving.
  • A feature across three subsystems: One implementer per slice. Split the work into slices and run one implementer per slice, so no single worker context grows into the problem the design avoids.
  1. Unfamiliar code, or more than three files not yet read: send the scoper first, and spot-check two file paths from its report before planning on it.
  2. Library, API or framework question: send the researcher. The orchestrator never fetches web pages itself.
  3. Edits: send the implementer with the goal, acceptance criteria, file list, decisions already made and validation commands. Make a change under about twenty lines in files already in context directly.
  4. Review routine diffs in the orchestrator. The reviewer runs only for risky changes or on request, because a second strong-model pass on a routine change costs about as much as the change itself.
  5. Allow two fix rounds per task, then stop and show the human the diff and the failing output.
  6. Split work that spans several subsystems into slices, with one implementer run per slice.

How to set up Claude Code subagents for this

Claude Code reads subagent definitions from Markdown files in a .claude/agents/ folder, in the project or in your home directory. The frontmatter sets the model, the tools and the limits, and the body is the agent's system prompt. The scoper looks like this.

One agent definition
.claude/agents/scoper.md
--- name: scoper description: Use proactively at the start of any non-trivial coding task when the relevant code is unfamiliar or more than 3 unread files are involved. Read-only. Returns goal, acceptance criteria, relevant code with paths, scope, validation commands and risks. model: haiku effort: medium tools: Read, Grep, Glob, Bash permissionMode: plan maxTurns: 12 memory: local --- You turn a task into facts the orchestrator can plan from, without editing anything. Every claim cites a file path. Confirm each path exists before reporting it. Unknown is a valid answer. Report in exactly this shape: ## Goal ## Acceptance criteria ## Relevant code ## Scope ## Validation ## Risks and unknowns ## Possible split
descriptionThe only thing the orchestrator reads when it decides whether to delegate, so it names the conditions a real task would show.
modelPins the role to a tier. Haiku 5.5 lists at $0.10 per million input tokens, Sonnet 5.5 at $2 and Opus 5.5 at $4.
toolsAn allowlist. Agent is missing from it, so the scoper cannot start agents of its own.
permissionMode, maxTurnsPlan mode keeps it read-only and twelve turns stop a confused run from wandering.
  1. Write one file per role in .claude/agents/, each with a model, a tool list no wider than the job, and the exact report headings in its prompt.
  2. Leave the Agent tool out of every worker's tool list.
  3. Keep the shared brief under 80 lines: the stack, the install, test, lint and build commands, the conventions, and the roster with what each role returns. Every worker reads it first and pays for every line.
  4. Have the orchestrator fill the brief's gaps once, from the manifest and the README, and ask you for anything still unknown. A wrong test command costs more than one question.
  5. Let the implementer and the reviewer load the project's CLAUDE.md, so permission rules, coding standards and review checklists bind every change. Custom subagents load it by default; set omitClaudeMd: true only on the read-only scoper and researcher.
  6. Put the delegation rules in the project's instruction file.

The CLAUDE.md step is the one place where saving tokens trades against correctness, and correctness wins. Default model and effort live in a settings file: the committed .claude/settings.json changes cost and behaviour for everyone who opens the repository, the uncommitted .claude/settings.local.json for one engineer. A setup script should write to the local file, show what it would write first, and touch the shared file only once the team agrees. The Ovidius Academy lists Anthropic's own Claude Code and subagent courses if your team is new to the format.

Where the pattern goes wrong

Five sessions instead of one plus four agents. Each live session carries the full system prompt, instruction files, skill listings and tool catalogue on every turn, so five of them multiply the baseline the design exists to shrink. Subagents start empty and sessions do not.

Trusting the scoper's paths. Small models invent plausible file names. The orchestrator spot-checks two before it plans, and the scoper's prompt makes it confirm every path exists.

Reviewing everything with the strongest model. The saving depends on the orchestrator reviewing routine diffs itself. A reviewer that runs on every change doubles the Opus 5.5 spend.

Workers that decide architecture. The implementer is told to stop and report when the plan would need an architectural decision. A worker that redesigns in a context nobody watches produces expensive surprises.

Briefs that grow. Every spawn reads the shared brief, so every line added to it is paid for by every worker, every time. Keep facts in it and move explanations elsewhere.

Workers that nest. One worker whose tool list includes the Agent tool is enough to bring nesting back. The same discipline applies to agents that act on live systems, where guardrails that stop an agent before it acts do the work of the tool allowlist.

How to measure token use in your own codebase

The Claude Code status line hands your script a JSON payload with cost.total_cost_usd, the estimated session cost at list price, and, for Pro and Max subscribers, rate_limits.five_hour.used_percentage and rate_limits.seven_day.used_percentage. Append those to a log file whenever they change and you have a per-session record of window usage and API-equivalent cost.

Then compare two groups of sessions on the same kind of work, one with delegation and one without. That is enough to see whether the pattern pays off in your codebase. The estimate can differ from your actual bill, so compare the two groups with each other, not with an invoice. To put a monthly figure on agent runs across a team, the AI agent cost estimator takes runs per day and tokens per run.

Try it on your own numbers
AI Agent Cost Estimator

See what one run of your agent costs on each model before you commit to a build.

Estimate run costs

Frequently asked questions

How do I reduce token usage in Claude Code?

Keep the main session small. Send scoping, documentation lookups and the edit and test loop to subagents that start with an empty context and return a short fixed-shape report. In our measurement that cut the API-equivalent cost per delivered change from $3.59 to $2.14.

Do Claude Code subagents save tokens?

They do when they absorb verbose work the main session would otherwise carry on every later turn. Each subagent runs in its own context window and returns only a summary. They cost more than they save when you hand off small edits, so make changes under about twenty lines in files already open directly.

Which model should a Claude Code orchestrator use?

We ran the orchestrator on Opus 5.5 at medium effort, because it plans, routes and reviews routine diffs. The workers ran on Haiku 5.5 for scoping and research, Sonnet 5.5 for implementation, and Opus 5.5 only to review risky changes.

Can a Claude Code subagent start other subagents?

By default a subagent can start subagents of its own, up to three layers below the main conversation. Leave the Agent tool out of a subagent's tool list and it cannot, which keeps every handoff visible in the orchestrator.

How do I see what a Claude Code session costs?

Configure a status line. Its JSON payload includes cost.total_cost_usd and, on Pro and Max plans, the five-hour and seven-day usage percentages. Log those per session and compare sessions with and without delegation.

If you want this set up across your team's repositories, or agents built to the same discipline inside your own systems, Ovidius does that through AI agent development services and keeps them running under AI managed services. Book a discovery call to scope yours.

Put your first workflow on the board

Answer a few questions about your team and what you want automated, then Jason scopes it with you on the call.

Owen, Maciej, Jason, Oskar and Ben