Edit tool diff preview renders entire file as all-green additions (no removals, no context)
Symptom
When Claude Code proposes an Edit tool change, the diff preview shows the entire new file content as one big green block — no red removed lines, no -/+ interleaving, no context lines. Just the full new content rendered as all-additions. Happens for tiny single-line edits to a normal-sized Python file (~200 lines).
Reproduction
- In a Claude Code session, ask Claude to make a one-character or one-line change to an existing Python file.
- Observe the Edit tool's diff preview before approving.
Expected: unified diff with red - removed lines and green + added lines, with surrounding context.
Actual: full new file content shown in green, old lines absent entirely.
Environment
- Claude Code version: 2.1.141
- OS: WSL2 Ubuntu on Windows 11
- Node: v24.15.0 (bundled binary)
- Settings:
{"model": "opus", "theme": "auto"}— no other overrides TERM:xterm-256colorCOLORTERM: unsetCLAUDE_EFFORT:xhigh
Ruled out
- Not line endings — file is LF,
fileconfirms no CRLF. - Not the JetBrains plugin's IDE diff handoff — persists with
ENABLE_IDE_INTEGRATIONunset andCLAUDE_CODE_SSE_PORTunset. - Not the PyCharm "Reworked Terminal" — switched to Classic Terminal, reproduces. Also reproduces in standalone Ubuntu/WSL terminal outside PyCharm entirely.
- Not a per-project setting — project has no
.claude/settings.jsonorCLAUDE.md.
Notes
Binary string search shows the renderer has DiffTooLarge, Binary file - cannot display diff, diffAdded/diffAddedDimmed/diffRemoved/diffRemovedDimmed constants, so a fallback code path appears to exist — possibly being triggered incorrectly here.
Happy to provide more diagnostic info (debug logs, etc.) if useful.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