Make “review → fix → repeat until clean” workflow scriptable
What variant of Codex are you using?
CLI
What feature would you like to see?
Background
My typical Codex CLI workflow looks like this:
- Make a change
- Run
/review - Type "fix it" and wait for the fixes
- Repeat until
/reviewis clean
It works well interactively. The problem is that I'm in the middle of this loop and there’s no way (that I know of) to automate this pattern in a reliable, headless way (e.g. via a command or codex exec).
/review is interactive and not exposed as a callable primitive. There’s no structured output mode, and the underlying reviewer configuration isn’t accessible. So if I want to automate the loop, I have to reimplement “review” myself with a custom prompt, which is probably going to be inferior to whatever /review is using internally, and even if it's not, it's still reimplementing the wheel.
---
What I’m Looking For
Support for a deterministic, scriptable version of:
review → fix → review → fix → … until clean
Using the same built-in prompt or instructions as /review.
---
Proposed Solutions
Option 1: Add a Built-in /review-and-fix Command
Introduce something like:
/review-and-fix
Behavior:
- Collect diff (same logic as
/review) - Run review
- Apply fixes automatically
- Re-run review
- Repeat until:
- No issues remain, or
- A max iteration limit is reached
Optional flags:
/review-and-fix --max-iterations 5
/review-and-fix --run "make test"
This keeps everything internal and consistent with /review.
---
Option 2: Expose /review as a Headless Mode
Instead of adding a new command, expose the reviewer as a callable mode for exec, for example:
codex exec --mode review --json
Or expose the exact reviewer system prompt/config so users can build automation around it.
---
Why This Matters
Right now, /review is good but siloed in the TUI. If Codex CLI is meant to support serious engineering workflows, the same review capability should be available in an automated or scriptable fashion.
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