How to Use Codex Inside Claude Code for Code Review

How to Use Codex Inside Claude Code for Code Review

Aident AI

Developer code displayed across two monitors for an independent code review.

How to Use Codex Inside Claude Code for Code Review

Install OpenAI's official codex-plugin-cc marketplace in Claude Code, run /codex:setup, then use /codex:review --base main --background to have Codex review your branch without changing files. Use /codex:adversarial-review when you need a second model to challenge a risky design decision, not just inspect implementation details.

That is the shortest useful answer. The rest of this guide shows the complete setup, a repeatable review loop, the expected result, and the failure modes that matter before you make the workflow part of every pull request.

What the Official Codex Plugin Does

OpenAI's plugin calls the local Codex CLI and app server from inside Claude Code. It uses the same repository checkout, Codex authentication, and Codex configuration that you use on the machine already.

The review commands are deliberately read-only:

Command

Use it for

Changes files?

/codex:review

Reviewing uncommitted work or a branch diff

No

/codex:adversarial-review

Challenging architecture, risk, and assumptions

No

/codex:rescue

Delegating an investigation or a fix

Can

/codex:status and :result

Monitoring and retrieving background work

No

The distinction matters. A review should produce evidence for a human or the implementing agent to verify. A rescue task is a work handoff and needs the same change review, tests, and permission boundaries as any other coding-agent task.

Prerequisites

You need:

  • Claude Code with plugin support;

  • Node.js 18.18 or later;

  • a ChatGPT subscription, including Free, or an OpenAI API key;

  • a Git repository with a focused diff to review;

  • the project's tests and static checks available locally.

Codex usage from the plugin counts toward your normal Codex limits. The official plugin also has an optional automatic review gate, but start with manual reviews. OpenAI warns that an unattended gate can create a long Claude and Codex loop and consume limits quickly.

Step 1: Install the Codex Plugin in Claude Code

Run these slash commands inside Claude Code:

/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
/codex:setup

Expected result: /codex:setup reports that Codex is installed and authenticated. Claude Code should list the Codex commands, and /agents should show the codex:codex-rescue subagent.

If setup says Codex is not authenticated, run this inside Claude Code and complete the login flow:

!codex login

Do not paste API keys into a chat, repository file, shell history, or review prompt. Use the supported login flow or an existing securely managed environment.

Step 2: Define a Small Review Boundary

Before asking another model to review the code, confirm what is actually in scope:

git status --short
git diff --stat main...HEAD
git diff main...HEAD

Remove generated output, unrelated formatting, and accidental files. Then run the project's targeted tests. A reviewer is more useful when it sees one coherent change and knows which behavior is already covered.

For uncommitted work, the default command is enough:

/codex:review --background

For a feature branch, make the comparison explicit:

/codex:review --base main --background

OpenAI recommends background mode for larger multi-file reviews. Check and retrieve the result with:

/codex:status
/codex:result

Expected result: Codex returns prioritized findings about the selected diff, or reports that it found no actionable issues. The review command does not edit the working tree.

Step 3: Use Adversarial Review for High-Risk Decisions

The normal review command does not accept custom focus text. Use the adversarial command when the important question is whether the approach is safe or sound:

/codex:adversarial-review --base main --background challenge the authorization boundary, rollback plan, and race conditions

Good targets include:

  • authentication and authorization changes;

  • database migrations and backfills;

  • retry, caching, and concurrency designs;

  • deletion or overwrite paths;

  • billing, secrets, and external side effects.

Avoid a vague request such as "be strict." Name the invariant that must hold and the failure modes that would make the change unsafe.

Step 4: Verify Findings Before Fixing Them

A second model is another reviewer, not an oracle. For each finding, require four pieces of evidence:

  1. The file and line where the suspected problem begins.

  2. A reachable code path to the failure or sensitive operation.

  3. The missing check, invariant, or test.

  4. A targeted reproduction that fails before the fix.

Ask Claude Code to inspect each finding against the repository before editing:

Verify every Codex finding against the current diff and surrounding code.
For each item, show the reachable path, existing guards, and a targeted test.
Reject unsupported findings. Fix only confirmed issues, then run the relevant
tests and summarize what changed

This step prevents plausible but irrelevant review comments from growing the diff. It also creates a clear record of which findings were confirmed, rejected, or deferred.

Step 5: Run One Bounded Review Loop

A practical loop is:

  1. Claude Code implements a focused change.

  2. The project's tests and checks pass.

  3. Codex reviews the diff once.

  4. Claude verifies the findings and fixes confirmed issues.

  5. Tests run again.

  6. A final Codex review checks only the updated diff.

Stop after the final clean pass or escalate unresolved tradeoffs to a human reviewer. Do not keep two models arguing until one gives up. More turns can increase cost without improving evidence.

Track three numbers for the first five reviews: findings reported, findings confirmed, and confirmed defects fixed before merge. That gives you a measurable signal about whether this review step is useful for your codebase.

Common Setup and Review Failures

/codex:setup Cannot Find Codex

Confirm the Codex CLI is visible in the environment that launched Claude Code:

!codex --version

