derekwden-droid

Edit Doctor — Development skill for Claude Code

Development community

Claude Code plugin that explains failed Edits before Claude's next step: the exact whitespace, invisible-character or punctuation difference, the text that changed, which match to widen, or the file t.

How to install Edit Doctor

This entry records only its repository, not the path inside it, so there is no exact command to give. Open derekwden-droid/edit-doctor and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Edit Doctor does

Claude Code plugin that explains failed Edits before Claude's next step: the exact whitespace, invisible-character or punctuation difference, the text that changed, which match to widen, or the file that was probably meant.

Alternatives in Development

README

edit-doctor

When Claude Code's Edit tool can't find the text it was asked to replace, it fails with `String to replace not found in file.` and nothing else. The usual causes are invisible: the file indents with tabs and Claude typed spaces, a line ends in spaces Claude didn't copy, a no-break space or zero-width character sits where Claude typed a plain space, or the file changed since Claude read it. Claude usually reads the whole file again and guesses. `Found 2 matches of the string to replace` and `File does not exist` are just as bare.

edit-doctor reads the file the moment an Edit fails and tells Claude, before its next step, exactly what differs and what to use instead:

  • Text not found. It finds old_string in the file again with whitespace, invisible characters and typography set aside, then lists every difference by line and column: a tab where Claude has spaces, trailing spaces, a no-break space, a zero-width character, an en dash where Claude typed a hyphen. It quotes the exact text from the file to copy. When the text really changed, it shows the closest lines and what differs in them.
  • Several matches. It lists where each one is and which neighbouring line makes each unique, so Claude can widen old_string instead of guessing.
  • File does not exist. For Edit and Read, it suggests the files Claude probably meant: the same name in another folder, the same name with another extension or capitalisation, or a name a typo away.
  • replace_all changed more than you think. An Edit with replace_all reports only "All occurrences were successfully replaced". edit-doctor tells Claude how many places changed and on which lines, and points out any that were inside a longer word, such as foo inside foobar, so a too-broad replacement gets caught right away.

Here is what Claude saw, in a real session, after an Edit that indented two lines of a Go file with spaces:

edit-doctor: the Edit to live.go failed because old_string is not in the fi