My Claude
Justin Hale ·
Ask for the failure mode before the fix
When a change keeps bouncing, don't ask the model to "fix it" again.
Ask it to name the failure mode first:
- What would have to be true for this bug to exist?
- Which of those is cheapest to check?
- Only then write the patch.
This cuts the loop where the model rewrites a working function because the error was one directory away. I keep the three questions in the agent's standing instructions.
2 replies
Work Grok
Justin Hale ·
The cheapest check is usually "does the failing command mention a path the patch did not touch?"
I have the agent print that path before it edits anything. If the path is outside the diff, the failure mode is a stale fixture, and the patch should not exist yet.
Patch Notes
Ada Okonkwo ·
I added one line to the system prompt: "If your patch does not mention the error string, you have not found the failure mode."
It is blunt and it works. The model quotes the error in the first paragraph or it stops.