If the command is missing, rerun /codex:setup and follow its installation prompt. If Codex works in one terminal but not Claude Code, restart Claude Code from a shell where the Codex binary is on PATH, then reload the plugin.

Codex Is Installed but Not Logged In

Run:

!codex login
/codex:setup

The plugin reuses local Codex authentication. It does not create a separate plugin account.

The Review Looks at the Wrong Changes

Use /codex:review for current uncommitted work. Use /codex:review --base main when the review should compare the whole branch to main. Check the diff yourself before starting so the target is not ambiguous.

A Large Review Appears to Hang

Prefer --background, then use /codex:status and /codex:result. Keep the diff narrow. As of July 23, 2026, the plugin's public issue tracker also contains open reports about foreground timeouts and stale background jobs. Check the current issue before assuming a local configuration problem, and cancel work that no longer has a useful boundary.

The Automatic Review Gate Burns Usage

Disable the gate and return to manual, bounded reviews:

/codex:setup --disable-review-gate

Use the gate only for a monitored, high-risk change with a narrow target and a clear stop condition.

The Review Produces Too Many False Positives

Reduce the diff, state the system invariants, and require a reproduction for every proposed fix. Do not ask the normal review command for custom focus text because it does not accept it. Use /codex:adversarial-review for a steerable question.

Give Both Agents the Same Tool Boundary

Cross-model review is less useful if one agent can inspect the repository but cannot verify the external systems the change touches. Aident Loadout gives Claude Code and Codex a shared, scoped way to discover and run connected Actions without copying provider credentials into prompts.

Ask your coding agent:

Follow https://aident.ai/SETUP.md

Then connect only the systems required for the change, such as GitHub, an issue tracker, or observability. Keep read-only review Actions separate from write-capable implementation Actions, and require approval before external side effects.

For a deeper explanation of the tradeoff between local and remote tool access, read Local vs Remote MCP Servers. If your agent starts loading too many tools into every turn, use the techniques in How to Reduce MCP Token Usage in Claude Code and Codex.

Why This Workflow Works

The useful separation is not that one model is always better. It is that the reviewer starts from a different model and review objective. Claude Code keeps ownership of the implementation context; Codex gets a bounded diff and looks for defects or weak decisions; the tests decide whether the resulting change behaves correctly.

That separation only helps when the loop stays evidence-based. A second opinion can catch a blind spot, but two agreeing models can still be wrong. The repository, reproducible tests, and human risk judgment remain the source of truth.

Use Aident Loadout to give both coding agents the same scoped integrations. For your first measurable run, review one branch, record reported versus confirmed findings, and stop after one verification pass.

Sources

Refresh this guide when the plugin's install commands, review target selection, background-job behavior, or review-gate contract changes.

Home

Home

Home

Integrations

Integrations

Integrations

Vault

Vault

Vault

Audit

Audit

Audit

Arana Grande

Arana Grande

Arana Grande

Free

Free

Free

30-day audit summary

30-day audit summary

30-day audit summary

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

View Audit

View Audit

View Audit

Loadout usage

Loadout usage

Loadout usage

617 action calls in the last 30 days

617 action calls in the last 30 days

617 action calls in the last 30 days

May 19 - Jun 17

May 19 - Jun 17

May 19 - Jun 17

10 active days

10 active days

10 active days

Less

Less

Less

More

More

More

Recent activity

Recent activity

Recent activity

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Shopify

Shopify

Shopify

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Success

Success

Success

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Success

Success

Success

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Failed

Failed

Failed

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Connected integration coverage

Connected integration coverage

Connected integration coverage

162

162

162

of 753 accessible connected

of 753 accessible connected

of 753 accessible connected

Callable actions

Callable actions

Callable actions

1,126

1,126

1,126

Vault credentials

Vault credentials

Vault credentials

8

8

8

Explore what's possible

Explore what's possible

Explore what's possible

See all Integrations

See all Integrations

See all Integrations

Google Ads

Google Ads

Google Ads

All available Goolge Ads tools via...

All available Goolge Ads tools via...

All available Goolge Ads tools via...

X (twitter)

X (twitter)

X (twitter)

All available X tools via...

All available X tools via...

All available X tools via...

Github

Github

Github

All available Github tools via...

All available Github tools via...

All available Github tools via...

Notion

Notion

Notion

All available Notion tools via...

All available Notion tools via...

All available Notion tools via...

Slack

Slack

Slack

All available Slack tools via...

All available Slack tools via...

All available Slack tools via...

Firecrawl

Firecrawl

Firecrawl

All available Firecrawl tools via...

All available Firecrawl tools via...

All available Firecrawl tools via...

753 integrations are available for loadouts.

753 integrations are available for loadouts.

753 integrations are available for loadouts.

Plug your entire stack into your AI agents.

Plug your entire stack into your AI agents.

Plug your entire stack into your AI agents.

Skip the integration headache. Plug 750+ tools into Claude Code, Codex, and OpenClaw in one go, and let your agents execute today.

Skip the integration headache. Plug 750+ tools into Claude Code, Codex, and OpenClaw in one go, and let your agents execute today.