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 inside a disposable development container before a full-access review. Review can send the diff and nearby repository context to the configured backend, so the container's 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.
- Resolve main as the intended merge target.
$ git rev-parse --verify 'main^{commit}' 33f678735c027fec9156cdcaf7e4b5776f9cdceaA different target name replaces main throughout the comparison. A remote-tracking reference such as origin/main is also valid when it has already been fetched. 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 main...HEAD diff --git a/app.py b/app.py index 5949475..f05f07b 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 main and HEAD. Changes made only on the target branch after that point are excluded.
- Run the base-branch review with its response saved outside the repository.
Full access lets Codex run commands without its filesystem sandbox. This mode belongs inside a disposable development container with no unrelated host mounts. The redirect overwrites an existing review file at the same path.
$ codex review --base main -c 'sandbox_mode="danger-full-access"' > /tmp/codex-base-review.txt
Codex sends progress to the terminal and saves the review response to the file. An execution or authentication error requires a successful rerun before the saved file can be treated as a review.
- Read the saved review for findings on the branch diff.
$ cat /tmp/codex-base-review.txt The change introduces a nonzero delay for zero attempts, violating the function's explicit contract. Review comment: - [P2] Preserve the zero-delay behavior for zero attempts — /work/example-app/app.py:6-6 For `attempt=0`, the new lower bound returns `0.25` seconds instead of `0`, contradicting the function's documented contract that zero attempts means no delay. Negative attempts also now incur a delay rather than being clamped to zero. Restore the lower bound of zero to preserve the existing behavior.
Review wording varies with the code and model. Here the cited line is the changed return expression in the previewed diff. The saved response remains available without running another review, and findings still need human assessment before fixes.