Codex Workflow
Claude Code coordinates. Codex is a secondary engineer: independent
reviewer, test validator, bounded executor. Never split a task evenly
between the two — each has one clear job, always triggered manually.
Responsibility split
| Responsibility |
Claude Code |
Codex |
| Understand request, plan |
Primary |
Can question |
| Explore repo, implement |
Primary |
— |
| Code review |
Optional |
Primary |
| Adversarial review (architecture/security) |
Optional |
Primary |
| Run/validate tests |
Optional |
Primary |
| Diagnose failures |
Primary |
Second opinion |
| Small bounded fixes |
Primary |
Can execute |
| Final decision, commit |
Always |
Recommends only |
Flow
- Plan in Claude Code. Understand the request, explore the repo, find
affected files, check conventions, propose a plan. No Codex yet.
- Implement incrementally in Claude Code. One small unit at a time
(model → service → endpoint → integration → tests → docs). Small
increments make Codex's review easier later.
- Normal review — call manually, never automatically:
/codex:review --background
/codex:status
/codex:result
Call after: a meaningful feature lands, before opening a PR, after a
big refactor, or whenever a second opinion is wanted.
- Adversarial review for risky changes:
/codex:adversarial-review --background <question — e.g. "questione a
estratégia de cache: invalidação, concorrência, consistência">
Use for auth, payments, migrations, concurrency, queues, cache,
uploads, data deletion, infra changes, public API changes, and any
hard-to-reverse decision.
- Classify before applying anything. Never auto-apply Codex's
findings. Classify each one: bug real / accepted risk / false
positive / future improvement. Decide what to fix, weighing business
rules, compatibility, maintenance cost, and context Codex may be
missing.
- Bounded execution via
/codex:rescue:/codex:rescue --background investigue <problema>. Não faça
alterações; identifique a causa raiz e os arquivos envolvidos.
/codex:rescue --resume aplique a solução aprovada e execute os testes
Codex fixes small, well-delimited tasks; Claude Code integrates
anything larger. Prefer investigate-first, apply-after-approval over a
one-shot fix.
- Test validation report. Codex should report: command run, tests
passed, tests failed, likely cause, files changed, and anything it
couldn't run.
Operational rules
- One agent writes at a time. Don't let Claude Code edit files while
a Codex
rescue with write access is still running.
- Review before fix.
revisar → classificar → decidir → corrigir,
never auto-apply everything Codex reports.
- Bounded tasks only. Give Codex explicit scope limits (e.g. "only
src/http and tests/http, don't touch the public API"), never "improve
the whole project."
- Always check the diff after Codex touches files —
git status --short, git diff --stat, git diff — even if Codex
claims it changed only one file.
- Don't mix objectives. Don't ask Codex to fix tests, refactor
architecture, and update docs in the same task unless truly necessary.
- Final decision stays with Claude Code / the user. Codex
recommends, reviews, and fixes — it doesn't decide scope or merge.
Model/effort guidance
Fast model for simple diagnostics. More capable model plus higher
reasoning effort for architecture or security-critical reviews.
Background execution (--background) for large changes.
Trigger phrases
"revisa com Codex", "valida com Codex", "segunda opinião", "review
adversarial", "usa Codex pra investigar/corrigir X", or wrapping up a
significant feature before commit/PR.
1---2name: tools-codex-workflow3description: Playbook for delegating to Codex CLI (via the codex-plugin-cc Claude Code plugin) as a secondary reviewer and test validator. Claude Code stays primary: it plans, implements, and decides. Codex reviews diffs, runs adversarial review on risky changes, validates/executes tests, and takes small delimited fix/investigate tasks — always invoked manually, never automatically. Use when the user asks to review with Codex, validate tests via Codex, get a second opinion, run an adversarial review, or delegate a bounded bugfix/investigation to Codex.4---56# Codex Workflow78Claude Code coordinates. Codex is a secondary engineer: independent9reviewer, test validator, bounded executor. Never split a task evenly10between the two — each has one clear job, always triggered manually.1112## Responsibility split1314| Responsibility | Claude Code | Codex |15|---|---|---|16| Understand request, plan | Primary | Can question |17| Explore repo, implement | Primary | — |18| Code review | Optional | Primary |19| Adversarial review (architecture/security) | Optional | Primary |20| Run/validate tests | Optional | Primary |21| Diagnose failures | Primary | Second opinion |22| Small bounded fixes | Primary | Can execute |23| Final decision, commit | Always | Recommends only |2425## Flow26271. **Plan in Claude Code.** Understand the request, explore the repo, find28 affected files, check conventions, propose a plan. No Codex yet.292. **Implement incrementally in Claude Code.** One small unit at a time30 (model → service → endpoint → integration → tests → docs). Small31 increments make Codex's review easier later.323. **Normal review — call manually, never automatically:**33 ```34 /codex:review --background35 /codex:status36 /codex:result37 ```38 Call after: a meaningful feature lands, before opening a PR, after a39 big refactor, or whenever a second opinion is wanted.404. **Adversarial review for risky changes:**41 ```42 /codex:adversarial-review --background <question — e.g. "questione a43 estratégia de cache: invalidação, concorrência, consistência">44 ```45 Use for auth, payments, migrations, concurrency, queues, cache,46 uploads, data deletion, infra changes, public API changes, and any47 hard-to-reverse decision.485. **Classify before applying anything.** Never auto-apply Codex's49 findings. Classify each one: bug real / accepted risk / false50 positive / future improvement. Decide what to fix, weighing business51 rules, compatibility, maintenance cost, and context Codex may be52 missing.536. **Bounded execution via `/codex:rescue`:**54 ```55 /codex:rescue --background investigue <problema>. Não faça56 alterações; identifique a causa raiz e os arquivos envolvidos.57 /codex:rescue --resume aplique a solução aprovada e execute os testes58 ```59 Codex fixes small, well-delimited tasks; Claude Code integrates60 anything larger. Prefer investigate-first, apply-after-approval over a61 one-shot fix.627. **Test validation report.** Codex should report: command run, tests63 passed, tests failed, likely cause, files changed, and anything it64 couldn't run.6566## Operational rules67681. **One agent writes at a time.** Don't let Claude Code edit files while69 a Codex `rescue` with write access is still running.702. **Review before fix.** `revisar → classificar → decidir → corrigir`,71 never auto-apply everything Codex reports.723. **Bounded tasks only.** Give Codex explicit scope limits (e.g. "only73 src/http and tests/http, don't touch the public API"), never "improve74 the whole project."754. **Always check the diff after Codex touches files** —76 `git status --short`, `git diff --stat`, `git diff` — even if Codex77 claims it changed only one file.785. **Don't mix objectives.** Don't ask Codex to fix tests, refactor79 architecture, and update docs in the same task unless truly necessary.806. **Final decision stays with Claude Code / the user.** Codex81 recommends, reviews, and fixes — it doesn't decide scope or merge.8283## Model/effort guidance8485Fast model for simple diagnostics. More capable model plus higher86reasoning effort for architecture or security-critical reviews.87Background execution (`--background`) for large changes.8889## Trigger phrases9091"revisa com Codex", "valida com Codex", "segunda opinião", "review92adversarial", "usa Codex pra investigar/corrigir X", or wrapping up a93significant feature before commit/PR.