What Codex does for code review
- Reviews each pull request for bugs, missing tests and risky changes, and comments inline on GitHub.
- Follows your written review rules, so comments stay off what the linter already checks.
- Reviews its own changes, and other agents', before they reach a person.
- Tracks follow-ups: a comment that needs work becomes an issue instead of getting lost.
Codex features for code review
| Feature | What it does | How to start |
|---|---|---|
/review | Reviews changes against a base branch, or uncommitted changes, without editing files | Type /review in the CLI, the app or the IDE extension |
codex review | The same review without the interactive interface, for scripts and CI | codex review --base main |
@codex review | Reviews a GitHub pull request and posts a standard review; flags P0 and P1 issues | Comment on the pull request, with a focus if you like |
| Automatic review | Reviews pull requests without being asked | Turn it on per repository in Codex settings |
How to set up Codex for code review
Connect the tools
/reviewneeds only a Git repository. For reviews on GitHub, connect the repository to Codex and turn on code review for it in Codex settings.# On GitHub, in a pull request comment @codex review @codex review for issues in the database migrationWrite the rules in AGENTS.md
Codex reads AGENTS.md before any work:
~/.codex/AGENTS.md, then the files from the repository root down to the folder it's working in. Put the job's rules there, or in a skill under.agents/skills/if they're long. See the AGENTS.md guide.## Code Review Rules - Flag missing tests for new branches in billing/ and auth/. - Any SQL migration needs a rollback; say so if it doesn't have one. - Don't comment on formatting; the linter handles it. - Comment only: never approve, request changes or merge.Run it without the interactive interface
codex execruns one task and exits. Progress goes to stderr and the final message to stdout;-oalso writes it to a file and--jsonstreams events. The sandbox is read-only unless you pass--sandbox workspace-write.# Review this branch against main from a script or CI codex review --base main # Or the changes that aren't committed yet codex review --uncommittedPut it on a schedule
Create a scheduled task in the ChatGPT desktop app or on the web (the CLI doesn't manage them), or run
codex execfrom cron. See how to make Codex proactive.
Limits and safety
- It comments; it doesn't own the change. Keep approvals and merges with people.
- Reviews use your plan's usage. Review on request or when a pull request is ready, not on every push.
- It reviews the diff and the repository. It can't test against production data.
- Codex sandboxes commands by default: writes stay in the workspace and the network is off. Keep
danger-full-accessfor an isolated runner or container.
Claude Code or Codex for code review?
The rules carry over. Write them once in AGENTS.md and put @AGENTS.md in CLAUDE.md, and both agents read the same file.
Step by step for the other agent: code review with Claude Code.
| Claude Code | Codex | |
|---|---|---|
| Rules file | CLAUDE.md | AGENTS.md |
| Connect tools | claude mcp add | codex mcp add or config.toml |
| Run without you | claude -p | codex exec |
| Schedule | /schedule, desktop scheduled tasks, /loop | Scheduled tasks in the ChatGPT app, cron |
| Built in for code review | /code-review, /code-review ultra, @claude review | /review, codex review, @codex review |
Make code review someone's job
Commands run when someone remembers to run them. Crewmark turns your own Codex into an AI employee with a role, a goal in numbers, working hours and a heartbeat, so the work happens on schedule and shows up on a board.
Start from the role
The AI software engineer, with these rules in its brief.
Put the work on its board
Add the job as a recurring issue. The employee wakes on its heartbeat, does it and reports in a comment.
Related
AI code review on every PR compares every option, and security review covers vulnerabilities.
FAQ
How do I get Codex to review a pull request?
Comment @codex review on the pull request, or turn on Automatic review in Codex settings. Code review has to be enabled for the repository.
Can Codex review code locally?
Yes. Type /review in the CLI, the app or the IDE extension and choose a base branch or uncommitted changes, or run codex review --base main from a script.
How do I give Codex our review rules?
Add a ## Code Review Rules section to the AGENTS.md closest to the code it governs. Say what to flag, and leave formatting to the linter.
Why did Codex only flag a few issues?
On GitHub, Codex flags only P0 and P1 issues to keep comments focused. Add a focus after @codex review when you want it to look at something specific.
Checked against Claude Code's and OpenAI's Codex documentation on November 13, 2026.