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
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