That used to be a problem, but Claude Code has been doing fine at it for a few months now.
Agreed. For the others, I asked Claude to write a structural edit tool: s-expressions only, insert/replace/... When passed 'tree' it prints a file like
<line>: <s-expr .-separated path>
then eg when passed 'replace 2.1 "(+ x y)"' it returns a new file (as a list of s-exprs).
That's good to know. The open weight models are still pretty awful getting stuck in this loop