A coding turn can finish with a plausible explanation while its changes still contain a regression. The Codex review gate in Claude Code adds an automatic code review before that turn can stop.
The gate is off by default and applies to the current Git repository. Its review targets direct code edits from the preceding Claude turn; setup reports, status requests, and older changes alone do not exercise that behavior.
The Codex plugin must already be installed, with Claude Code and the local Codex CLI both signed in. A readiness check matters because an unavailable Codex can leave only a setup notice and let Claude stop without reviewing the changes. The gate supplements the project's tests and human review.
Steps to enable the Codex review gate in Claude Code:
- Start a fresh Claude Code session in the trusted Git checkout you want reviewed.
$ claude
A disposable copy with an existing test suite is suitable for a first trial. The plugin uses the local Codex CLI's credentials and configuration.
- Check that Codex is ready in the Claude Code session.
/codex:setup
The setup result must show Codex installed and authenticated, with ready set to true. If sign-in is missing, sign in to Codex before enabling the gate. In a Linux container, a sandbox namespace error also needs an environment fix; readiness alone does not establish that a review can run.
- Enable the review gate for the current repository.
Automatic reviews can send repository code to the configured Codex provider and start a long Claude/Codex repair loop that quickly consumes usage allowances. Only enable the gate for authorized code while actively watching the session. If a repair loop needs to stop, interrupt the turn and turn the gate off with /codex:setup --disable-review-gate in the same repository.
/codex:setup --enable-review-gate
The setup response reports the stop-time review gate as on for the repository. The setting does not enable the gate in every checkout.
- Request one small code edit in the same Claude Code session.
The turn must actually change code before it finishes. A status-only reply or a review of an already-existing diff cannot demonstrate the stop gate. A first trial should use a change covered by the repository's tests.
- Read any stop-hook block reason returned after the edit.
Stop hook error: Codex stop-time review found issues that still need fixes before ending the session: The verified edit in `pricing.py:2` breaks total pricing by adding quantity instead of multiplying. ##### snipped #####
This observed block followed a change from multiplication to addition in a price calculation. The finding depends on the code. Claude receives the reason and continues working; in this case it restored multiplication and ran the regression test. A good edit may be allowed immediately. An authentication, sandbox, or timeout error is not a code-review finding.
- Confirm that the stop-time review completed after Claude's repair.
/codex:status
The latest job should be completed with an ALLOW: summary after the repaired edit. A BLOCK: summary identifies work still needing attention. An ALLOW: for a setup or status-only turn does not prove that an edited turn was reviewed.
- Run the affected regression test against the final code.
!python3 -m unittest -v
The leading ! runs the command in Claude Code's shell mode. This command fits Python repositories using unittest; another project needs its own test command. The test runner must discover the affected tests and report them as passing. A passing test, a completed review of the edited turn, and the returned Claude prompt establish that the repair remains usable with the gate enabled.