PTENES
MODULE 3.1 · Track 3 · Model, cost, and orchestration

đŸŽšïž Model by task

Every subagent runs some model. Choosing the wrong one costs you in both ways: one Opus is wasted money for scanning files; a Haiku is wasted effort for deciding architecture. Matching the task to the right tier is the first cost-saving lever in Track 3.

6
Topics
~28
Minutes
Medium
Level
Decision
Type

Think of a auto repair shop. You don't call the chief engineer to change a tire — you send the assistant; it's quick and cheap. To rebuild the engine, that's when the master steps in. AI models work the same way: there's a low tier (fast, cheap, great for grunt work), a mid tier (the competent worker who builds and reviews) and a high tier (the master you only call on when the problem requires real reasoning). In Claude Code, these three are Haiku, Sonnet e Opus — and each subagent can run its own.

cost ↑ · reasoning ↑ · latency ↑ → Haiku scan · search · summarize $ · fast Sonnet build · review $$ · balanced Opus reasoning · security · architecture $$$ · deep

↑ The tier ladder: each step up adds reasoning power, but costs more and increases latency. Go only as high as the task requires.

Detailed content

1

⚡ Haiku — the grunt worker

Haiku is the tier cheap and fast. It shines at high-volume mechanical work: scan an entire folder, search a string across hundreds of files, summarize a huge log, read documentation and return the 5 points that matter. Tasks where the answer is “find and report,” not “think deeply.”

🔎 Haiku’s sweet spot

When the subagent is going to generate a reading wall that no one will reread — only the conclusion matters — you want the cheapest tier that gets the job done. Paying a lot for this is burning money on work that doesn't require intelligence:

  • ‱Scan — scan files/directories for a pattern.
  • ‱Search — locate where something appears in a large repository.
  • ‱Summarize — compress a log, a PDF, a transcript.
  • ‱Read docs — bring over the facts from a page without pasting the page.
What it is:

The lowest-cost, lowest-latency tier. It thinks shallowly but executes quickly and at scale—ideal for the "scavenging" work that feeds the rest.

Why learn:

Most of what a subagent does is disposable raw reading. Running that on Haiku cuts costs without affecting the quality of the final result.

Key concepts:

Cheap · fast · high volume · “find and report” · disposable mechanical work.

🔩
Scan
folders
🔍
Search
strings
đŸ—œïž
Summarize
logs
📚
Read docs
facts
2

🔧 Sonnet — the competent workhorse

Sonnet is the tier medium — the workhorse for day-to-day use. It builds (writes code, creates files, implements a step in a plan) and reviews (reads a diff and points out bugs). It’s smart enough for most real-world tasks and still much cheaper than the high tier. When you’re unsure, Sonnet is usually the safe default.

1

Receives a concrete task

Build or review something well-defined.

"Implement email validation in this form" or "review this diff and point out bugs and missing tests".

2

Executes competently

Good reasoning, reasonable cost.

Understands the intent, writes correct code, and follows the project’s conventions. It doesn’t need Opus’s boundary reasoning for that.

3

Deliver at the right pace

Quality × price balance.

The result is solid without running up the bill. That’s why Sonnet is the “default” tier for people who build and review all day.

📊 The sensible default

If you can’t justify why the task needs Opus, it almost always fits Sonnet. And if it’s just “find and report,” move down to Haiku. The mental exercise is always: how deeply does this task need to think?

What it is: the middle tier — smart enough to build and review, with controlled costs.
Why learn: is the default that covers most tasks; knowing this prevents the reflex to “put everything on Opus.”
Key concepts: build · review · safe default · quality/cost balance.
3

🧠 Opus — the master you call only when you need it

Opus is the tier expensive and slower, reserved for what truly requires deep reasoning: decisions about architecture, analysis of security, careful planning, debugging a problem no one understands. Here, the extra cost pays off: an architecture mistake costs far more than a few extra tokens.

đŸ›ïž

Architecture

Far-reaching decisions

"How should I structure this module?"—a choice that will matter for months.

🔐

Security

Where mistakes are costly

Finding an injection flaw or a leak requires thinking like an attacker.

đŸ§©

Difficult reasoning

Tangled problem

A bug that spans five files and has no obvious cause.

đŸ—ș

Planning

