💻 Coding
#debugging#troubleshooting#errors#systematic

Debug Detective

Debug Detective turns frantic bug-hunting into a methodical investigation: paste your error, code, and what you've tried, and it forms hypotheses, ranks them by likelihood, and walks you to a verified fix — instead of random Stack Overflow roulette.

A systematic debugging partner that forms hypotheses and narrows down the culprit like a detective.

You are a debugging detective. I will describe a bug: symptoms, error messages, and what I've tried. Follow this method: 1) Restate the bug in one sentence to confirm understanding, 2) List 3-5 hypotheses ranked by likelihood, with what evidence would confirm or kill each, 3) Tell me the single fastest experiment to run first, 4) Ask me for the result before proceeding. Never shotgun random fixes. Think like a scientist: one variable at a time. Here is my bug:
More coding prompts
Try it now ChatGPT ↗ Grok ↗
Example output

See what this prompt creates

AI-generated example output for the 'Debug Detective' prompt
Example output generated by AI with this prompt. Your results will vary by tool and the details you fill in.

What this prompt does

Most debugging time isn't spent fixing — it's spent guessing. Debug Detective replaces guessing with method: it takes your error message, relevant code, and what you've already tried, then works like a detective — establishing facts, forming ranked hypotheses, and suggesting the single most informative next test. You stop changing random things and start converging.

How to get the best result

Feed it evidence, not conclusions: the full error message and stack trace, the minimal code that reproduces it, and what changed recently (“it worked before Tuesday's deploy” is gold). Answer its diagnostic questions honestly — “I assumed the config was fine” often is the bug. When it suggests a hypothesis, test before theorizing further.

Common mistakes to avoid

Don't paste your entire codebase; the detective needs the crime scene, not the city. Trim to the failing path. And resist “fix-first” mode — applying three suggested fixes at once means you'll never know which one worked, and the bug will return wearing a disguise.

Try these variations

Use it for production incidents: paste logs and it triages like an on-call senior. For the aftermath, the senior code reviewer prompt can audit the fixed code so the bug class doesn't recur. More in the coding prompts collection.

How to use this prompt

  1. Copy it — hit the copy button above to grab the raw prompt text.
  2. Fill the brackets — replace anything in [BRACKETS] with your own details.
  3. Paste into your AI tool — works with ChatGPT, Claude, Gemini for text prompts; Midjourney, DALL-E or Stable Diffusion for image prompts; Runway, Pika or Sora for video.
  4. Iterate — tweak one bracket at a time until the output is exactly right.

Frequently asked questions

How is this different from just pasting my error into ChatGPT?

A raw paste gets you a guess — often the most common cause, not your cause. Debug Detective forces a systematic process: hypotheses ranked by evidence, one test at a time, verified fix at the end. It's the difference between a diagnosis and a differential diagnosis.

What information should I include?

The full error message and stack trace, minimal reproducing code, your language/framework versions, what you've already tried, and what changed recently. Five minutes of good evidence saves an hour of bad guessing.

Can it debug production issues from logs?

Yes — paste relevant log excerpts (redact secrets and PII first) plus the symptoms. It's good at correlating timestamps across services and spotting the “one weird line” humans skim past. It won't replace observability tooling, but it reads logs tirelessly.

What if the bug isn't in my code?

Then the detective earns its name: it's explicitly instructed to consider environment, dependencies, config, and version mismatches — not just your code. Some of the nastiest bugs live in a changed default three layers down.

Related prompts

Keep exploring the vault.

API Documentation Writer

Turns your endpoints into Stripe-quality docs — examples, error tables, and auth flows included.

#api#documentation#rest#developer-experience
View →

Explore more categories

More prompt collections worth your time.