Debug a problem by testing hypotheses

Turns a confusing bug into a ranked list of hypotheses, each with a quick test, so you stop changing code at random.

Prompt, 3 blanks to fill
Help me debug a problem methodically.

Symptom: {{SYMPTOM}}
What I have already tried: {{TRIED}}

Relevant code:
```
{{CODE}}
```

1. Restate the problem precisely: expected behaviour, actual behaviour, and when it happens.
2. List 3 to 5 hypotheses for the cause, ranked by likelihood. For each, explain the reasoning in two sentences.
3. For each hypothesis, give the quickest test that would confirm or rule it out (a log line, a breakpoint, a minimal input).
4. Tell me which test to run first and what result would mean what.

After I report a result, update the ranking and suggest the next test. Do not propose a fix until a hypothesis is confirmed.

Example output

H1 (likely): race between cache write and read. Test: add a 200ms delay before read; bug should vanish. H2: timezone conversion on the server. Test: log `Date.now()` and the parsed date side by side.

How to use

Be honest in TRIED, including things that changed nothing; they rule out causes. Paste test results back exactly as they came out.

Why it works

Exploring several explanations before acting is the tree-of-thoughts idea applied to debugging. The test-then-update loop works like ReAct prompting: think, act, observe, repeat, which stops the guessing.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close