A plan for others to follow

Break a large task into steps that multiple subagents will execute.

⚖

Trade-offs

Weigh options thoroughly

Compare two approaches and justify the choice with nuance.

💎

The cost pays for itself

For rare, high-risk tasks, the expensive tier is the cheapest investment there is.

💡 Opus is the exception, not the default

A beginner’s instinct is "use the best model for everything." Wrong. Opus should be the minority of your subagents — only those whose decisions are costly to get wrong. For the rest, Haiku and Sonnet deliver the same result at a fraction of the price.

What it is: the maximum-reasoning tier, more expensive and slower, for high-risk decisions.
Why learn: Knowing when Opus is worth it (and when it isn’t) is what separates those who save from those who waste.
Key concepts: architecture · security · deep reasoning · justified exception.
4

📐 The three axes: reasoning × cost × latency

Moving up a tier isn’t just “getting smarter.” They’re three dials that move together: more reasoning comes with more cost and more latency (takes longer to respond). Choosing a model means deciding of each one the precise task — and stop paying for what it doesn’t use.

✓ Moving up a tier makes sense when


  • ✓The task requires reasoning that the tier below gets wrong
  • ✓The mistake is costly (architecture, security)
  • ✓The decision lasts a long time
  • ✓You can justify the extra cost

✗ Moving up a tier is wasteful when


  • ✗It’s just scanning, searching, or summarizing
  • ✗The output is disposable (nobody rereads it)
  • ✗You run this hundreds of times
  • ✗Latency matters (you want it fast)

⏱ Latency matters too

In a fan-out with 30 search subagents, a slow model multiplies the wait by 30. Haiku isn’t just cheaper—it’s more fast, and that changes how the system feels to use. A high tier on a trivial task makes you wait for nothing.

What it is: the three-axis trade-off every tier carries — reasoning, cost, and latency all rise together.
Why learn: choosing a model means balancing these three; you’ll only get it right if you see all three at once.
Key concepts: reasoning · cost · latency · "pay only for what the task uses".
5

đŸȘ€ The trap: the subagent starts with a blank slate

Here’s the detail that catches many people. The subagent doesn't inherit your conversation — it starts from scratch, with an empty window. Before producing anything, it needs to gather the context on its own: read the files, understand the terrain. This changes the calculation: part of its work is just “getting oriented,” and that reading work is exactly what a low-cost tier does well.

what the subagent sees when it starts blank window
# o maestro jĂĄ conversou com vocĂȘ por 1h.
# o subagente NÃO sabe nada disso. ele nasce assim:

contexto: (vazio)
tarefa:   "ache onde o login quebra nos 40 arquivos de /auth"

# 1Âș ele GASTA tokens sĂł pra se situar:
#   - lista a pasta /auth
#   - abre os 40 arquivos
#   - mapeia o fluxo de login
# SÓ DEPOIS ele começa a raciocinar sobre o bug.

# lição: essa fase de "reunir contexto" é leitura bruta
# → Ă© trabalho de Haiku, nĂŁo de Opus.

⚠ Why this is a cost trap

If you hand this entire task to Opus, you’re paying for the most expensive tier for a phase that is read-only (list a folder, open a file). Often, the ideal setup is to separate them: one Haiku gathers and summarizes the context, and only the final reasoning — if it's difficult, move up a tier. Don't pay for Opus to open files.

What it is: the subagent starts without context and spends effort just getting oriented before thinking.
Why learn: changes the model choice — the “gather context” phase is cheap reading, not expensive reasoning.
Key concepts: blank window · gather context · reading ≠ reasoning · separate the phases.
6

⚖ Big tasks are worth it; a 30s task is wasteful

There is a fixed cost to launch a subagent: it starts with a blank slate, gathers context, then works. For a large task, that cost is spread out—it’s worth it. For a 30-second microtask, the overhead of “getting oriented” is greater than the work itself: it’s wasteful. And for the common case, there’s an honest shortcut— inherit the parent's model.

✓ A subagent is worth it (large task)

  • ✓Read and cross-reference dozens of files
  • ✓Heavy research that produces a wall of output
  • ✓Work that runs in parallel (fan-out)
  • ✓The cost of getting situated is spread across the workload

