Code Tycoon Get Code Tycoon

Blog / Sessions

Claude Code Subagents vs Sessions vs Worktrees: Our Data

708 of our Claude Code sessions measured: what subagents cost, how much context they kept out, and when parallel sessions or worktrees are the better choice.

Claude Code Subagents vs Sessions vs Worktrees logos side by side

In 708 of our own Claude Code sessions, subagents carried 18.1% of list-price cost. A typical subagent run took in 152,803 characters of tool output and handed back 2,501, a ratio of 65 to 1. Per task it cost about the same as a separate session.

The short answer. Use a subagent when a job produces far more raw output than you need back: in our data the median run grew its own context by 109,002 tokens and returned a message of about 2,500 characters. Do not use one to save money per task. A general-purpose subagent run had a median cost of $1.78, against $1.73 for a one-prompt session. Use a parallel session when you want to read, answer or steer the work. Add a worktree as soon as two sessions share a repository: in our collision data, 13.2% of edited files were edited by more than one session, and 1.5% of all edits landed within 10 minutes of another session's edit to the same file.

The numbers below come from one small team's transcripts, the team that builds Code Tycoon. The method section says exactly what was counted and what was left out.

Table of contents

Key findings

  • 50 of 708 sessions (7.1%) started at least one subagent. In October it was 10 of 265 sessions; in November, 40 of 443.
  • Those 50 sessions started 326 subagent runs: a median of 3 per session, a mean of 6.5, and a maximum of 40. Ten sessions account for 214 of the runs.
  • Subagents processed 19.5% of all tokens and 18.1% of list-price cost: $1,106.76 of $6,120.32.
  • The median subagent run made 26 model requests and 38 tool calls over 7.9 minutes, processed 3.35 million tokens, and cost $1.66 at list price.
  • The median run grew its context from 58,144 tokens at its first request to 170,417 at its last, and returned a final message of 2,501 characters.
  • Per million tokens, subagent work cost $0.41 and main-session work $0.45. Subagents are not a cheaper way to process tokens.
  • A general-purpose subagent run cost a median $1.78. A one-prompt session cost $1.73, and a task session in its own git worktree cost $2.82.
  • 23 web-fetch subagents on Haiku cost $0.35 in total, under one cent each at the median.

Prices are Anthropic's published API rates from its pricing page, checked 2026-11-23. Costs are list-price equivalents, explained in the next section.

How we counted

Claude Code writes one transcript per session under ~/.claude/projects/<project>/<session>.jsonl. Subagent runs get their own files in <session>/subagents/agent-*.jsonl, with a small metadata file naming the agent type. A script read both on 2026-11-26 and kept only totals: no prompt text, file paths, project names or result text left the machine, and none appears here.

Item Value
Period covered 2026-10-02 to 2026-11-26
Project folders read 2,195 of 5,362
Sessions with model usage 708
Subagent runs with model usage 326
Model requests, main sessions counted once each by message ID
Main-session cost, list price $5,013.56
Subagent cost, list price $1,106.76

What was left out, and why:

  • 3,167 throwaway folders were skipped: temporary directories, scratch folders, the folders of automated summarizer calls, and demo copies of transcripts. Most are one-off scripted calls, and the demo copies would count the same sessions twice.
  • Every API message is counted once by its message ID, so a resumed session that copies earlier messages adds nothing twice.
  • Sessions that ran in a .claude/worktrees/ checkout get their own project folder. Each is a separate session, so they are counted with the rest.

Tokens processed means input plus cache reads plus cache writes plus output, summed over every request. That is how a session is billed, so a 150,000-token context read back 26 times counts 26 times.

Cost uses Anthropic's per-million rates checked 2026-11-23: Opus 5.5 at $4 input, $20 output and $0.20 for cache reads; Sonnet 5.5 at $2, $10 and $0.10; Haiku 5.5 at $0.10, $0.50 and $0.01 for prompts up to 100,000 tokens. Cache writes are 1.25 times the input price for 5-minute entries and 2 times for 1-hour entries, read from each request's own usage record.

These are not amounts anyone was billed. On a Pro or Max plan you pay a flat fee, and the figure shows what the same usage would cost on the API. Prices change, so check the pricing page before you budget from these numbers. They describe one team's usage.

This is the same team and transcript folder as our file collision study and monthly cost breakdown. Session counts differ a little from those posts because this one skips the temporary folders and runs three days later.

