Make /diff an interactive TUI explorer
What variant of Codex are you using?
CLI
What feature would you like to see?
/diff in the TUI currently renders a static git diff-style pager. That works for very small patches, but it becomes hard to review real multi-file changes because there is no file list, no fast file-to-file switching, and no dedicated preview pane.
I would like /diff to open an interactive TUI diff explorer instead of a raw pager.
A good baseline experience would be:
- a left pane with the changed file list
- per-file
+/-counts in that list - a right pane showing the selected file's diff preview
- keyboard navigation between the file list and the preview pane
- support for modified, renamed, and untracked files
- responsive scrolling for large diffs
This would keep review inside Codex CLI instead of forcing users to switch to VS Code, GitLens, or another terminal UI just to inspect changes comfortably.
Additional information
This request is specifically about the CLI/TUI /diff command, not the App or IDE extension diff UIs.
I also built a working prototype locally on a fork. Since external PRs are not currently accepted, I am opening this as an issue instead.
Prototype branch and compare link:
- branch:
Lloyd-Pottiger:tui-diff-explorer - compare: https://github.com/openai/codex/compare/main...Lloyd-Pottiger:codex:tui-diff-explorer?expand=1
- commit:
8d27bd368(feat(tui): add interactive /diff explorer)
The prototype does the following:
- parses git diff output into structured per-file changes
- opens
/diffin a two-pane explorer with file switching and preview scrolling - includes rename and untracked-file handling
- caches preview rendering to avoid lag on large diffs
- keeps the new UI isolated in a dedicated
diff_explorermodule
Validation run locally:
cargo fmt -p codex-tuiCODEX_SKIP_VENDORED_BWRAP=1 cargo test -p codex-tui diff_explorer_overlay -- --nocaptureCODEX_SKIP_VENDORED_BWRAP=1 cargo test -p codex-tui parse_tracked_git_diff_splits_modified_and_renamed_files -- --nocapture
5 Comments
<img width="3024" height="1964" alt="Image" src="https://github.com/user-attachments/assets/d76a8749-68a7-4fac-8ded-b9c1925d025f" />
I would like to work on this. @etraut-openai
A smaller first version could focus on improving the existing
/diffflow without trying to build the full Cursor-like experience immediately.Proposed v1 scope:
/diffas the entry point/diff <file>for directly opening a clean per-file diffThis would make the feature useful quickly while keeping the PR small and easier to review.
If maintainers agree with this scope, I can start by exploring the current TUI diff implementation and submit a focused PR.
@cm-collins, we generally prioritize Codex features based on community feedback (upvotes). This feature request hasn't received any upvotes yet. We don't generally accept external code contributions.
sure , I understand @etraut-openai
This feature request hasn't received enough upvotes, so I'm closing.