A feature branch can contain several commits whose changes interact with one another. A Codex base-branch review examines that combined change set before a pull request or merge.
The comparison starts at the common ancestor of the feature branch and its target, rather than the target's latest commit. Both branches must resolve in the local Git repository, and the target reference must reflect the version the feature branch is intended to merge into.
The Codex CLI must already be installed and signed in, with read access to the intended checkout. Review can send the diff and nearby repository context to the configured backend, so the repository must be free of secrets and unrelated private data.
Steps to review changes against a base branch with Codex:
- Confirm that the repository has the intended feature branch checked out.
$ git status --short --branch ## feature/retry-floor
The branch name appears after ##. File entries below it indicate uncommitted work that can affect the context the reviewer reads.
- Refresh the merge target's remote-tracking reference from origin.
$ git fetch origin
origin must be the remote containing the intended merge target. Fetching updates remote-tracking references without merging changes or switching the feature branch. The fetch output depends on the remote and which references changed.
- Resolve origin/main as the intended merge target.
$ git rev-parse --verify 'origin/main^{commit}' de735a02dae5702acac2c7830807fd0930ed9fa4origin/main means the main branch fetched from origin. A different merge target replaces origin/main throughout the comparison. A current local branch such as main is also valid. An unknown reference produces a fatal error instead of a commit ID.
- Inspect the changes since the feature branch diverged from the base.
$ git diff origin/main...HEAD diff --git a/app.py b/app.py index ba16c7a..15bc097 100644 --- a/app.py +++ b/app.py @@ -3,4 +3,4 @@ def retry_delay(attempt): """Return seconds to wait; zero attempts means no delay.""" - return min(max(attempt, 0) * 0.25, 4.0) + return min(max(attempt, 1) * 0.25, 4.0)The triple-dot comparison uses the merge base between origin/main and HEAD. Changes made only on the target branch after that point are excluded.
- Run the base-branch review in the same checkout.
Review needs only read access. Approval requests to edit files, switch branches or access unrelated data are outside this inspection.
$ codex review --base origin/main
Codex displays progress and the completed review in the terminal. An authentication error or an unresolved target does not constitute a completed review.
- Read the completed review's findings in the terminal.
The changed lower bound introduces a delay for zero attempts, directly contradicting the function’s documented contract. Review comment: - [P2] Preserve the zero-attempt no-delay behavior — /work/example-app/app.py:6-6 For `attempt=0`, this now returns `0.25` instead of `0.0`, violating the explicit contract that “zero attempts means no delay.” Negative attempts also change from no delay to a positive delay. Retain the zero lower bound to preserve the documented behavior.
Review wording varies with the code and model. Here, the finding identifies app.py:6 and explains why changing the lower bound makes retry_delay(0) return 0.25 seconds. A completed review may instead report no findings. Findings still need human assessment before fixes.