Library / Debug

Reproduce then fix

Turn a bug into a permanent regression test.

Debug testing regression workflow Claude Code
The prompt
Write a minimal failing test that reproduces this bug and confirm it fails. Then fix the underlying cause and show the same test passing.

Why it works

A reproducing test proves you understand the bug and guarantees it can’t silently return. Confirming red-then-green makes the fix verifiable rather than “looks right.”

Fill in

  • Describe the buggy behavior and how to trigger it.

Follow-ups

  • “Add a second test for the boundary case near where it broke.”