GuidesHosting choices

Codex code review: /review, codex review and @codex review

Codex code review three ways: /review presets in the CLI, codex review for scripts and CI, @codex review on GitHub PRs, AGENTS.md rules, plans and usage.

November 28, 2026The Everpod team
The short answer

Codex reviews code in three places. In the Codex CLI, type /review and pick what to review: your branch against a base branch, your uncommitted changes, one commit, or your own instructions; a dedicated reviewer reads the diff and reports findings by priority without changing your files. From a script or CI, codex review --base main (or --uncommitted, --commit <sha>) does the same without a prompt open, and works with an API key. On GitHub, turn on code review for the repository at chatgpt.com/settings/code-review and comment @codex review on a pull request, or let pull requests be reviewed automatically; that needs a ChatGPT Plus, Pro, Business, Enterprise or Edu plan, not an API key. Local reviews count toward your normal Codex usage; GitHub reviews have their own Code Review usage.

Which Codex review you want

You wantUseWhere it runsPlan or key
A review of your work before you commit or push
/review in the CLI, IDE extension or desktop appYour machineAny plan with Codex, or an API key
A review from a script, a hook or CI
codex review or codex exec reviewWherever the command runsAny plan with Codex, or CODEX_API_KEY
Review comments on GitHub pull requests
@codex review, automatic reviewsOpenAI’s cloudPlus, Pro, Business, Enterprise, Edu

Versions here are as of November 28, 2026: Codex CLI 0.172.0 on npm, released November 24.

/review in the Codex CLI

Inside a Codex session, /review (described in the CLI as “review my current changes and find issues”) opens four presets, per OpenAI’s code review page:

Codex then runs a dedicated reviewer that reads the diff and “reports prioritized, actionable findings without changing your working tree”; the review lands as a turn in your transcript, and /diff shows the exact changes it looked at. The slash commands reference says it focuses on “behavior changes and missing tests”. Two practical points: /review is not available while Codex is still working on a task, so let the turn finish (or stop it) first; and the base-branch preset compares against the branch as your local clone knows it, so git fetch before reviewing against origin/main.

A common loop is to let Codex make a change, then run /review on the uncommitted changes in the same session as a second pass, and ask it to fix what the review found.

A different model for reviews

Reviews use the session’s model unless you set review_model in ~/.codex/config.toml:

# ~/.codex/config.toml
review_model = "MODEL_NAME"   # a model your plan or key can use
Copied

Which models those are is in Codex models, and the rest of the file in Codex config.toml.

In the IDE extension and the desktop app

Both offer the first two presets, base branch and uncommitted changes. In the IDE extension /review appears only when the project is in a Git repository, runs in the current chat, and starts a separate review chat if you set chatgpt.reviewDelivery to detached. In the desktop app you can also use the review pane, which starts on unstaged changes. Its pull request reviews, started with Review with Codex, take standing instructions, set with the gear next to that button or under Settings > Code Review and applied across repositories; OpenAI does not describe them as steering a local /review.

codex review: a review without a prompt open

codex review runs the same review once and exits, which suits a pre-push hook, a cron job on a server or a CI step. It takes exactly one target:

codex review --base main                     # this branch against main, from the merge base
codex review --uncommitted                   # staged, unstaged and untracked changes
codex review --commit 1a2b3c4 --title "Add rate limiting"
codex review "Look for missing input validation in the API handlers"
codex review - < review-instructions.md      # custom instructions read from stdin
Copied

--uncommitted, --base, --commit and a custom prompt conflict with one another, and --title (a title shown in the review summary) works only with --commit. So you cannot add a focus to --base main; if you want both, put both in the instructions, for example by asking for a review of the changes on the current branch against main with attention to the migration.

In the source, codex review is a front door to codex exec: it builds a codex exec review run. Calling that form directly gives you exec’s output options, which are defined to work with its subcommands:

codex exec review --base origin/main -o review.md   # the final review written to a file
codex exec review --uncommitted --json              # events as JSON lines on stdout
Copied

Two things carry over from codex exec. First, a repository’s own .codex/ configuration and MCP servers load only for a trusted project; --trust trusts it for this and future runs, which you should not do on a checkout of someone else’s pull request (the reasons are in Codex’s untrusted project configuration warning). Second, authentication: on a machine signed in with ChatGPT the review uses your plan, and with no sign-in it accepts CODEX_API_KEY, billed at API rates (setting that up is in Codex with an API key).

codex review in GitHub Actions

A minimal job that reviews each pull request against its base branch and posts nothing back, keeping the review as a job artifact. It skips pull requests from forks and from Dependabot, which get no secrets, checks out full history so the merge base exists, gives the job read access only, keeps the API key on the one step that needs it, as OpenAI’s non-interactive mode page advises, and pins the CLI version:

