Add setting to control diff context size in CLI edit previews
Resolved 💬 2 comments Opened Apr 15, 2026 by MiloNash Closed May 24, 2026
Problem
When Claude Code proposes a code edit in the CLI, the diff preview shows a small number of context lines around the change. For edits in the middle of a method or class, it can be hard to orient yourself without seeing more of the surrounding code.
Proposed solution
Add a setting (e.g. diffContextLines) to control how many lines of context are shown before and after each change hunk in the CLI edit preview. For example:
{
"diffContextLines": 10
}
The default could remain as-is for users who prefer compact diffs, while users who want more context can increase it.
Alternatives considered
- Using an IDE extension where the native diff viewer shows full context - works but not always an option for CLI-first workflows
- Setting
diffToolto an external viewer - adds friction to the approve/deny flow
Additional context
This would help with reviewing edits in larger files where the surrounding code is needed to understand whether the change is correct.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