[FEATURE] Ignore-whitespace option for Edit tool diff display
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The Edit tool's diff approval UI shows the full old_string and new_string blocks. When a change is purely positional — e.g. reordering function declarations within a file — the diff highlights every line as removed and re-added, even though the code itself is unchanged. There's no way to see only the substantive changes.
This is the same problem git diff -w / --ignore-all-space solves: strip whitespace noise so the reviewer can focus on what actually changed.
Proposed Solution
Add an option — either a global setting (diffIgnoreWhitespace: true) or a per-diff toggle in the approval view — that collapses whitespace-only differences when rendering Edit tool diffs.
Alternative Solutions
- Run
git diff -wafter approving to verify the change was correct — but this defeats the purpose of the approval step - Use smaller, more targeted Edit calls — but reorder refactors inherently require moving large blocks
- #7599 requested better diff display and was closed as "not planned"
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
Upgrading a Next.js project from 15 to 16 introduced new ESLint rules (react-hooks/immutability) requiring function declarations to be reordered above useEffect calls. Every fix is a pure positional move — zero logic changes — but the Edit tool diffs are unreadable walls of red/green. Reviewing 13 of these across 8 files is slow and error-prone because the signal (nothing changed) is buried in noise (everything moved).
Additional Context
Every major code review tool (GitHub, GitLab, Gerrit, VS Code) supports ignore-whitespace toggles. This is a solved problem in every other diff viewer.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