[BUG] Edit normalizes line-endings rather than preserving the unmodified part of the file

Resolved 💬 2 comments Opened Apr 2, 2026 by oconnor0 Closed May 11, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I have a file with mixed line endings. When Claude Edits the file, the line endings are normalized - even tho the applied edit is constrained.

What Should Happen?

The diff should be respected and the rest of the file left as is so that any line endings are preserved.

Error Messages/Logs

Steps to Reproduce

  1. Create a file with mixed line endings.
  2. Ask Claude to edit the file.
  3. Observe that the proposed diff is small, but that the file no longer has mixed line endings.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.90

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

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