[BUG] IntelliJ Integration: Claude regresses to use BASH or Python to make code changes (when source file contains backslashes)
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?
[BUG] Claude regresses to use BASH or Python to make code changes when source file contains multiple backslashes
Usually, Claude will use the integrated update command to make changes, such that the diff shows up in an IntelliJ diff window, which is really quite nice.
However, I have been working on a Groovy code file that Claude is consistently unable to edit this way. Claude must regress to using Bash or Python to update the file (which I find really annoying, especially since I like seeing the diffs).
From Claude:
"The Edit tool is the correct tool for file edits — having to fall back to Python scripts is a workaround, not the intended behavior.
The specific failure pattern we saw was:
- File: Windows CRLF line endings (the .groovy file had \r\n)
- Content being matched: Strings containing Windows paths with backslashes (C:\\temp\\...)
- Result: Edit tool reported "String to replace not found" even though the content visually matched
The Edit tool succeeded on every other edit in the same file — tab indentation, complex multi-line blocks, etc. The common factor in the failures was the backslash-heavy path strings inside a CRLF file.
That's a concrete, reproducible bug report:
Edit tool fails to match strings containing backslash sequences (\\) in files with CRLF line endings. The tool reports "String to replace not found" even when the content is visually identical to what's in the file. Workaround: use a Python script to do the replacement. Platform: Windows
11, Git Bash.
I'd recommend filing that at https://github.com/anthropics/claude-code/issues with a small repro case — a file with \r\n endings containing a string like 'C:\\temp\\test.json' and an Edit tool call targeting it. That would give the team a clean test case to reproduce and fix. "
=========================================
Note: I doubt the ending CRLF's are the issue, since Claude works find on other Groovy files with CRLF line endings. I suspect it is the double backslashes that are causing the issue.
Example test file: c:\temp\test.json
{
"name": "test",
"description": "Test file for Claude Code Edit tool bug reproduction",
"path": "C:\\temp\\test.json",
"nested": {
"windowsPath": "C:\\temp\\proposal_generation_design_3\\json_sample_data\\1_OutlineItems.json"
}
}
What Should Happen?
Claude should be able to use the integrated editor for all code changes.
Error Messages/Logs
● Update(plugins\services\grails-app\services\com\deltek\istech\services\proposalManager\PmAIGenerationService.groovy)
⎿ Error editing file
⎿ Found 9 new diagnostic issues in 1 file (ctrl+o to expand)
Steps to Reproduce
1) Create a test file with this content:
{
"name": "test",
"description": "Test file for Claude Code Edit tool bug reproduction",
"path": "C:\\temp\\test.json",
"nested": {
"windowsPath": "C:\\temp\\proposal_generation_design_3\\json_sample_data\\1_OutlineItems.json"
}
}
3) Save as a file that uses CRLF line endings (ie, a windows file).
2) Run Claude and ask it to make code changes to this file.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.52 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