How often sessions use subagents

Most sessions never started one. 658 of 708 sessions ran with no subagent at all.

Use grew over the period. In October, 3.8% of sessions started a subagent (10 of 265). In November, through the 26th, it was 9.0% (40 of 443). Most of the runs came from a handful of sessions that handed jobs out to several background subagents at once.

Use is concentrated. The median session that used subagents started 3, but the 90th percentile started 18 and one session started 40. Ten sessions account for 214 of the 326 runs, about two thirds.

Measure Value
Sessions that started a subagent 50 of 708 (7.1%)
Runs per session that used them median 3, mean 6.5, 90th percentile 18, max 40
Sessions with 5 or more runs 17
Runs started in the background 287 of 326 (88%)
Runs started by another subagent 20

The background share stands out. Claude Code's subagent docs say "Background subagents run concurrently while you continue working," and foreground ones "block the main conversation until complete" (checked 2026-11-23). In this team's hands, subagents were mostly a way to run work in parallel from one session, closer to what people use parallel sessions for.

Twenty runs were started by another subagent. The same docs say a subagent can spawn its own "up to three layers below the main conversation" by default, so nesting happens, but rarely.

What subagents cost

Subagents carried a fifth of the work. They processed 19.5% of all tokens (2.69 billion of 13.79 billion) and 18.1% of list-price cost.

That share sits on 7.1% of sessions, so inside the sessions that use them, subagents are a large part of the bill. The median such session spent 26.5% of its cost in subagents. A quarter of them spent more than 62.1%.

Agent type Runs Total cost Median cost per run Median tokens per run
General-purpose 292 $1,086.72 $1.78 4.03 million
Web-fetch 23 $0.35 $0.008 75,395
Explore 6 $5.98 $0.85 0.95 million
Fork 3 $12.81 $5.70 16.2 million
Plan 1 $0.89 $0.89 1.10 million
Claude Code guide 1 $0.01 $0.01 201,689

General-purpose runs are 98% of subagent cost. They inherit the conversation's model, which here was mostly Opus 5.5: 246 runs used Opus 5.5, 56 used Sonnet 5.5, and 24 used Haiku 5.5. The cheap rows are the built-in helpers that the docs say run on Haiku, such as web-fetch.

One run had a median of 26 requests, 38 tool calls and 7.9 minutes of wall time. At the 90th percentile it was 101 requests and $8.60. The most expensive single run cost $18.36.

Per token, subagent work is not cheaper. Subagent tokens cost $0.41 per million and main-session tokens $0.45 per million. Both are dominated by cache reads: 97.1% of a subagent's input-side tokens and 97.5% of a main session's were cache hits. The small gap comes mostly from the Sonnet and Haiku runs.

One cost quirk is worth knowing. Claude Code's prompt caching docs give the main conversation a one-hour cache on a subscription, while subagents get five minutes by default (checked 2026-11-23). A subagent that pauses longer than that pays to write its context again. If you want a model other than the conversation's, the docs let a subagent name its own; our Sonnet vs Haiku comparison works through the price gap.

How much context a subagent keeps out

This is what subagents are for. The subagent docs say each one runs "in its own context window" and "returns only the summary" (checked 2026-11-23). Our transcripts show how big that gap is.

Measure, median run Value
Context at first request 58,144 tokens
Context at last request 170,417 tokens
Growth during the run 109,002 tokens
Tool output read (file reads, searches, command output) 152,803 characters
Final message handed back 2,501 characters
Tool output read per character returned 65 (quartiles 32 and 151)

So the median run read 65 characters for every one it returned. A quarter of runs returned less than one character per 151 read.

Compare that with the main sessions. The median main-session request carried 196,807 tokens of context, and the 90th percentile 508,770. One median subagent run, done inline, would have added 109,002 tokens to that, more than half again.

Context that stays costs money on every later request. Claude Code's costs page says it "sends your full conversation with every request" (checked 2026-11-23). At Opus 5.5's cache-read price of $0.20 per million, 109,002 extra tokens cost about 2 cents per later request. That sounds small, and over a long session it adds up. Our main sessions had a median of 37 requests, and those that used subagents a median of 125.

Price is not the only cost. A bigger context fills sooner, and then you compact or clear, which is the trade-off in our post on when to /clear and when to /compact. Keeping 100,000 tokens of grep output out of the main conversation pushes that moment back.

