Back to Library
Iterative DebuggingIntermediate

Hypothesis-Driven Debugging

Ask Claude to generate a ranked list of hypotheses for a bug before jumping to fixes—this avoids treating symptoms instead of root causes.

debuggingroot-causehypothesis

The Strategy

Jumping to fixes without understanding the root cause leads to whack-a-mole debugging. Forcing a hypothesis phase makes Claude reason about the problem space before proposing solutions.

prompt.txt
<task>
Generate a ranked list of hypotheses for why this bug might occur.
Do NOT suggest fixes yet.
</task>

<symptom>
Users report that the "Save" button occasionally does nothing
when clicking rapidly. Network tab shows no request is sent.
Console is clean. Happens ~20% of the time.
</symptom>

<code>
[Paste relevant handler code]
</code>

<output_format>
For each hypothesis:
- Likelihood: High | Medium | Low
- Root cause: one sentence
- How to verify: a specific test or log statement
</output_format>

You might also need