Section650

Writing

TopicAI
Reading6 min

A Code Review Workflow With Claude and Codex

A proposed cross-model review workflow and the research on where pairing Claude and Codex helped or hurt.

By Ka Lun Chan · Cloud & AI · AI / Delivery / Engineering judgment

A two-agent code review workflow

In this proposed workflow, Claude writes and Codex reviews, or the pairing is reversed. The author addresses findings, the reviewer checks the fixes and a person approves the latest commit before merge.

A separate reviewer reads the change without the author’s implementation assumptions. Keeping fixes with the author gives one agent responsibility for the patch. The person approving remains accountable for the outcome.

What is the Claude and Codex review workflow?

The author implements the change. The reviewer reads the diff against the requirements and repository rules, then reports findings. The human approver settles disputed tradeoffs and decides whether to merge.

Four activities stay separate. Review means reading the code and reasoning about it. Testing means running it and observing what happens. Approval is a person accepting the change. Merging is the mechanical step afterward. A clean review says nothing about whether tests passed, and green tests aren’t an approval.

Fig. 732-1 Who does each step, depending on which agent wrote the code
StepWhen Claude authorsWhen Codex authors
Write codeClaudeCodex
Review codeCodexClaude
Address findingsClaudeCodex
Review the fixesCodexClaude
Approve mergeHuman ownerHuman owner
Execute merge after approvalClaudeCodex
The fix-and-review steps repeat while material findings remain. A person approves in both workflows.

Why separate writing from review?

An agent that writes code also builds a story about why the code is correct, and when it reviews its own work it tends to check the code against that story. A separate reviewer starts from the diff and the requirement. That gives you another chance to catch a wrong assumption, a missed edge case, or a requirement read too narrowly.

Two agents can miss the same issue. A reviewer can also recommend an incorrect fix. The author should evaluate each finding, with unresolved disagreements going to the person approving.

The research also cuts against the idea that any second model helps. In a study posted to arXiv in July, Zuodong Xiang and colleagues compared cross-model review on 116 medium and hard LiveCodeBench problems, using Claude Opus 4.7 and GPT-5.5 in the Codex CLI. When Codex wrote and Claude reviewed, the pass rate rose from 71.6% to 89.7%. When Claude wrote and Codex reviewed, it fell from 91.4% to 82.8%, with 13 regressions against 3 fixes. Claude working alone scored highest of all six conditions.

The authors describe a bounded study of self-contained programming tasks. The reviewer couldn’t run code and had to rewrite the whole program. The result supports checking reviewer findings and gives little basis for assuming the two pairings are interchangeable.

Who owns each decision?

The author owns the implementation and every fix, so two agents never edit the same change with different ideas about it. For each finding, it changes the code, adds a test, or explains why the finding doesn’t apply.

The reviewer owns the findings. A useful finding names the location, describes the failure it expects, and says what evidence would confirm or rule it out; “consider adding error handling” doesn’t qualify. On the next pass, the reviewer checks that each fix resolves its finding.

The approver owns the tradeoffs and records the decision in the pull request when the agents disagree.

The reviewer also needs the project’s rules, written down. OpenAI documents that Codex code review can apply rules from AGENTS.md, with repository-wide guidance at the root and service-specific guidance in nested files. The same post calls Codex an additional reviewer and says tests, branch protections and required approvals still do the hard enforcement.

When is the extra review worth it?

Every round costs time and tokens. In the study above, a reviewed task cost roughly 1.7 to 2.3 times as much as the author working alone. A copy fix or a dependency bump rarely earns that.

Review should go deeper when mistakes are costly to undo. In a migration, check what happens to existing rows and whether rollback works. See How to Verify AI-Generated Code.

Where does the workflow happen?

In the pull request. It holds the requirement, the diff, each finding and how it was resolved, test evidence, risks left open, and the approval.

