bandicot

Edits land on the first try more often, and a stale write is refused

Edit forgives whitespace, indentation and curly quotes, points at the closest lines, and never overwrites a change it has not seen.

Engine

Edit finds what you meant

When the text to replace is not found exactly, edit tries stricter-to-looser readings in order: line endings and trailing spaces, then a block copied at another indentation, then curly quotes and dashes. The new text follows the file's indentation and line endings, and the result says which reading matched.

When nothing matches, the answer shows the closest lines in the file and the first line that differs, so the next try copies them exactly. When the text appears several times, it names each line and how much context makes it unique. A retried edit whose change is already in place reports success instead of failing.

Writes and commands say what happened

Write now refuses to overwrite a file that changed since the agent last read or wrote it, so a change you made meanwhile is never silently lost. Every edit reads the file back and says when the bytes differ.

Commands report what their exit status means: grep finding nothing or diff finding differences is no longer read as a failure, and a missing command or a killed one says so.