String to replace not found in file. & Error calling tool
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Workaround ✓ Mentioned in thread ↓
Activity 12 comments · opened Feb 27, 2025 · closed May 7, 2025
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
About 80% of all actions it tried to take failed
Left it for 15 minutes and and it went down a rabbit hole of failure
20ffad30-bad6-4040-8e4f-fa2ced703cae
12 Comments
Same here.
It was working like a charm on the same code repository yesterday and today I fall in a lot of:
!Image
same thing happening here.
SO: Windows WSL with Ubuntu
I'm CDing to a folder inside windows mounted and running it there
same thing here. it worked perfectly well the first day i tried it. ever since, its failed every time. could it have something to do with windows style newlines? unfortunately its unuseable for me in this current state (and VERY expensive)
Yes, this is happening way to often now. Maybe something in the update tool changed recently.
+1
Having a lot of fun with Claude Code, however the amount of 'String to replace not found in file' errors are a bummer. Would be great if it could get tackled, or a workaround would be good as well since this is still a research project.
Same here. On Mac, it can't seem to update files and ends up running in circles trying to create bash scripts to do the same thing, wasting time and credits.
I just added the mcp
mcp-text-editorfrom here, and claude code is working better. When it get's frustrated with it's default writer, it jumps over to this one for a while. I just wish I could toggle the built in mcp tools.With uvx installed, you can add with:
claude mcp add mcp-text-editor uvx mcp-text-editorInteresting find @adv-algos. I saw this in the update notes:
!Image
Maybe you could write a simple prompt:
``
For the rest of this session, always use mcp-text-editor when working with local files. Other methods are prone to errors, since the source is located on a Windows system with CRLF line endings instead of Linux' LF line endings.``Save it as
/home/claudecode/.claude/commands/enableeditor.mdor something, and execute it whenever you start a session? Just an idea.This should be feeling better with newer versions of Claude Code.
claude updateor restart to update, and please open a new issue if you're still hitting this.I only started getting these errors today. Same repository has been working fine for the past few weeks, but suddenly today it has fits where it can't seem to get a read on files. If I end the entire session and restart it'll usually do its "startup" reading correctly with no issues when I first hand it a task. However, after about 3-5 minutes it'll try to make some suggested updates and struggle to read files that it's already successfully read before. Very strange.
We've made further improvements here. Please let us know if feeling better with today's release
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.