Switching agents doesn’t change who GitHub thinks did the work. If both agents push with your credentials, every commit comes from your account, and an agent’s comment counts as an approval only if your setup makes it one. GitHub rulesets can dismiss stale approvals when new commits change the diff, require approval of the most recent push from someone other than the person who pushed it, and require status checks to pass before merging. If agents push as you, your own approval can’t satisfy that “someone other than the last pusher” rule, so check how your branch rules handle it.

How does a change move from first commit to merge?

  1. The author implements the change and opens a pull request with the requirement, test results, and anything it didn’t test.
  2. The reviewer reviews the latest commit and posts findings with evidence.
  3. The author addresses each finding with a fix, a test, or a reasoned rejection.
  4. The reviewer checks the fixes on the new commit. If material findings remain, the change goes back to step 3.
  5. If the reviewer edits code directly, that edit is new code. The author reviews it, and the reviewer checks the resulting commit like any other.
  6. Required checks pass and a person approves the latest commit.
  7. Merge after approval. Material changes go back through review and need fresh approval.
Fig. 732-2 How a change moves from first commit to mergeSame steps whichever agent authors.
  1. Write

    The author implements the change and opens a pull request with the requirement, test results and anything it didn’t test.

  2. Review

    The other agent reviews the latest commit and posts findings with evidence.

  3. Fix

    The author answers each finding with a fix, a test or a reasoned rejection.

  4. Check the fixes

    The reviewer checks the new commit. Material findings left? Back to Fix. If the reviewer edited code itself, the author reviews that edit first.

  5. Approve

    Required checks pass and the human owner approves the latest commit.

  6. Merge

    The authoring agent merges. A material change after approval goes back to Review.

Steps 03 and 04 repeat until no material findings remain. Nothing reaches step 06 without the approval at step 05.

Testing depends on the project. On an event-registration project, the policy is to test the changed behavior and the integrations it touches during development, then run the full application regression suite before deployment. That policy fits that project. It doesn’t replace the CI checks a repository requires. Either way, the pull request should say which tests actually ran, what was only inspected, and what wasn’t tested.

Hypothetical example: two people, one remaining place

This is an illustrative review scenario.

An event has one place left. The author’s registration code reads the remaining count, sees one, inserts the registration, then decrements the count. In review, Codex or Claude flags that two requests arriving together can both read one remaining place before either writes, so the event oversells. A test that sends two registrations in parallel would confirm it.

To fix it, the author changes the write to a single conditional update that only succeeds while a place remains, such as UPDATE events SET remaining = remaining - 1 WHERE id = $1 AND remaining > 0, and treats zero updated rows as sold out. It adds a test that fires two parallel requests at a real database and expects exactly one confirmation and one sold-out response. On the new commit, the reviewer also checks that the registration insert runs in the same transaction. Anything the test doesn’t cover, such as heavier concurrency or places held during payment, goes in the pull request as untested.

Sources

Checked in November. The workflow and the opinions are mine; the registration example is hypothetical.

Short answers

How do you use Claude and Codex together for code review?

One agent writes the change and the other reviews it. If Claude writes the code, Codex reviews it; if Codex writes it, Claude reviews it. The authoring agent fixes the findings, the reviewer checks the fixes, and a person approves the pull request before the authoring agent merges it.

Does using two different models guarantee a better review?

No. In a cross-model study on 116 programming problems, Claude reviewing Codex raised the pass rate while Codex reviewing Claude lowered it. Different models can share blind spots, so findings need evidence and the author still verifies each fix.

Can an AI review replace human approval on GitHub?

Not by itself. GitHub counts approvals from people with write access or code owners, and OpenAI describes Codex review as an additional reviewer, with tests, branch protections and required approvals still doing the enforcement.

Before you let an agent merge

If you’re setting up a similar workflow, check these first:

  1. The reviewer has the project’s rules in writing, not just “review this code.”
  2. Every finding comes with a location and the evidence that would confirm it.
  3. Approval is tied to the latest commit, and a material change after approval means another review.
  4. The pull request says which tests ran and what wasn’t tested.

Start review planning before implementation. See Code Review Doesn’t Start With a Pull Request.

Discuss what you’re building How feedback loops shape agent work