/fx-dev:codex-reviewfrom fx-dev
Runs a scoped one-shot Codex CLI branch review as an external review adapter. Builds a Scope Brief prompt and bridges Codex with project review conventions.
Ships in fx-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
⛔ Load fx-dev:review first (Skill tool: skill="fx-dev:review"). It is the
canonical review procedure — carrying the Scope Brief, triaging in filter order,
sweeping a class, converging, reporting. This skill is the Codex adapter: how
to drive the codex CLI, and nothing else. Where the two appear to disagree,
fx-dev:review wins.
Codex is a local, one-shot reviewer against the current branch, and it is the
only local reviewer in this SDLC — the entire pre-PR review pass
(fx-dev:dev Step 4.5), run before pr-preparer.
There is no local CodeRabbit pass — the
crCLI is not used anywhere. CodeRabbit applies only at the PR level, and only when the repo's GitHub App is installed. There is no Claude-side pass either:/simplifyand/code-revieware not part of this lifecycle, so nothing runs before Codex here.
Codex reads AGENTS.md. It does not read REVIEW.md or CLAUDE.md. Every
other reviewer reaches REVIEW.md on its own; Codex is the exception. The bridge
is a ## Code Review Rules section in AGENTS.md pointing at REVIEW.md, which
fx-dev:setup creates.
Before the first run in a repo:
grep -q "## Code Review Rules" AGENTS.md 2>/dev/null \
&& echo "Codex pointer present" \
|| echo "MISSING - run fx-dev:setup (new repo) or fx-dev:upgrade (legacy layout)"
If it is missing, report it and continue reviewing on defaults — do NOT run
fx-dev:setup or fx-dev:upgrade from here (fx-dev:review Step 6 explains
why). Tell the user to run it separately.
If Codex flags something REVIEW.md explicitly permits, the pointer is not
landing — say so rather than silently applying the finding.
codex review takes a prompt, so unlike Copilot or the CodeRabbit App, Codex can
receive the brief directly. Build it per fx-dev:review Step 1 and pass it as the
prompt, in this order:
fx-dev:review § The external-reviewer block, verbatim — Part 2 (the bar)
on pass 1 as well as every re-run; Part 1 (the convergence prefix) on top of
it from pass 2 only.# Write the brief to a file, then hand the FILE to the script. Never invoke
# `codex review` directly — see "Running it" below.
cat > /tmp/scope-prompt.md <<'PROMPT'
SCOPE — READ CAREFULLY BEFORE REVIEWING.
The user asked: "<verbatim request>"
This change is <deliverable type>: <one line on what it does>.
OUT OF SCOPE — do NOT report any of these:
- <deliberate omission, and why it is deliberate>
- Anything about files not modified on this branch.
IN SCOPE — review for:
- <dimension>
Established this session and not to be relitigated:
- <verified fact>
<fx-dev:review § The external-reviewer block, Part 2 — verbatim, on pass 1 too.
On a re-run, Part 1 goes above this.>
PROMPT
A Codex run without the scope prompt is an incomplete pass. Rerun it with one rather than filtering the output by hand.
A codex review that inherits the user's MCP servers can block indefinitely on
its very first action, producing zero output — not slow, not partial: stalled at
~0% CPU until something kills it. Observed twice on 0.147.0, each time sitting
16+ minutes having emitted nothing.
The mechanism: a review invoked non-interactively still reaches for MCP tools, and
a tool call that stalls, fails, or wants an answer has nobody to answer it —
there is no TTY, and codex review has no approval-policy flag of its own. The
call never settles, so the turn never advances. Two things make this the normal
case rather than an edge case:
~/.codex/AGENTS.md telling every session to do something through an
MCP tool at startup guarantees the first action is an MCP call, before any
review work happens.tools.mcp__* inside a
Promise.all), so one unsettled call strands the whole batch.A code reviewer needs no MCP servers. Disabling them removes the whole failure class instead of dodging one trigger, and it starts faster. Do not "try without it first."
-c 'mcp_servers={}' does NOT work. Do not use it. Verified on 0.147.0: the
map is merged, not replaced, so every server stays loaded and every tool stays
available. It looks like it worked because a run that happens not to call a tool
shows no MCP output — the servers are still there. Setting CODEX_HOME to a
sanitized directory does not work either.
What works is disabling each server individually by name.
scripts/run-codex-review.sh does exactly this, emitting one
-c mcp_servers.<name>.enabled=false per server enumerated from
codex mcp list --json. Do not hand-roll it: the script also treats an
enumeration failure as a setup failure and refuses to run, whereas a hand-rolled
loop silently yields an empty flag set and reproduces the hang. This paragraph
documents the mechanism; the script is the only supported way to apply it.
Enumerate with codex mcp list --json, never by parsing config.toml. Not
every active server is declared there — servers can also arrive from
project-scoped or managed configuration, and a config.toml scrape silently
misses those. That produces a partial flag set, the worst outcome: the command
looks correct, most servers are disabled, and the one it missed hangs the run
exactly as before. codex mcp list is the resolved, authoritative view.
The script echoes the resolved server list before running, so a PARTIAL set is visible. A short list on a machine you know has more servers means the enumeration returned less than it should — stop and fix that before starting a long review.
Codex may also expose its own hosted tools not declared in config.toml; those
survive this and are expected to. The hazard is the locally-configured servers.
These are per-invocation overrides. Never "fix" this by editing the user's
~/.codex/config.toml or ~/.codex/AGENTS.md — those are theirs, machine-wide,
and a review has no business rewriting them.
No output for several minutes means stalled, not slow, and it will never recover. Do not wait it out:
Confirm it from the log, per
fx-dev/skills/dev/references/background-waits.md § When a wait seems hung. That
section owns this check and is the only place it is written down — the two answer
the same question and must not diverge again. A process check belongs nowhere in
this diagnosis: one stood here, self-matched, and spun for 13 minutes after the
reviewed process had already finished (background-waits.md § Never invent your
own wait).
# Find its last action — the newest rollout records every step.
ls -t ~/.codex/sessions/*/*/*/rollout-*.jsonl | head -1
In that rollout, a custom_tool_call with no matching custom_tool_call_output
after it is the stalled call, and its input names the tool that never
returned. Kill the run, re-invoke via the script, and tell the user what stalled
rather than silently retrying.
Use the bundled script. It encodes the MCP enumeration, the prompt-only
invocation, and the AGENTS.md pointer check, so none of them can be
half-remembered:
mkdir -p .claude/team/waits && \
bash [SKILL_BASE_DIR]/skills/codex-review/scripts/run-codex-review.sh /tmp/scope-prompt.md \
> .claude/team/waits/codex-review.log 2>&1
Write the scope prompt (built as below) to a file and pass its path, or pass -
to read it from stdin. The script applies the model and effort defaults below
per invocation (CODEX_REVIEW_MODEL / CODEX_REVIEW_EFFORT override them); it
never edits the user's ~/.codex/config.toml. CODEX_REVIEW_OUT=<path> also tees the review to a file;
CODEX_REVIEW_DRY_RUN=1 prints the resolved command without running it, which is
the fastest way to confirm the MCP flag set is complete.
The script picks the current branch, diffs it against its base, and prints the review (highest-risk first) to stdout. It never modifies your working tree.
⛔ Run it in the BACKGROUND and never hand-roll the wait —
fx-dev/skills/dev/references/background-waits.md holds the rule in full,
including the self-matching pgrep -f loop that has deadlocked a run for 49
minutes. Codex is a worse case than most: a review of a real branch takes many
minutes and codex buffers, so the log stays empty until it finishes.
STATUS= lineThe script's last stdout line is always STATUS=<state>. Branch on that line, not
on prose, not on how much output the log holds, and never on how fast the launch
returned — a log with no STATUS= tail is a running or dead run, never a finished
one.
| STATUS | Exit | What to do |
|---|---|---|
COMPLETED | codex's own, whatever it is — the script passes it through unchanged and asserts nothing about any particular value, so 126, 127 and 137 are as reachable as 0/1/2 — or 128+N if a signal killed the runner after the outcome was recorded (see the ERROR row for the narrow gap just before that recording, which still reports ERROR) | The review ran to completion. Read the findings on stdout and triage them per fx-dev:review. A CODEX_EXIT=<n> line accompanies it; report that number rather than $?, and do not read a verdict into it — a non-zero codex exit does not tell you whether the reviewer failed or merely had opinions, only the findings do. |
DRY_RUN | 0 | CODEX_REVIEW_DRY_RUN=1 was set, so no review ran. Confirm the resolved MCP flag set, then launch the real pass. Never record it as a completed review. |
ERROR | 3 (documented setup failures), 4 (the runner aborted internally), or 128+N (a signal killed it before the outcome is recorded — SIGTERM gives 143; recording is a separate statement immediately after the pipeline returns, so a signal in that single-assignment gap reports ERROR for a review that had, in fact, already finished — known, and not closable in bash, since trap dispatch happens between commands) | The review never started, or it died mid-flight. Fix what the log names and re-run. Not a clean pass — there is no review to converge. |
The ERROR exit code is deliberately not a fixed set — branch on STATUS=, which is emitted on every one of those paths, and treat the number as diagnosis only. A signalled runner still prints a sentinel but keeps the signal's own 128+N status, because an exit inside an EXIT trap cannot override one; the script's header says why that is left alone. It also terminates codex and confirms it is gone before writing that line — codex outlives a signalled runner and still holds the log's file descriptor, so without that step it appends review prose after the sentinel and a run that finished reads as one that never did. SIGKILL is the exception that proves the contract — no trap runs, so there is no STATUS= tail, which is the "running or dead" case above.
The exit code and the STATUS= line answer different questions: the exit code says how the runner died, STATUS= says whether the review finished. A signal that arrives after the review completed — while the runner is still writing the tee warning, the CODEX_EXIT= line and the sentinel itself — gives STATUS=COMPLETED at exit 143, because the findings are already in the log. Read them; do not re-run. 143 plus STATUS=COMPLETED is a well-formed outcome, not a contradiction, and it is the one case where the exit code is not codex's own — which is why you report CODEX_EXIT=. The one exception is the recording statement itself: a signal landing there still reports STATUS=ERROR for a review that had, in fact, finished — see the ERROR row above.
The script has no timeout: Codex is one-shot and its runtime is its own. It
exits 3 on a usage error (missing or empty scope prompt, codex not on PATH) —
deliberately not 1 or 2, which codex itself uses, so "the reviewer failed" never
looks like "the reviewer had opinions".
Verified on 0.146.0, both of these are rejected:
error: the argument '--base <BRANCH>' cannot be used with '[PROMPT]'
The usage line prints codex review --base <BRANCH> [PROMPT], which looks like it
should work — it does not. Since the scope prompt is mandatory, the prompt-only
form is the ONLY correct invocation, and it needs the changes committed on a
branch so Codex can derive the diff itself. If the work is uncommitted, commit it
to a branch first (never review from a bare main with a dirty tree) and say you
did.
⛔ There is no prompt-less fallback. --base and --uncommitted exist, but
reaching for either means abandoning the Scope Brief, and a run without the brief
is an incomplete pass by definition — it reports the work the change deliberately
did not do, and you then filter its output by hand, which is the cost the brief
exists to avoid. If the work is uncommitted, commit it to a branch and run the
script with a prompt; that is always available, so the fallback never has a case.
Route every invocation through scripts/run-codex-review.sh, which refuses to
start without a non-empty prompt.
codex review inherits model and model_reasoning_effort from the user's
~/.codex/config.toml, and a reasoning-heavy default turns every pass into a
10–15 minute wait. Override them per invocation with -c; never edit the
user's config (see the MCP section — same reasoning).
The script applies these defaults itself. Override per run via env:
CODEX_REVIEW_MODEL=gpt-5.6-terra CODEX_REVIEW_EFFORT=high \
bash [SKILL_BASE_DIR]/skills/codex-review/scripts/run-codex-review.sh /tmp/scope-prompt.md
Default to gpt-5.6-terra at medium — roughly a tenth of the wall clock of
a sol/xhigh default, and still substantive. Do not trade down to luna for
the extra speed: it reported "no blocking defect" on a branch where terra at
medium found a genuine P1, and a reviewer that finishes fast by finding nothing
is not faster. Reach for terra/high when you want every site of a class
enumerated and can afford roughly triple the wait. Effort above high is not
worth it for review — it found nothing more, and a 15-minute pass makes the
convergence loop unaffordable long before the iteration bound.
The measurements behind this choice are in the commit that made it
(git log -S gpt-5.6-terra -- plugins/fx-dev/skills/codex-review/SKILL.md), not
here: they are one branch on one machine at one point in time, and they date the
moment the models change.
codex review accepts exactly nine options:
--strict-config, -c/--config, --uncommitted, --base, --enable,
--commit, --disable, --title, -h/--help. There is no --json/-o
and no --dangerously-bypass-approvals-and-sandbox (that is codex exec).
Check codex review --help before reaching for anything else.codex installed and already authenticated. If it is not, STOP and
report to the user — never run codex login.Send fx-dev:review § The external-reviewer block, verbatim, as the last part
of every prompt — the first pass as well as every re-run. That block is the single
mirror both external reviewers use; this skill does not keep its own copy, and
must not paraphrase it.
That section is in two parts, sent on different schedules: Part 2 (the bar) goes in every prompt, pass 1 included; Part 1 (the convergence prefix) goes on top of it from pass 2 only. On pass 1 send Part 2 alone — Part 1 has nothing to carry and asks the reviewer to honour a list of prior findings that does not exist.
Everything general is in fx-dev:review Steps 2–5. Two things are peculiar to a
local run:
A converged Codex review — no blocking finding left unresolved
(fx-dev/skills/dev/references/scope-contract.md § Convergence) — is the local gate
to PR creation (fx-dev:dev Step 4.5 → Step 5). It is the only local gate; there is
no local CodeRabbit review, and no Claude-side review, to converge alongside it. Outstanding immaterial observations do not hold the PR; carry them
into its description as a closing note.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fx/cc --plugin fx-dev25 skills in this plugin
/coderabbit-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Handles CodeRabbit's PR-level review as an optional review adapter with Scope Brief triage and rate-limit degradation./copilot-feedback-resolverExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Processes and resolves existing GitHub Copilot review threads without creating PR-level comments./copilot-reviewExplicit-use only — invoke when the user explicitly names this skill, or when an active explicitly invoked workflow calls it. Requests, waits for, inspects, and settles a head-scoped GitHub Copilot review.Other plugins' skills for the same job