Meet the planner, executor, and reviewer
Recipe R2 splits a task into three roles. The planner thinks and writes the plan. The executor do it. The reviewer check whether it’s actually ready.
It’s the routing from module 3.1 applied to a single task: thinking uses a strong model, doing uses a medium one, and checking uses a light one. Nobody pays for a top-tier model for a checking task.
🆕 New here? Subagent and role
- Subagent — a helper that Claude Code calls during a conversation. It gets part of the work, handles it with its own model and tools, and returns the result. It’s an official Claude Code feature.
- Role — the subagent's "role": what it does, which model it uses, and what it can touch. In the kit, each role is a file in
.claude/agents/.
| Role | File | Model | Does |
|---|---|---|---|
| planner | planejador.md | opus | short plan with a completion criterion comando → saída esperada |
| executor | executor.md | sonnet | execute the plan and show the evidence |
| reviewer | revisor.md | haiku | run the criteria; reply APPROVED or say what’s missing |
What to look for in the table: the Model column steps down in level from the first row to the last (top tier, executor, smaller on the ROTEAMENTO.md). The table is the same as in recipe R2.
How to read the diagram: the task moves from left to right. Only the executor (blue) changes files. The reviewer closes with APROVADO; if something fails, the red dashed line returns the list of corrections to the executor.
opus, read-only
sonnet, edits
haiku, read-only
through the official channel
Read the role files
Each role is a short text file. At the top is a header between lines ---; the instructions in Portuguese underneath. This is the .claude/agents/planejador.md, in full:
--- name: planejador description: Planeja uma tarefa antes de executar. Use no início do time de três papéis (runtime/receitas/R2). Não edita arquivos. model: opus tools: Read, Grep, Glob --- Você é o planejador do time. Leia a tarefa e o que for preciso do projeto, sem alterar nada. Devolva somente: 1. Plano em no máximo 5 passos. 2. Critérios de pronto, um por linha, no formato `comando → saída esperada`, que só passam se o trabalho for feito de verdade. 3. Riscos pela runtime/POLITICA.md (ações que exigem pedir antes).
tools doesn’t have Write nor Edit. The planner can't change a file even if it wants to.🆕 New here? Frontmatter and tools
- Frontmatter — the header at the top of the file, between the two lines
---. Claude Code reads the role's name, description, model, and tools there. - description — tells Claude when to call this role. That's why it mentions the R2 recipe.
- tools — the enabled tools:
Read(read),Grep/Glob(search),Write/Edit(create and modify),Bash(run commands).
| Role | tools: in the file | Instruction that holds the role |
|---|---|---|
| planner | Read, Grep, Glob | "without changing anything" |
| executor | Read, Write, Edit, Bash, Grep, Glob | "don’t send, delete, or spend credits; if the plan calls for that, stop and return the question" |
| reviewer | Read, Bash, Grep, Glob | "Don’t change any files." End with APROVADO or FALTA: |
What to look for in the table: the reviewer has Bash to run the criteria, but there's no Write nor Edit. It checks without being able to "fix under the hood" what it found.
✓ Well-written role
- ✓ Minimum tools for the job
- ✓ Fixed-format output (plan, PASS/FAIL)
- ✓ Cites the
POLITICA.md - ✓ Fits on one screen
✗ Poorly written paper
- ✗ All the tools “just in case”
- ✗ Reviewer who can edit what they review
- ✗ Open-ended answer with no clear verdict
- ✗ Top model for everything
the role card
what can be changed
routing level
cited in the instructions
Run the team through Claude’s interface
The simplest way is to talk. Open Claude Code in the kit folder and request the team by the roles' names. Claude calls each subagent in order.
The test task is deliberately trivial: create a file with one sentence. That way, you can see the team working without worrying about the content.
Open claude in the kit folder and paste (R2 recipe prompt):
Use o time: o planejador planeja, o executor faz e o revisor confere. Tarefa: crie saudacao.txt com a frase "Olá, comunidade INEMA".
When you're done, check the file in the terminal:
cat saudacao.txt
Expected result (according to the instructions):
cat saudacao.txt displays the phrase, and the response ends with APROVADO.
APROVADO. If you get FALTA:, read the list: it’s what the executor didn’t do.Planner returns the plan
Up to 5 steps, the completion criteria in the format comando → saída esperada and policy risks.
Executor does the work and shows the proof
Creates the file, runs the proof command for each step, and lists what it created or changed.
Reviewer gives the verdict
One line per criterion, OK or FAIL with the output, and at the end APROVADO or FALTA:.
💡 The criteria are set before the work begins
The planner writes the completion criteria before the executor starts. That way, the reviewer checks against what was agreed on, not against what the executor says it did. It’s the same idea of “proof” used in the recipes.
you follow along
up to 5 steps
command → output
or MISSING:
Run the team without opening the interface
The same request fits on one line in the terminal. You don’t have a conversation: you send the task, wait, and read the final response. It’s useful for repeating the same team’s work every week with the same phrase.
🆕 New here? The -p from Claude
claude -p "pedido" run the request once and print the response without opening the chat screen. The "p" comes from screenshot (print). It lets you call Claude from a script or another agent.
In the terminal, from inside the kit folder:
claude -p "Use o time (planejador, executor, revisor). Tarefa: crie saudacao.txt com a frase 'Olá, comunidade INEMA'. Termine com a resposta do revisor."
Result confirmed in CHANGELOG 0.1.0:
modelos opus + sonnet + haiku usados; revisor APROVADO; saudacao.txt correto Custo da R2 em cota: equivalente a ~US$ 0,73 de API (não é cobrança na assinatura).
APROVADO) e cat saudacao.txt shows the sentence.How to read the diagram: on the left, all three roles are visible in the conversation. On the right, they run inside the purple box of the claude -p and you only see what comes out. Same team, same quota; what changes is how much you monitor.
⚠️ -p isn’t the same as running in the background
O claude -p keeps the terminal busy until it finishes. Letting the team run while you do something else is the claude --bg, from module 3.3. And the two don’t get mixed up: CHANGELOG 0.2.0 records that --bg doesn’t accept -p.
one line, one response
same phrase, every week
equivalent in quota
is module 3.3
Use the team in your work
To use it for real, change only the task. The R2 recipe includes two examples, one for each character in the course. What changes between them is what the reviewer checks.
Sônia — ERP totals
R2 example: "plan and create a summary of the CSV exported from the ERP in export/; the reviewer checks the totals".
To practice, use the runtime/exemplos/erp-vendas.csv. Its total is R$ 856,00, a calculation you can do by hand.
Clara — available times
R2 example: "list the week’s available time slots in the agenda.csv; the reviewer checks that no busy time slots appear".
To practice, use the runtime/exemplos/agenda.csv, with Dr. Ana and Dr. Bruno.
Open claude in the kit folder and paste:
Use o time: o planejador planeja, o executor faz e o revisor confere. Tarefa: monte resumo-vendas.md com o total por cliente do runtime/exemplos/erp-vendas.csv e o total geral. O revisor confere os totais somando direto do CSV.
For Clara, change the task:
Use o time: o planejador planeja, o executor faz e o revisor confere. Tarefa: liste em horarios-livres.md os horários livres da runtime/exemplos/agenda.csv. O revisor confere se nenhum horário ocupado apareceu.
APROVADO. For Sônia, the grand total must be R$ 856,00 (10×18,50 + 25×5,20 + 40×5,20 + 6×18,50 + 12×18,50). For Clara, compare with the lines livre from the CSV.💡 Tell the reviewer what to check
"The reviewer checks it" on its own is vague. "The reviewer checks the totals by summing them directly from the CSV" becomes a criterion. The more concrete what they check is, the more the APROVADO applies.
⚠️ The executor stops before sending or deleting
Under the R2 policy, the executor changes project files (N3) and nothing else. If Clara’s task becomes "and send the list to the patients," it stops and returns the question: sending has an N2 ceiling in POLITICA.md.
reviewer checks totals
nothing busy
count manually
modifies, doesn't send
Switch models and create roles
The roles are yours. The “Adjustments” section of R2 shows the two ways to make changes: switch a role’s model or create a new role.
To change the model, edit the line model: from the role file. The accepted values are haiku, sonnet, opus or inherit, which uses the same model as your session.
--- name: revisor description: Confere o trabalho do executor rodando os critérios de pronto do plano. Use no fim do time de três papéis (runtime/receitas/R2). Não edita arquivos. model: haiku tools: Read, Bash, Grep, Glob ---
model: haiku by model: sonnet. That's the "only escalate if it fails" rule from module 3.1.Value of model: | Level in ROTEAMENTO.md | When using it with the team |
|---|---|---|
haiku | smaller | check simple criteria |
sonnet | executor (or lower) | do the work; more attentive reviewer |
opus | top (or executor, with low effort) | plan |
inherit | your session's | when you've already chosen the model upon opening the claude |
What to look for in the table: the second column links each value to the module 3.1 table. Note that sonnet appears on two levels there: routing is a guide, not a prison.
To create a role, R2 says to copy a file from .claude/agents/ and change the name, description, and instructions. You can ask Claude itself, which shows you the change before saving:
Open claude in the kit folder and paste:
Copy .claude/agents/revisor.md to .claude/agents/conferente-agenda.md. Change name, description, and instructions: have it check whether a list of available time slots matches the livre lines in runtime/exemplos/agenda.csv. Keep the same tools and model: haiku. Show the file before saving.
.claude/agents/, the frontmatter has name: conferente-agenda and the list tools continues without Write e Edit.Quick test (optional): why doesn't the kit reviewer have Write nor Edit?
💡 Next level
R2 ends by pointing to the next step: each role in its own session, running in the background. That’s recipe R4, in module 3.3.
one line changes the level
the session's
new role
background
🎓 Module summary
tools the frontmatter determines who can make changes.claude -p — same team, ends with APPROVED.model: switches the level; copying creates a role.Next module:
3.3 — Background team