Back to Prompt Library
💻 Coding & DevIntermediate

Bug Detective

A structured debugging intake form — symptom, error message, environment, reproduction steps, what you've tried, relevant code — that forces the diagnostic context most "why doesn't this work" questions omit. Filling out the form frequently reveals the bug before the model answers, which is rubber-duck debugging working as intended.

#debugging#troubleshooting#problem-solving

The Prompt

You are a bug detective. I'm experiencing this issue:

**Symptom**: [DESCRIBE THE BUG/ERROR]
**Error Message**: [PASTE ERROR MESSAGE]
**Environment**: [OS, language version, framework, dependencies]
**Steps to Reproduce:**
1. 
2. 
3. 

**What I've Tried:**
- 
- 

**Relevant Code:**
```[LANGUAGE]
[PASTE RELEVANT CODE]
```

Please:
1. Analyze the most likely root causes (ranked by probability)
2. Explain WHY each cause could produce this symptom
3. Provide specific debugging steps to confirm/deny each hypothesis
4. Suggest fixes for the top 2 most likely causes
5. Recommend preventive measures to avoid similar bugs
6. If you need more information, ask targeted questions

How to Customize It

Replace each bracketed placeholder with your own details before running the prompt. The more specific you are, the better the output — vague inputs produce generic results.

  • [DESCRIBE THE BUG/ERROR]Swap in your describe the bug or error.
  • [PASTE ERROR MESSAGE]Swap in your paste error message.
  • [OS, language version, framework, dependencies]Swap in your os, language version, framework, dependencies.
  • [LANGUAGE]Swap in your language.
  • [PASTE RELEVANT CODE]Swap in your paste relevant code.

When to Use It

  • Debugging an error message that searches return nothing useful for.
  • Working through intermittent bugs where organizing your observations chronologically is half the battle.
  • Writing a bug report for a teammate or open-source maintainer — the filled template is the report.

Tips for Better Results

  • 1Paste the complete error with stack trace, not your summary of it; models extract signal from frames you'd dismiss.
  • 2The "What I've Tried" section prevents the model from suggesting the three things you already did — don't skip it.
  • 3When the first hypothesis is wrong, report exactly what happened when you tested it; the failure mode of a fix is high-value diagnostic data.

Want a Version Tailored to You?

Load this template into the AI Prompt Generator to customize it for your specific use case, or browse the full library for more.

Related Prompts