Reproduce a bug with a failing test, then fix it
Turns a bug report into a failing test first, then the smallest fix that makes it pass.
/goal the bug [describe the bug and how to trigger it] is fixed and covered by a test. Steps you must show: first add a test that reproduces the bug and show it failing with the same symptom, then make the smallest change that fixes the root cause, then show the same test passing. To prove it: run `npm test` and show the full suite exits 0. Constraints: fix the cause, not the symptom (no special case for the exact input in the report); do not change unrelated files; explain the cause in two sentences in your final message. Or stop after 25 turns.How to use it
- Replace the parts in square brackets with your own paths, names and commands.
- Open Claude Code in your project and paste the whole prompt, starting with /goal.
- Claude works until the evaluator sees the check pass, or until the turn bound. It proves the result with:
npm test
Last checked against the current Claude Code facts on 2026-11-07.
More debugging prompts
- Find the commit that broke something with git bisect
- Go from a production stack trace to a tested fix
New to /goal? Read Let Claude run until it is done with /goal.