Multi-agent and Orchestration|INEMA.CLUB-PRO

Lesson 7 · 20 min

Claude + Codex team: routing by role

Two models from different houses make mistakes in different places. That holds when each one has a role: one does the work, the other reviews by reading only, with the same briefing and the real artifact. In this lesson you route roles by level, rehearse the bridge to Codex without spending quota, and have Codex actually review a script from this course.

Start the lesson
Two different workstations side by side on a dark desk, sharing a notebook and a printed sheet.

In this lesson you will

  1. 1The four levels: smallest, executor, top, and super
  2. 2The routing card: who does the first pass and who checks it
  3. 3The codex-exec.sh bridge, read-only by default
  4. 4Reconcile: accepted, rejected with evidence, or still open

Goal: route each role to the right level and tool, and have Codex review, by reading only, what Claude built.

01Routing by role

Levels from the training project's ROTEAMENTO.md. Model names change; the level stays. Click each level.

Click each block in the diagram to see what it does.

Rule 3 of ROTEAMENTO.md: review by another model catches errors the same model can't see. Rule 4: an agent calling an agent carries the project's instructions; for simple bridges, use a lean folder or claude --bare.

02The routing card

From the agente-claude-codex kit (prompts/05-usar-os-dois.md). It's an editorial starting point, not a measured ranking: change it when your own evidence calls for it.

1. Plan

One writes the plan with scope, assumptions, and acceptance tests, without implementing. The other reviews by reading only and attacks the assumptions.

At most two rounds of review. Output: plan v2 and a review file.

03The bridge to Codex

runtime/pontes/codex-exec.sh sends the request through stdin, accepts only read-only and workspace-write, and returns the final answer.

Terminal · no-quota rehearsal (fake codex on the PATH)
cd ~/treino-multi && chmod +x runtime/pontes/codex-exec.sh
E=${TMPDIR:-/tmp}/ensaio-multi/ponte; rm -rf $E && mkdir -p $E/bin
cat > $E/bin/codex <<'SH'
#!/usr/bin/env bash
# FAKE codex: finds the -o and writes PONG to it (no model is called)
while [ $# -gt 0 ]; do [ "$1" = -o ] && out=$2; shift; done
cat > /dev/null; echo PONG > "$out"
SH
chmod +x $E/bin/codex
PATH=$E/bin:$PATH runtime/pontes/codex-exec.sh "Responda apenas PONG"; echo "saída: $?"
PATH=$E/bin:$PATH runtime/pontes/codex-exec.sh "apague tudo" . danger-full-access; echo "saída: $?"
Terminal · real: Codex reviews the gera-avalia.sh from lesson 4
cd ~/treino-multi
runtime/pontes/codex-exec.sh "Responda apenas PONG"; echo
runtime/pontes/codex-exec.sh "Review, without changing anything, the gera-avalia.sh file in this project. Look for real bugs and risks, not style. Answer in at most 6 lines; the last line is APROVADO or FALTA: <what to fix>." > revisao-codex.txt
cat revisao-codex.txt
revisao.md · the reconciliation (you or Claude writes it)
# Codex review of gera-avalia.sh — <date>

aceito: a generator that fails or hits the cap was still being evaluated and could approve leftovers from a previous round → a round with rc≠0 is now REPROVADO without evaluating (lesson 4, tab "Generator crashed")
aberto: verificar.mjs runs the goal.md commands as bash → the goal must be a trusted, protected file (course 1: frozen tests; course 4: what the agent can read and run)

agreement is not proof: what confirms each "aceito" is running the rehearsal again
Example from the repository
## ensaio (codex falso)
PONG
saída: 0
sandbox recusado pela POLITICA: danger-full-access
saída: 2

## real (Codex CLI 0.163.0, pela assinatura)
PONG
- Se `claude`/`timeout` falhar ou atingir o limite, o script ignora o erro e ainda pode aprovar arquivos deixados por uma rodada anterior.
- `verificar.mjs` executa como Bash os comandos do `goal.md`; um arquivo não confiável pode executar ações arbitrárias.
- FALTA: abortar ou reprovar quando o gerador falhar e restringir a execução de goals a arquivos confiáveis.

The review was done on the first version of gera-avalia.sh. The first finding was real and was fixed (the lesson 4 version is already the fixed one); the second stayed open, with an owner in another course. The ## headings separate the runs.

04The same context for both

Claude and Codex with the same context (video in Portuguese) · 7 min 36 sVideo page with script →

05Practice

Rehearse the bridge, then do a real cross-review.

E15 · Bridge rehearsed

5 min

Run the rehearsal with the fake codex.

Done when: PONG and saída: 0; then sandbox recusado pela POLITICA: danger-full-access and saída: 2.

E16 · Cross-review and reconciliation

20 min

Run the bridge for real on gera-avalia.sh (or on a diff of your own: git diff main...HEAD > diff.txt and ask for a review of diff.txt). Write revisao.md with one line per finding.

Done when: tail -1 revisao-codex.txt | grep -cE '^-? ?(APROVADO|FALTA:)' → 1 (the last line carries the verdict; Codex sometimes puts "- " in front), and grep -cE "^(aceito|rejeitado|aberto):" revisao.md equals the number of findings.

06Lesson quiz

Question 1 of 4

Where should you start the level for a new role?skill

07In three sentences

Level per roleMenor, executor, topo, super: start at the smallest and record why you moved up.
Same briefing, real artifactThe second model reviews by reading only, using what the first one received and what it produced.
ReconcileEach finding becomes aceito, rejeitado with evidence, or em aberto, in at most two rounds.

Going further

Previous lessonNext lesson