The third attempt at the same file is never better than the first. The fix is a new session with a written state, not a louder prompt. Step 3 is the one people skip, and it is the one that does the work.
Workflow
Copied 17 times
1. Notice it: the same file changed three times and the error is unchanged.
2. Stop. Do not send another prompt in this session.
3. Write STATE.md by hand, ten lines: what works, what fails, the exact error, what you already ruled out.
4. Start a fresh session. First message: "Read STATE.md. Do not change code. Give me the three most likely causes."
5. Only after you agree on a cause, ask for one change.
6. git checkout . between attempts, so every try starts from a clean tree.