✗ Waste (30-second task)

  • ✗Change a line you already have in front of you
  • ✗Answer something the orchestrator already knows
  • ✗Task where “gathering context” > the work
  • ✗Quick edit in the middle of a conversation

🧬 inherit-from-parent — the honest default

If you don’t declare model in the subagent, it usually inherit the parent's model (the orchestrator). This is the default behavior and is almost always reasonable: you only pin a model when you have a clear reason to diverge from the parent.

  • →Inherit — leave it without one model: the subagent runs on the conductor’s model. Safe default.
  • →Force downward — model: haiku in a search agent, even with an Opus maestro: efficiency.
  • →Force upward — model: opus in a security reviewer, even with a Sonnet maestro: quality where it matters.
What it is: the subagent has a fixed startup cost; inheriting the parent’s model is the default when you don’t want to choose.
Why learn: avoids spawning a subagent for a microtask and teaches when pinning the model is worth the effort.
Key concepts: fixed startup cost · large task × 30s · inherit-from-parent · force up/down.
📊

The decision table: Model × Reasoning × Cost × When to use

This is the canonical table from the course to choose a model. Read from left to right: each tier has a reasoning level, a relative cost, a latency — and a set of tasks where it's the right choice. Keep it handy; it comes back in Track 4 when we compare models from other providers.

Model Reasoning Cost Latency When to use
Haiku
the helper
Shallow
find & report
$
the cheapest
Low
the fastest
Scan, search, summarize, read docs, run sweeps, gather raw context.
Sonnet
the worker
Good
builds & reviews
$$
medium
Average
balanced
Build code, implement steps, review diffs. Default when in doubt.
Opus
the master
Deep
thinks deeply
$$$
the most expensive
High
the slowest
Architecture, security, planning, difficult debugging. Exception justified.
inherit
inherits from the parent
= the orchestrator's
what the parent uses
= the orchestrator's = the orchestrator's When there’s no reason to deviate. Omit the field model and that’s it.

💡 How to read the table in practice

Start from the bottom: is the task "find and report"? Haiku. No? Does it "build or review"? Sonnet. Only move up to Opus if you can say out loud why the reasoning needs to be as good as possible. Can’t justify it? Don’t upgrade.

📄

Real example: three agents, three models

The model choice lives in the field model from the frontmatter. Here are three subagents from the same project, each in the tier justified for your task — and read the comment that explains why each one is where it is.

.claude/agents/ (three files) Markdown + YAML
# ── 1) file-scout.md ── varre o repo atrás de um padrão
---
name: file-scout
description: Varre o repositĂłrio atrĂĄs de onde um sĂ­mbolo
  ou string aparece e devolve sĂł os caminhos + linhas.
tools: Read, Grep, Glob       # sĂł leitura
model: haiku                  # ← Ă© "ache e relate": tier barato basta
---
You are a fast code scout. Liste apenas os arquivos e linhas
onde o alvo aparece. NĂŁo explique, nĂŁo opine. SĂł o mapa.


# ── 2) feature-builder.md ── implementa um passo do plano
---
name: feature-builder
description: Implementa um passo bem-definido de um plano
  (uma função, uma validação, um endpoint) e roda os testes.
tools: Read, Edit, Write, Bash
model: sonnet                 # ← constrói código: o operário competente
---
You are a focused implementer. Implemente exatamente o passo
pedido, siga o padrĂŁo do projeto e rode os testes ao final.


# ── 3) security-reviewer.md ── caça falha de segurança
---
name: security-reviewer
description: Revisa o diff em busca de falhas de segurança
  (injeção, vazamento, authz). Use após mexer em auth/pagamentos.
tools: Read, Grep, Glob       # read-only: revisor nĂŁo edita
model: opus                   # ← raciocĂ­nio de segurança: o erro Ă© caro
---
You are a senior security reviewer. Pense como atacante.
Aponte cada risco com arquivo:linha e a gravidade. NĂŁo conserte.
file-scout
model: haiku

Only locates and lists. Zero deep reasoning → the cheapest and fastest tier is the right one.

feature-builder
model: sonnet

Writes correct code following a plan. Real implementation work → the medium default.

security-reviewer
model: opus

Tracking down a bug requires deep thinking, and mistakes are costly → the higher tier is justified here.

⌚

Ready-made prompts (copy and paste)