There is also a saving during the job. A subagent starts small: 58,144 tokens at its first request against 196,807 for a median main-session request. Done inline, each of the run's 26 requests would have re-read about 138,663 more tokens of main-session context. At the cache-read price that is about $0.72 per job. This is arithmetic on two medians. It only applies when the main session is already large.

Subagent or separate session for the same job

Many jobs could go either way: a review, a refactor of one module, a research question. Here is what each choice cost in our data.

Unit of work Count Median cost Median tokens processed
General-purpose subagent run 292 $1.78 4.03 million
Session with one human prompt 225 $1.73 2.09 million
Task session in its own git worktree 27 $2.82 4.34 million
Web-fetch subagent run (Haiku) 23 $0.008 75,395

The jobs in each row were different, and nobody matched them one to one. Still, the medians are close. A general-purpose subagent and a one-prompt session cost about the same per job. The worktree task sessions cost more because they were larger jobs handed out by a task board, each ending in a commit.

Start-up cost differs a little. A new session's first request carried a median 83,198 tokens and cost $0.41, mostly to write the system prompt, tools and project instructions to cache. A subagent's first request carried 58,144.

Sessions that used subagents were far more expensive overall: a median $21.64, against $3.96 for sessions without. Big jobs are the ones that get split up, so this shows where subagents get used. It says nothing about what they add to a bill.

So price per job does not decide it. Three questions do:

  1. Do you need to steer the work? A subagent runs to completion; a session can be answered, interrupted and resumed.
  2. Do you need its raw output in the main conversation? If not, a subagent keeps it out.
  3. Will it edit files another session is also editing? Then it needs its own checkout, whichever you choose.

Running several sessions at once has its own overhead: each one needs prompts answered and results checked. Our guide to running several Claude Code sessions in parallel covers that side, and the notification hook post shows how to get pinged when a session waits.

Where worktrees come in

Subagents and sessions decide who does the work. Worktrees decide where the files live. Git's worktree manual says "A git repository can support multiple working trees, allowing you to check out more than one branch at a time" (checked 2026-11-23).

Our collision study, on the same team's transcripts, gives the numbers that matter here:

Measure (2026-10-02 to 2026-11-23) Value
File edits 13,412
Distinct files edited 4,498
Files edited by more than one session at some point 593 (13.2%)
Same file, two sessions, within 10 minutes 39 files, 196 edit events (1.5% of edits)

Source: How often parallel Claude Code sessions collide.

About one edited file in eight was touched by more than one session. Close-in-time collisions were rare. As the collision post explains, a few can still matter: one lost edit to a central file costs more than many clean ones.

Claude Code has worktrees built in. Its worktrees docs say "Pass --worktree or -w with a name to create a worktree and start Claude in it," and they land under .claude/worktrees/<name>/ (checked 2026-11-23). The 27 task sessions in the cost table above ran in checkouts under that folder, created by a task board.

Subagents can use one too. The subagent docs describe an isolation field: "Set to worktree to run the subagent in a temporary git worktree," branched "by default from your default branch rather than the parent session's HEAD," and "automatically cleaned up if the subagent makes no changes" (checked 2026-11-23). That matters for our data: 88% of runs were in the background, often several at once, and each one that edits files is in effect a parallel session sharing your checkout.

Worktrees have limits. They stop two sessions writing to the same files on disk, but not two branches changing the same lines; that shows up at merge. Git's manual also warns that "the support for submodules is incomplete."

The three in one table

Subagent Parallel session Worktree
What it separates Context window Conversations you can steer Working files and branch
What comes back A final message (median 2,501 characters in our runs) The whole conversation A branch to merge
Median cost per job, our data $1.78 general-purpose, $0.008 web-fetch on Haiku $1.73 one-prompt session No model cost; disk and setup
Share of our cost 18.1% 81.9% (main sessions) Not a cost item
Collision risk Shares the parent's checkout unless isolation: worktree High if two share one checkout Low on disk; conflicts move to merge
Main source Subagent docs Costs page Git worktree manual

Documentation quotes and links were checked 2026-11-23; cost figures are our transcripts at list price, read 2026-11-26.

What this means for how you split work

