Codex CLI: add pre-apply interactive diff approval for every file edit
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
Codex CLI in the terminal, editing local workspace files.
What feature would you like to see?
Add a native pre-apply interactive edit-review mode to Codex CLI, comparable to the edit dialog in Claude Code CLI.
Before modifying any local file, Codex CLI should:
- Show the exact proposed diff.
- Keep the edit pending without writing it to disk.
- Wait for an explicit user decision.
- Offer native choices equivalent to Yes, Yes and accept edits for this session, and No.
- Keep terminal chat input available so the user can request corrections or additional changes while reviewing the pending edit.
- Apply only the exact diff that was approved.
- Request approval again whenever feedback causes the proposed diff to change.
This should work for every local file, including LaTeX, Markdown and configuration files, without requiring an IDE or a Git repository.
Reference behavior in Claude Code CLI
Do you want to make this edit to file.tex?
❯ 1. Yes
2. Yes, and switch to accept edits (auto-approve file edits and common file commands) for this session (shift+tab)
3. No
The proposed diff uses line-level and intraline highlighting. An added line is green, while the exact new words or characters within it use a stronger green. Removed content receives the corresponding red treatment. While this edit dialog is pending, the user can type instructions in the terminal chat and ask for a revised edit.
Current behavior
Codex CLI can apply local patches directly. A user can ask the agent to print a diff in ordinary chat and wait for a typed yes or no, but this is only a conversational convention. There is no native pending-edit state binding the displayed diff, the user decision and the exact patch eventually applied.
Post-apply Git diff inspection or Undo is not equivalent because the workspace file has already been modified.
Expected behavior
No file should change before the user accepts the exact pending diff through the native Codex CLI interface. If the user gives corrective feedback, Codex should replace the pending proposal with a revised diff and request approval again.
Why this matters
For controlled document editing, every generated change may require human review before it reaches the working file. Conversational approval is ambiguous and error-prone during long sessions.
A native pre-apply edit-review loop would provide:
- a clear pending, applied or rejected state;
- assurance that the applied patch matches the reviewed patch;
- precise line-level and word-level review;
- safer editing of documents and sensitive files;
- support outside IDEs and Git repositories.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Codex CLI's local patch-application path and its existing conversational approval behavior. Trace how proposed diffs, terminal input, and file writes are coordinated; done means every local edit remains pending until explicit approval, applies only the approved diff, and re-prompts after feedback changes it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100