name: Codex review
on:
  pull_request:

jobs:
  review:
    if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
          persist-credentials: false
      - run: npm install -g @openai/codex@0.172.0
      - name: Review
        env:
          CODEX_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          BASE_REF: ${{ github.base_ref }}
        run: codex exec review --base "origin/$BASE_REF" -o review.md
      - uses: actions/upload-artifact@v4
        with:
          name: codex-review
          path: review.md
Copied

The if: line is there because GitHub says secrets “are not passed to the runner when a workflow is triggered from a forked repository,” nor to Dependabot’s, so those runs would only fail. In this job the key sits in the environment of the Codex process itself while it reads the pull request’s code, and the review it writes is uploaded where anyone who can see the run can download it, so keep it to repositories whose branches come from people you trust with that key. OpenAI’s own action, openai/codex-action, holds the key in a proxy outside Codex instead, and its two-job pattern (Codex reads, a separate job without the key posts the comment) is set out in Codex and GitHub.

@codex review on GitHub pull requests

This is the cloud side: Codex reviews in OpenAI’s cloud and posts its comments on the pull request. It needs the ChatGPT Codex Connector GitHub app on the repository (connecting it, and what that app may do, is in Codex and GitHub) and push or admin permission on the repository for its settings. It does not need a Codex Cloud environment. Then, per OpenAI’s GitHub review page:

  1. Open chatgpt.com/settings/code-review.
  2. Choose the repository and turn on Automatic review under Review code.
  3. On a pull request, comment @codex review. Codex reacts with 👀, then posts a review.

Add a focus after the command, as in OpenAI’s example @codex review for issues in the database migration. For your own pull requests to be reviewed without a comment, turn on Automatic review under Personal preferences on the same page and choose when with Review trigger; that setting applies in every repository that has code review on.

What to expect in the review. OpenAI says “In GitHub, Codex flags only P0 and P1 issues so review comments stay focused on high-priority risks.” The comments appear on GitHub and in Codex’s own Code Review view. OpenAI is plain that review rules “don’t replace tests, branch protections, or required approvals.” For security in particular, @codex security review runs a separate, deeper pass, in research preview; which plans have it is in Codex and GitHub.

Review guidelines: AGENTS.md

Codex reads the repository’s AGENTS.md files for a ## Code Review Rules section, and for each changed file applies the root file’s rules plus those of any more specific AGENTS.md nearer to it, so a service’s rules can live in that service’s folder and unrelated pull requests don’t carry them. OpenAI suggests starting with two or three concise rules about consequential, repository-specific behaviour, each stating the safe path, and leaving formatting and lint to CI. Rules of that shape look like this:

## Code Review Rules

- Flag any new endpoint that skips the auth middleware; the safe path is the
  router's authenticated group.
- Flag SQL built by string concatenation; use the query builder's parameters.
Copied

How nested AGENTS.md files combine generally is in what AGENTS.md is. OpenAI documents these rules for GitHub reviews; for a local /review or codex review, the custom instructions preset is the documented way to steer it.

When Codex doesn’t respond

OpenAI’s checklist:

Plans and how reviews count against usage

OpenAI’s pricing page lists “Local code review with /review” on every plan in its comparison, the API key included, and “GitHub code review and automatic PR reviews” on Plus, Pro, Business and Enterprise/Edu but not on an API key, whose card reads “No cloud-based features (GitHub code review, Slack, etc.)”. The page says nothing of code review on Free or Go. On usage, its FAQ draws the line by where the review runs:

Code Review usage applies only when Codex runs reviews through GitHub ...
Reviews run locally or outside of GitHub count toward your general usage limits.
Copied

So /review and codex review on a ChatGPT sign-in spend the same allowance as any other Codex work (and hit the same usage limit), with an API key they are billed per token, and @codex review and automatic reviews draw on Code Review usage instead. How much each plan carries is in which ChatGPT plans include Codex.

Compared with Claude Code’s review

Anthropic splits the same jobs differently, per its Code Review docs as read on November 28, 2026. Its managed pull request reviewer is for Team and Enterprise plans only, is turned on by an organisation Owner, and is billed on token use through usage credits, separately from the plan’s included usage; it is triggered with @claude review, and Anthropic notes that by itself a review “doesn’t approve or block the pull request.” Codex’s GitHub review starts at Plus and draws on the plan’s Code Review usage rather than separate billing. Locally the two are closer: Claude Code’s /code-review works on any plan, like Codex’s /review. The details are in Claude Code review, and the agents compared more broadly in Codex vs Claude Code.

Run Codex on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.