When Claude Code's Sequential Edits Cascade into Failure — Fixing 'old_string not found' and 'not unique' on the Same File
Run several Edits against the same file and the second or third one fails with 'not found', 'Found 2 matches' or 'modified since read'. A triage table for five error messages, a match-counting script, when to use replace_all or sed, and moving formatter hooks to Stop.
Two Reasons Claude Code's Edit Tool Refuses — Multiple Matches vs. No Match
Claude Code's Edit tool fails in two distinct ways: the string matches in several places, or it matches nowhere. Here is how to tell them apart, how to build a good old_string, and how to check for formatters, line endings and invisible characters.
How I Stopped Claude Code's 'File has been modified since read' Error From Recurring
If Claude Code keeps tripping over 'File has been modified since read it' partway through a long session, the cause usually narrows down to three settings. Here is what actually worked in my own setup.