[BUG] Multiline edits fails due to old_string not able to use CRLF line endings

Resolved 💬 6 comments Opened Feb 22, 2026 by punkle64 Closed Apr 15, 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?

Windows is the dominant OS for desktop development, core.autocrlf=true is git's default on Windows, and CRLF is what you get out of the box. The Edit tool should normalize line endings before matching — treating \r\n and \n as equivalent — but it doesn't. That's a genuine gap that makes Claude Code less useful on Windows codebases without extra configuration steps.

What Should Happen?

Claude should be able to seamlessly edit codebases with CRLF line endings (windows standard).

Error Messages/Logs

Edit failed.

Steps to Reproduce

  1. Ask Claude to do a multiline edit (serach/replace) on a source file written on VS Code on Windows (CRLF endings)
  2. It will fail saying "edit failed" -> the only workaround is a separate ps script to search replace the lines.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

claude-sonnet-4-6

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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