Five working rules follow from the numbers. They are our reading of one team's data.

  1. Send a subagent when the raw output is big and the answer is small. Searches, reviews, test runs and doc lookups fit. Our median run read 65 characters for each one it returned, and kept about 109,000 tokens out of the main session. If the job is a fixed procedure rather than open-ended digging, a skill may suit it better; how skills, subagents and slash commands differ in Claude Code covers that choice.

  2. Do not delegate to save money per task. At the same model, a subagent and a fresh session cost about the same per job. The money saved is in the main session's later requests and in compacting less often, and it is largest when the main context is already big.

  3. Put helper subagents on a cheaper model. The web-fetch runs on Haiku cost under a cent each. General-purpose runs inherit your conversation's model, which in our case meant Opus 5.5 for most of them. For the price gap, see Opus vs Sonnet in Claude Code.

  4. Pick a session when you need to steer. A subagent runs and reports. A session lets you answer questions halfway and change course, at the price of your attention.

  5. Give anything that edits files its own checkout. That includes background subagents. With 13.2% of files shared across sessions over seven and a half weeks, assume some of today's tasks will touch the same file.

Each of these is cheap to try. If you want to see which of your own sessions and subagents cost what, and which ones touch the same files, self-host Code Tycoon with npx code-tycoon; it reads the same transcript folders locally.

What the data cannot show

These limits matter as much as the numbers.

It is one team

The team runs many short, single-task sessions, mostly on Opus 5.5, and a few of its sessions handed many jobs out to background subagents at once. A developer who uses subagents only for a quick search now and then will see much smaller runs.

The jobs were not matched

The subagent-versus-session table compares medians of different jobs. A controlled test would give the same task to both and compare. The figures show the order of magnitude only.

Returned size is the final message

We measured the subagent's last text message, which is what returns to the parent. How much of it the parent then quoted, used or ignored is not in the data.

Saved cost is an estimate

The $0.72 per job and 2 cents per later request come from multiplying medians by the cache-read price. Actual savings depend on how long the main session runs after the subagent finishes.

It covers eight weeks

October to late November 2026. Claude Code changes quickly, and so did how this team used it.

Frequently asked questions

What is the difference between a subagent and a parallel session?

A subagent runs inside one session in its own context window and hands back one final message. In our data that message had a median of 2,501 characters. A parallel session is a separate Claude Code conversation that you read and steer yourself.

Do subagents use my usage limits?

Yes. Anthropic's costs page says "The subagent's own requests still draw on your usage." In our transcripts subagents carried 18.1% of list-price cost and 19.5% of tokens, so they are a large part of the bill.

Are subagents cheaper than running another session?

Not per job in our data. A general-purpose subagent run had a median cost of $1.78 and a one-prompt session $1.73. Per million tokens, subagent work cost $0.41 and main-session work $0.45.

How much context does a subagent save?

The median run in our transcripts grew its own context by 109,002 tokens and read 152,803 characters of tool output, then returned 2,501 characters. That is 65 characters read for each one returned, kept out of the main conversation.

How many subagents does a session usually start?

Most of our sessions started none: 50 of 708 used subagents. Those 50 started a median of 3 runs each, a mean of 6.5, and a maximum of 40.

Do I need worktrees to run two Claude Code sessions?

You do if both work on the same repository and might edit the same files. In our transcripts 13.2% of edited files were edited by more than one session. Claude Code creates a worktree with claude --worktree followed by a name.

Can a subagent run in its own worktree?

Yes. Set isolation: worktree in the subagent's definition. It gets a temporary worktree branched by default from your default branch, not from the parent's HEAD, and it is cleaned up automatically if the subagent makes no changes.

The bottom line

Subagents buy you a smaller main context, not a cheaper task. In our 708 sessions, a subagent read 65 characters for each one it handed back and cost about what a separate session cost for a similar job. Use one when the raw output is big and the answer is small. Use a session when you need to steer. Use a worktree for anything that edits files next to another session, background subagents included.

To see the same numbers for your own transcripts, self-host Code Tycoon for free, or get your server to run sessions with the laptop closed.

Related articles


About this research

Anton Goldshtein is a two-time founder who previously bootstrapped a company to $100M in revenue. His team runs its own products on Code Tycoon every day.

The figures come from the team's own Claude Code transcripts, read on 2026-11-26 and covering 2026-10-02 to 2026-11-26: 708 sessions and 326 subagent runs, reduced to totals with no prompt text, file paths or project names. Costs are list-price equivalents using Anthropic's pricing page as checked 2026-11-23; documentation quotes were checked the same day. Collision figures come from our earlier study of the same transcripts.

Content reviewed and updated: 2026-11-26


Keep reading