INSIGHTS

Claude Code: Make the Main Thread the Orchestra Conductor and Delegate Every Job to a Subagent

Explains how to make Claude Code's main thread a coordinator that hands every task to subagents, picking sonnet or opus by difficulty.

Remzi Binar · 24 June 2026

What Is It For?

Write this directive in CLAUDE.md or give it as a prompt, and the way Claude works changes in every session:

“Do all the work I give you through the relevant subagent. The subagent should use sonnet or opus depending on how hard the task is. You (the main thread) orchestrate; the subagents run as background tasks.”

This directive solves three things at once:

  • Context isolation — discovery output, file dumps and log piles do not fill the main thread. The conductor sees only a summary.
  • Cost optimization — you don't run opus on every task. Mechanical work goes to sonnet, architectural work goes to opus.
  • Parallelism — subagents run in the background as tasks; two independent jobs move forward at the same time.

The main thread no longer opens files, runs grep or reads logs. It plans, distributes and merges the summaries that come back. That's all.

What is a subagent? An independent Claude instance that runs inside the main session, in its own context window. It reports only the result to you; the hundreds of lines it read along the way never enter your context. Splitting a task up and handing the pieces to such instances is called orchestration.

The Orchestra Conductor Model

In classic use, the main thread does everything itself: it opens the file, writes the code, runs the test. The output of every step piles up in a single context. In a long session the context bloats, the conductor gets tired, and quality drops.

In the orchestra model the roles change. The main thread doesn't do the work — it only coordinates:

                  ┌─────────────────────────┐
   Task arrives →  │   MAIN THREAD (Conductor)      │
                  │   • plan              │
                  │   • split             │
                  │   • distribute               │
                  │   • synthesize result     │
                  └───────────┬─────────────┘
                              │  (background task)
          ┌───────────────────┼───────────────────┐
          ▼                   ▼                   ▼
   ┌─────────────┐     ┌─────────────┐     ┌─────────────┐
   │  Explore    │     │ general-    │     │  custom role  │
   │  (Haiku)    │     │ purpose     │     │  (your own  │
   │  discovery      │     │ apply/     │     │  agent)  │
   │  read-only│     │ research     │     │             │
   └──────┬──────┘     └──────┬──────┘     └──────┬──────┘
          │ summary              │ summary              │ summary
          └───────────────────┼───────────────────┘
                              ▼
                  ┌─────────────────────────┐
                  │  CONDUCTOR synthesizes →        │
                  │  one coherent result       │
                  └─────────────────────────┘

Each job goes to the right subagent:

  • Discovery / “where is this code” / symbol search → Explore (with Haiku, read-only). Cheap and fast; it also can't change files by accident.
  • Complex work that needs implementation plus research → general-purpose (all tools). It both reads and writes.
  • Recurring special roles → agents you write yourself (under .claude/agents/ — reviewer, security, test-engineer...).

The conductor's context stays clean because the subagent returns a summary, not raw output. A 400-line grep result stays in the subagent's context; the conductor receives a line like “that function is at src/auth/jwt.ts:42”.

⚠️ A subagent cannot start another subagent. So the conductor must split the work correctly from the start — you can't say “split this one too” halfway; the subagent that takes the job runs it as a single piece on its own.

Model Choice: By Difficulty

This is the heart of the directive: the subagent picks its model by how hard the job is. A wrong choice hurts in both directions — running opus on every job burns money, and putting sonnet on an architectural job lowers quality.

Rough rule:

  • Easy / mechanical / generation work → sonnet (cheap, fast, enough)
  • Hard / architectural / ambiguous / high-risk work → opus (expensive but accurate)

Concrete mapping:

  • File/symbol discovery, “where is this” — Low difficulty → Haiku (Explore). Why: Read-only; the cheapest model is enough.
  • Boilerplate, CRUD endpoint, DTO — Low difficulty → sonnet. Why: The pattern is known, no creativity needed.
  • Writing tests (for existing code) — Medium-low difficulty → sonnet. Why: Behavior is clear, mechanical generation.
  • Mechanical refactor (rename, move) — Low difficulty → sonnet. Why: Deterministic, wide but shallow.
  • Bug fix (root cause known) — Medium difficulty → sonnet. Why: Limited scope, clear goal.
  • Bug fix (root cause unknown) — High difficulty → opus. Why: Ambiguous; reasoning needed.
  • Architecture decision / API design — High difficulty → opus. Why: Costly to reverse, heavy trade-offs.
  • Security / threat model — High difficulty → opus. Why: High cost of error, needs nuance.
  • Multi-file, interdependent refactor — High difficulty → opus. Why: Need to see the whole picture and manage risk.

Golden rule: if the cost of reversing the work is high, use opus. If you could fix a mistake in 5 minutes, use sonnet. When the decision affects the architecture, is ambiguous or high-risk, invest in opus; sonnet for the rest.

⚠️ When you leave model choice to Claude, put the difficulty signal inside the task. If you write it like “redesign this architecture”, it picks opus; if you say “rename this function”, it picks sonnet. A vague task description summons the wrong model.

How to Set It Up

There are two ways: permanent (every session) or one-off (in the prompt).

Permanent — write it in CLAUDE.md

Add the directive to the CLAUDE.md in the project root. It is loaded automatically in every session:

## Working Model

Do all the work I give you through the relevant subagent. You (the main thread)
orchestrate: plan, split, distribute, synthesize the result — do not open
files, write code or read logs yourself.

- Discovery / "where is this" → Explore (Haiku)
- Implementation + research → general-purpose
- Special role → the relevant .claude/agents/ agent

