AI code review runs in three places: on your machine before you commit, in your CI, and on the pull request. Before you commit, a CLI or editor command reviews your local changes: /review in Codex, /code-review in Claude Code, coderabbit review --uncommitted in the CodeRabbit CLI. Git's pre-commit hook runs at git commit and can call any command, but anyone can skip it with --no-verify. In CI, a GitHub Action from Anthropic or OpenAI can run the review on pull request events. On the pull request, a reviewer such as Copilot code review runs on request, or automatically if set up. Wherever it runs, keep your rules in a file and the diff small, check each finding against the diff, and merge after your usual checks and a person's decision.
Every fact below comes from each vendor's own pages as I read them on 6 November 2026, and none of them saw this text before publication.
How to run an AI code review, step by step
- Pick where the review runs. On your machine before you commit or push, as a job in your CI, or on the pull request; each place has its own section below.
- Pick what it reads. Uncommitted or staged changes, your branch against its base, one commit or one path: in the Codex CLI, Review a commit "reviews the exact change set for a selected commit.", and in Claude Code,
/code-review src/authpoints the review at one directory. - Give it your rules in a file in the repository. For the
/code-reviewcommand, Anthropic writes: "To give every review project rules to follow, add them to yourCLAUDE.md." - Run it, then read the findings by severity. In the CodeRabbit CLI, "The default plain-text mode displays a finding count and severity summary at the end of each run."
- Check each finding against the diff, then fix it or answer it. OpenAI's advice for an automatic Codex review is one line: "Check the review findings against the diff."
- Before you merge, look at the latest revision, the checks and the open comments. OpenAI's page on code review puts it this way: "Before approving or merging, check the latest revision, checks, and outstanding feedback."
The question behind this article came from a developer who wanted AI review on git add, before committing and pushing, and who asked whether to set up a git hook in every project or use a package for it. The sections below take the three places in turn, and the hook question closes the first of them.
Ways to start a review, tool by tool
| Tool | Where it runs | How you start it | What it reviews |
|---|---|---|---|
| Codex CLI, IDE extension or app (OpenAI) | your Git checkout | /review | Review against a base branch or Review uncommitted changes; the CLI also offers Review a commit and Custom review instructions |
| Claude Code (Anthropic) | your Claude Code session | /code-review, or its alias /review | with no target, "your branch's commits ahead of its upstream branch plus your uncommitted changes"; or the target you type: a pull request number, a branch, a commit range or a path |
| CodeRabbit CLI | your terminal | coderabbit review | by default, tracked changes: committed, staged and unstaged edits to tracked files; --uncommitted for staged and tracked local edits only; --include-untracked adds files not yet added to Git |
| GitHub Copilot in VS Code, Visual Studio, Xcode or JetBrains IDEs | your editor | VS Code: select code, or the review button in the Source Control view; Visual Studio: Review changes with Copilot; Xcode: Review Staged Changes or Review Unstaged Changes; JetBrains: Copilot: Review Code Changes | a selection of code, or your local changes |
| Cursor Bugbot | your agent in Cursor 3.7+, at cursor.com/agents or in the Cursor CLI | /review-bugbot or /review | by default "every change relative to the base branch, including committed and uncommitted changes", or only uncommitted changes when you ask |
| Claude Code GitHub Action (Anthropic) | your CI runners | /install-github-app from Claude Code sets up the workflow; the review workflow runs on pull request events | the pull request |
| Codex GitHub Action (OpenAI) | your CI runners | openai/codex-action@v1 in a workflow, with the prompt inline or in a file | the pull request, in OpenAI's sample workflow |
| GitHub Copilot code review | GitHub | under Reviewers on the pull request, click Request; from a terminal, gh pr edit PR-NUMBER --add-reviewer @copilot or gh pr create --reviewer @copilot; automatically only if configured | the pull request |
| Claude Code Review (Anthropic) | Anthropic infrastructure | a setting for each repository, or an @claude review comment from someone with write access | the pull request; for Team and Enterprise plans |
| Codex on GitHub (OpenAI) | OpenAI | an @codex review comment, or Automatic review in Codex settings | the pull request |
| Cursor Bugbot on the pull request | Cursor | automatically on each PR update, or a cursor review or bugbot run comment | the pull request |
| CodeRabbit on the pull request | CodeRabbit | automatic by default on eligible pull requests, or an @coderabbitai review comment | the pull request |
| Sigma | Sigma | "Open New review in Sigma and choose a pull request from your connected repositories."; "Prefer GitHub? Comment /sigma review on the PR." | its docs: "Sigma reviews pull requests from GitHub." |
Each row is in the vendor's own words or a close paraphrase of its page as I read it on 6 November 2026; the list covers the tools whose review pages I read and is not exhaustive.
Before you commit: review the diff on your machine
A review before you commit reads the changes in your own checkout and reports them in your terminal, session or editor.
OpenAI writes that "Codex's built-in /review command reviews changes in your Git checkout, while the Code Review plugin works with pull requests." In the CLI, /review opens a list of presets, and the reviewer "reports prioritized, actionable findings without changing your working tree." The Review uncommitted changes preset "includes staged, unstaged, and untracked files.", and Review against a base branch "finds the merge base and reviews your branch diff." Codex applies fixes only when you ask it to, under your normal sandbox and approval settings.
Anthropic describes /code-review as "a command you type at the Claude Code prompt, in the session where you're working.", adds that "The command works on any plan." and that a review counts toward your plan's usage or API billing like the rest of the session, and lists a --fix flag that "also asks Claude to apply the findings to your working tree after the review."
The CodeRabbit CLI page answers the git add case directly: "By default, it reviews tracked changes: committed changes, staged changes (including new files added with git add), and unstaged edits to tracked files." The other side is stated too: "Files not added to Git are skipped unless you pass --include-untracked."
In an editor, GitHub writes that "If you have uncommitted changes, you can request a review in Visual Studio Code.", and that "Any changes you apply will not be automatically committed." Visual Studio, Xcode and JetBrains IDEs each have their own button for the same review, listed in the table above.
Cursor documents this step for Bugbot: "Use the /review-bugbot or /review skills to run Bugbot from your agent before you push the code." The local run and the pull request stay linked: "When Bugbot on your SCM sees a diff with the same patch ID, it skips the review and leaves a comment noting it already reviewed that diff."
Git's pre-commit hook runs when you run git commit. In git's manual, this hook "is invoked by" git commit, "can be bypassed with the --no-verify option.", and "It takes no parameters, and is invoked before obtaining the proposed commit log message and making a commit." A non-zero exit from the hook "causes the git commit command to abort before creating a commit." By default the hooks directory is $GIT_DIR/hooks, "but that can be changed via the core.hooksPath configuration variable". The hook is a program, so it can call any command, a review command included, and the commit waits until that command exits. My suggestion: treat the hook as a check for yourself, and put the review that has to happen in CI or on the pull request.
In CI: a review step in your own workflow
A CI review is a job in your own GitHub Actions workflow that runs on your runners on pull request events; both vendor examples below run when a pull request opens, is reopened or gets new commits.
For the Claude Code GitHub Action, the quick setup is to "run /install-github-app from Claude Code", and "For either path, you need admin access to the repository." Its review workflow posts on the pull request only with the --comment argument; without it, the findings stay in the workflow run log. Anthropic also lists the pull requests that this workflow leaves alone: drafts, closed ones, ones Claude judges not to need a review, such as automated or trivial ones, and ones that already carry a comment from Claude.
For the Codex GitHub Action, OpenAI writes: "Use the Codex GitHub Action (openai/codex-action@v1) to run Codex in CI/CD jobs, apply patches, or post reviews from a GitHub Actions workflow." Its example is a review job: "The sample workflow below reviews new pull requests, captures Codex's response, and posts it back on the PR." The workflow takes the prompt in one of two ways: "You can provide inline text via prompt or point to a file committed in the repo with prompt-file." Two cautions sit on the same page: "By default only users with write access can run the action", and "Sanitize prompt inputs from pull requests, commit messages, or issue bodies to avoid prompt injection."
In Anthropic's own comparison of review options, Claude in your CI runs on your runners and starts from your pipeline's events, while the managed Code Review runs on Anthropic infrastructure; the next section covers that one.
On the pull request: request it or let it run
A pull request reviewer starts when someone asks for it or on its own, depending on its settings.
GitHub's default for Copilot is the first: "By default, you manually request a review from Copilot on each pull request, in the same way you would request a review from a human." The next sentence on that page reads "However, you can set up Copilot to automatically review all pull requests." From a terminal, GitHub documents gh pr edit PR-NUMBER --add-reviewer @copilot for an open pull request, and for a new one, "You can request a review from Copilot when creating a new pull request using gh pr create:", with gh pr create --reviewer @copilot. A new push brings no new Copilot review by itself: "it won't automatically re-review your changes unless you've configured it to review new pushes after enabling automatic reviews."
Codex takes an @codex review comment, and "For a one-off focus, add it to your pull request comment:", as in @codex review for issues in the database migration. Anthropic's managed Code Review has a setting for each repository, which runs reviews "once when a pull request opens, after every push, or only on request", and in any of those modes someone with write access can comment @claude review. Cursor's Bugbot runs automatically on each PR update, and manually on a cursor review or bugbot run comment. CodeRabbit's docs say "By default, enabled is true and CodeRabbit reviews every eligible PR automatically"; by default that leaves out drafts and pull requests to branches other than the default one. They add that "you can always trigger a review manually by commenting @coderabbitai review (incremental) or @coderabbitai full review (from scratch) on a pull request."
What each of these reviewers says it checks before it posts a finding is set side by side in a comparison of what AI code reviewers say they check before commenting.
Give the reviewer your rules
Claude Code, Codex and Copilot each read review rules from a file in the repository, and each names that file in its docs.
For Claude Code's /code-review, that file is CLAUDE.md (step 3 above); REVIEW.md configures Anthropic's managed Code Review, and the page on /code-review says that command does not read it. For reviews on GitHub, OpenAI writes that "Codex searches your repository for AGENTS.md files and follows the applicable code review rules.", suggests a ## Code Review Rules section in the file closest to the code it governs, and adds one more piece of advice: "Keep formatting, lint, and other deterministic checks out of review rules." For Copilot, GitHub writes: "Use .github/copilot-instructions.md for repository-wide review guidance that should apply across the entire codebase."
Keep the diff small and the scope narrow
A small diff is easier to check, for the reviewer and for you, and each local tool lets you narrow what it reads.
Claude Code takes a target after the command, such as a pull request number, a branch, a commit range or a path, so /code-review src/auth reviews one directory. CodeRabbit's CLI page writes: "Use --uncommitted to review only staged and tracked local edits." In VS Code, GitHub notes that "You can request an initial review of a highlighted selection of code in Visual Studio Code." How teams keep pull requests small, and what they check before a person reads one, is in How are you guys handling code reviews when a lot of the code is written by AI?.
Read the findings, then check each one
In Copilot, Codex and the CodeRabbit CLI, findings come with a severity or a priority, and each one is a claim to check against the diff, not a fix to apply unread.
Copilot labels each comment with a severity of High, Medium or Low. In GitHub, Codex "flags only P0 and P1 issues so review comments stay focused on high-priority risks." For /code-review, Anthropic ties the effort level to noise: "At low, the review reports the findings it's most confident in, so you see fewer false positives."
Two Copilot notes matter at this step: "Any comments you add to Copilot's review comments will be visible to humans, but they won't be visible to Copilot, and Copilot won't reply.", and on a re-review "Copilot may repeat the same comments again, even if they have been dismissed" with the Resolve conversation button, or downvoted with a thumbs down. Anthropic is plain about the limits of its own reviewer: "Code Review uses AI to review code and may miss bugs, security vulnerabilities, or other issues."
What stays with a person before merge
Before merge, the three pages cited below keep the decision with people and with branch rules.
Anthropic writes that "A review never approves or blocks the pull request, so the decision to merge stays with your team.", and OpenAI's page on review rules adds that those rules do not replace tests, branch protections or required approvals. On GitHub, a protected branch can add Require conversation resolution before merging, which "Requires all comments on the pull request to be resolved before it can be merged to a protected branch."
Sources and method
All pages listed here were read on 6 November 2026; every quotation matched its page word for word on that day, and the text describes those pages as they stood then. The list of tools is not exhaustive: it covers the vendors whose review pages are linked below. The scenario comes from a developer's public question about running AI review before a commit; the text does not link it.
GitHub: using Copilot code review, about protected branches
Anthropic: /code-review, Code Review, Claude Code GitHub Actions
OpenAI: Codex code review, Codex code review in GitHub, Codex GitHub Action
CodeRabbit: CLI, automatic reviews
Cursor: Bugbot
Git: githooks
Sigma: docs
Disclosure: I build Sigma, one of the tools compared here.