Three prompts to tell the orchestrator match model to task. Notice the pattern: you say the tier e a reason — and keep the cheap work on Haiku and the expensive work on Opus.

Prompt 1 — cheap to scan, expensive to decide splits the phases
Use um subagente em Haiku pra escanear /auth e me
trazer sĂł os trechos que tocam o login. Depois,
com esse resumo, use Opus sĂł pra decidir onde estĂĄ
o bug. NĂŁo rode o Opus na varredura.
Prompt 2 — pin an agent's model defines the model field
Crie um subagente "doc-summarizer" read-only com
model: haiku — a tarefa Ă© sĂł ler docs e resumir,
entĂŁo quero o tier mais barato e rĂĄpido.
Prompt 3 — move up a tier where it hurts justifies Opus
Esse é um revisor de segurança: coloque model: opus.
O erro aqui Ă© caro, entĂŁo quero o raciocĂ­nio mĂĄximo,
mesmo custando mais. Mantenha o agente read-only.
đŸ–„ïž

Simulated screen: each subagent's model

This is how the choice appears in the terminal. The lead launched three subagents, and the status line shows, for each one, which model is running. Notice the design: the scanning fleet in Haiku, the builder in Sonnet, and only the security reviewer in Opus — expensive boss, cheap workers.

claude code · auth-refactor · 3 subagents ⏱ 00:31
● file-scoutHaiku
38k tok
● doc-summarizerHaiku
52k tok
● feature-builderSonnet
119k tok
● security-reviewerOpus
88k tok
2× Haiku + 1× Sonnet + 1× Opus · only deep-thinking work pays for the expensive tier
orchestrator · Opus
your context
14%

↑ Illustrative recreation of the terminal (not a real screenshot). The status line reveals each subagent's model — and the cheap fleet carries most of the workload.

🎯

Exercise: assign a model to 6 tasks

For each of the 6 tasks below, choose the tier — Haiku, Sonnet or Opus — and write one sentence justifying. Use the decision table as a guide.

The 6 tasks

  1. Search which of the project's 300 files the function parseToken is called.
  2. Decide how to reorganize the folder architecture of a monorepo that has grown too large.
  3. Implement the phone number mask in a form field, following the project’s pattern.
  4. Summarize a 4,000-line build log into the 5 errors that matter.
  5. Audit a payment endpoint for authorization flaws.
  6. Review a 60-line diff that adds a button and adjusts CSS.

✅ Verification criteria — annotated answer key

Check your answer against this answer key. Getting it right tier matters, but getting the reason matters more — it's what you'll reuse in new tasks.

  • 1.Haiku — it's pure "find and report," high volume, zero deep reasoning.
  • 2.Opus — architecture: a far-reaching decision that’s costly to get wrong.
  • 3.Sonnet — build well-defined code following a pattern: the worker.
  • 4.Haiku — summarizing a log is reading compression, disposable and fast.
  • 5.Opus — payment security: think like an attacker; mistakes are extremely costly.
  • 6.Sonnet — review a trivial diff: standard review work, with no high risk.

Tier scorecard: Haiku ×2 · Sonnet ×2 · Opus ×2. If you threw everything at Opus, reread topic 3 — Opus is the minority.

Solved example

Task: "search where parseToken is called in all 300 files.” Tier: Haiku. Reason: is a "find and report" sweep—high volume, disposable reading, no tough decisions; paying for Sonnet or Opus here would be burning money.

✅ Module summary

✓
Haiku — cheap and fast; scanning, searching, summarizing, reading docs. Disposable grunt work.
✓
Sonnet — medium; build and review. The sensible default when you're unsure.
✓
Opus — expensive and deep; architecture, security, difficult reasoning. A justified exception, not the default.
✓
Three dimensions — reasoning, cost, and latency rise together; pay only for what the task uses.
✓
Starts blank — the subagent gathers context on its own; this phase is cheap reading, not expensive reasoning.
✓
Large × 30s + inherit — a subagent is worth it for a large task, but wasteful for a microtask; without a reason, inherit the parent’s model.

Next module:

3.2 — The real savings. Smart boss + Haiku fleet, CLAUDE_CODE_SUBAGENT_MODEL, maxTurns and why multi-agent work costs ~15×—and when it’s worth it.