[BUG] Write tool diff rendering broken for removed lines (Edit works fine)

Resolved 💬 3 comments Opened Jan 7, 2026 by strjob Closed Feb 28, 2026

Description

The Write tool's diff display shows corrupted/empty removed lines block, while the Edit tool renders identical changes correctly. Maybe related to https://github.com/anthropics/claude-code/issues/14758 and similar issues. Added lines block works correctly.
## Additional Notes

  • Pure ASCII content reproduces the bug - not UTF-8/Cyrillic related
  • Edit tool works perfectly for the same content
  • Bug appears specific to Write tool diff rendering
  • Not a 2.1.0 regression - observed in previous versions as well (exact version when it started is unknown)
  • Possibly related to #14594 / #14705 partial fix that addressed OSC 8 sequences but may have missed Write tool rendering

## Expected Behavior

Removed lines should display with content visible, same as Edit tool.

## Actual Behavior

Write tool: Removed lines block is empty (red background, no text or sometimes a little centerd text)
Edit tool: Removed lines display correctly

Steps to Reproduce

  1. Create a file using Write tool:

AAA
BBB
CCC
DDD

  1. Overwrite the same file with Write tool:

XXX
YYY
ZZZ
WWW

  1. Observe: removed lines block is empty/corrupted (red area with no text)
  2. Perform the same operation with Edit tool - renders correctly

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.61, not sure

Claude Code Version

2.1.0 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

<img width="1333" height="490" alt="Image" src="https://github.com/user-attachments/assets/3df464b1-f2f7-433f-a95b-05c697b84af6" />
<img width="357" height="152" alt="Image" src="https://github.com/user-attachments/assets/3844ef9b-7b66-45cc-8252-c81382341ac6" />
<img width="298" height="152" alt="Image" src="https://github.com/user-attachments/assets/c7594229-731c-480d-81e3-b5f75bd1da49" />
<img width="1298" height="371" alt="Image" src="https://github.com/user-attachments/assets/5b9e5954-7680-4b18-a32c-74209f1e3b0a" />

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