-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Summary
Add a staged-only review mode to codex exec review and the app-server review APIs.
Proposed usage:
codex exec review --staged
Motivation
review --uncommitted is useful for reviewing the entire working tree, but in many real workflows the desired review scope is the exact staged set that is being prepared for shipping. Uncommitted changes are often broader or noisier than the intended review target, while staging provides precise control over scope, including hunk-level selection within a file.
Proposed behavior
When --staged is used, review should run against a temporary snapshot materialized from the current Git index, so the reviewer sees exactly the staged contents and does not get confused by unstaged edits in the working tree.
Implementation notes
The core design is to treat this as a Git/data-source feature rather than a prompt-only feature:
- add a staged review target through protocol and app-server surfaces
- add
--stagedtocodex exec review - create a detached temporary worktree from
HEAD - copy the current index into that worktree
- materialize the staged tree with
git checkout-index - run the review turn from that snapshot cwd for the lifetime of the review task
Validation
A working implementation is available here:
That PR is for my personal use right now, and I am using it locally from my fork rather than submitting it as an upstream PR.
That PR includes passing targeted tests for git snapshot behavior, core prompt/hint behavior, exec request building and CLI parsing, and app-server review start behavior.