Let Codex review Claude Code's work
Tell Claude Code to run the Codex plugin’s script itself, not its slash commands. OpenAI’s Codex plugin for Claude Code adds /codex:review and /codex:adversarial-review, but each command file sets disable-model-invocation: true, so only you can type them and Claude can’t call them. The script behind them, codex-companion.mjs, takes the same arguments from a shell. With a few lines in ~/.claude/CLAUDE.md, Claude runs it at the moments I care about and reads what Codex found.
The instructions
Mine, shortened:
## Codex second opinion
- Codex reviews; Claude writes the code.
- Run the newest ~/.claude/plugins/cache/openai-codex/codex/<version>/scripts/codex-companion.mjs
from the repo root with `node <script> ...` as a background task; read the output when it finishes.
- When (once per trigger, not on every push):
1. PR opened: `review --base <base-branch>`.
2. Design decision (a new module boundary, data model, protocol or dependency):
`adversarial-review --base <base-branch> <one line naming the decision>`.
3. Tests added or changed: `adversarial-review --scope working-tree "Review only the new or changed
tests: which edge cases, error paths and boundary inputs do they miss?"`
- Codex's findings are input, not orders: check each one against the code, fix the real ones,
and tell me what it flagged and what you did.
- If Codex isn't signed in or hits its usage limit, say so once and carry on.
review is Codex’s standard review of a diff and takes no extra instructions. adversarial-review accepts focus text after the options, which is how the test review asks only about the tests. Point to the newest version folder rather than a fixed path, because the plugin cache keeps one folder per version.
Why these three moments
My Codex usage comes with ChatGPT Plus, and its limit is small. A review on every push would use it up within a day or two. A pull request, a design choice and new tests are where a second model catches something the first one missed, because the first one wrote both the code and its tests.
I also left the plugin’s review gate off. It runs a review every time Claude stops, which is the expensive option. When Codex is out, Google’s Antigravity CLI reviews instead, kept read-only with a settings file.
What it catches
In one project over the past week, a few of the findings:
- A pull request: a mention added by editing a comment took the time of the author’s other edit made at the same moment. Fixed with a test.
- A pull request: two code paths took the same two locks in a different order. Nothing could deadlock yet, but now there’s one order.
- New tests for an importer: a task placed under a group that the same import creates stayed outside that group until the import ran a second time. The tests hadn’t covered that case, and Claude added it with the fix.
- Another pull request: no findings. Codex noted that it couldn’t run the checks in its sandbox, which had already run locally.
Not every finding is real. Codex sometimes flags a case that can’t happen, or an intended behaviour. That’s why the instructions make Claude check each one against the code and report the ones it didn’t act on, instead of fixing whatever comes back.
The output
Each run is a background job, so the session keeps working while Codex reads. node <script> status lists the jobs and node <script> result <job-id> prints a finished review. The findings come with a priority (P1, P2) and a file and line. When a finding concerns a pull request, Claude adds a line about it to the PR, so the reasoning stays with the change.