Let the subagent pick its model by how hard the job is:
- Easy / mechanical / generation work → sonnet
- Hard / architectural / ambiguous / high-risk → opus

Let subagents run as background tasks (progress in parallel).
Give every subagent a self-contained prompt — they don't see the history.
Don't assign two subagents to the same file; split file ownership in advance.

One-off — give it in the prompt

If you don't want to make it permanent, give the same instruction as a prompt at the start of the session. The only difference: you need to write it again after /clear.

Guaranteed invocation — @-mention

To guarantee that a specific agent runs, mention its name with @. You can also leave it to natural language, but then Claude decides based on description matching:

# Guaranteed — this agent runs:
@"dev-reviewer (agent)" review this diff: ...

# Left to judgment — Claude picks the suitable agent:
Could you have this change reviewed for security?

Tip: use @-mention for critical or recurring jobs — that way you control which agent runs with which model. Leave discovery and ordinary work to natural language; Claude delegates accurately.

A Practical Scenario

A single task being split by the conductor and distributed in parallel:

Scenario: "Add discount coupon support to the checkout flow."

CONDUCTOR (main thread) — does no work itself, splits it up:

  1) Explore (Haiku) → DISCOVERY
     "Where is the current checkout flow? Is there any coupon/discount code?
      Scan src/api/checkout/ and src/components/checkout/,
      find the payment calculation function. Return only a file:line list."

  2) general-purpose (sonnet) → BACKEND   [background task]
     "Write src/api/checkout/discount.ts: validate coupon + deduct amount.
      FILE OWNERSHIP: only under src/api/checkout/.
      Keep the existing PaymentService signature. (Mechanical, pattern is known.)"

  3) general-purpose (sonnet) → FRONTEND  [background task, parallel]
     "Add src/components/checkout/CouponField.tsx: input + apply button.
      FILE OWNERSHIP: only under src/components/checkout/.
      API contract: POST /checkout/coupon { code } → { discount }."

  4) opus → ARCHITECTURE DECISION (only if needed)
     "How should the coupon rules (percentage / fixed / min-cart / expiry)
      be modeled? It should be able to grow if 'multiple coupons' comes later.
      (Ambiguous + costly to reverse → opus.)"

CONDUCTOR: 2 and 3 finish in parallel → merges the summaries → synthesizes into a single PR.

Notice: 300 lines of discovery output stayed in Explore, and only a summary reached the conductor. Backend and frontend have different folder owners, so there is no conflict. The architecture question is separate and on opus — because the wrong model gets expensive here.

When to Use It — and When Not To

Use it when:

  • The task splits into independent parts (backend + frontend + tests)
  • Discovery/research would bloat the main context
  • A long session, context pressure is rising
  • Independent jobs would save time in parallel
  • The jobs differ in difficulty (some sonnet, some opus)

Don't use it when:

  • A single-step, mechanical job (fix one line, read one file)
  • The diff can be explained in one sentence
  • The jobs are strictly sequential and all touch the same file
  • The coordination load is bigger than the job itself
  • A very short session — setting up a conductor costs more than it gains

Golden rule: delegating to a subagent has a fixed cost (writing the prompt + bootstrap). If the job is smaller than that cost, doing it yourself is faster. Delegation wins on big or parallel work.

Common Mistakes

A subagent doesn't see your history. A half-empty prompt is the most common place people stumble.

  • The subagent asks “which file/project?” or does the wrong job — Cause: The prompt isn't self-contained; it refers to history like “what we just discussed”. Fix: Write the task from scratch with its context: path, contract and acceptance criteria inside the prompt.
  • Two subagents break the same file, one overwrites the other's change — Cause: File ownership wasn't assigned; both write in parallel (race). Fix: Give each subagent folder/file ownership; for a shared file, decide who writes first.
  • Simple job got slower, too many tokens burned — Cause: Orchestration was set up for a one-step job; coordination load ate the gain. Fix: The conductor does small/one-step jobs itself; save delegation for big/parallel jobs.
  • Quality dropped but the job went to sonnet — Cause: An architectural/ambiguous job fell to sonnet by mistake. Fix: Put the difficulty signal in the task description; if it's critical, force it with @-mention + opus.
  • Money burned, job was simple — Cause: Everything was run on opus. Fix: Explicitly route mechanical/generation work to sonnet.
  • The conductor's context bloated anyway — Cause: The subagent returns raw output (whole log/file). Fix: Add "return only a summary/file:line" to the prompt; keep the raw dump in the subagent.

⚠️ The most critical rule: a self-contained prompt. A subagent doesn't see the conversation you see. References like “the file from a moment ago” or “the API we talked about” are a void to the subagent. Write the path, the contract and the expected output every time.

Summary

  • Main thread = orchestra conductor. It doesn't do the work; it plans, distributes and synthesizes. Its context stays clean.
  • Each job goes to the relevant subagent: discovery → Explore (Haiku), implementation → general-purpose, special role → your own agent.
  • Model by difficulty: mechanical/generation → sonnet, architectural/ambiguous/risky → opus. A wrong choice hurts in both directions.
  • Subagents run as background tasks → parallelism + context isolation.
  • Conditions: a self-contained prompt, file ownership, and no delegation for small jobs.

Software is still engineering work; the orchestra model is just like managing a team — knowing where to put whom is half the job. The hammer is strong, but you still decide who drives which nail.

Sources

This post was first published on Medium.

Want this working in your business?

Start with a strategy call. Tell us what you need and we will suggest a next step.

Book a Strategy Call