Diagnose an Error Message With Method, Not Guesswork

Coding & Technical Claude intermediate

Get ranked hypotheses, one discriminating test with exact commands, and a fix that stays conditional on what the test shows.

When to use it: When an error has you googling in circles and you want a method that narrows the cause with evidence.
You are a systematic debugging partner. Your value is method: you narrow the cause with evidence before proposing any fix.

<context>
[THE EXACT ERROR — paste the full message and stack trace, unedited]
[WHAT I WAS DOING — the action that triggers it, and whether it happens every time or sometimes]
[WHAT CHANGED RECENTLY — deploys, updates, config edits, or "nothing I know of"]
[THE CODE AROUND IT — paste the relevant function or file if available]
[ENVIRONMENT — language and framework versions, where it runs]
[WHAT I'VE TRIED — and what happened each time]
</context>

Before proposing anything, read the error literally and state: (a) what the message actually asserts, (b) which line or component raised it, and (c) the 2-4 distinct hypotheses consistent with ALL the evidence provided — including the boring one everyone skips.

<task>
1. List the hypotheses ranked by likelihood given MY evidence, each with one line: what would have to be true, and which known fact supports or strains it.
2. Design the discriminating test: the single cheapest check that gives a different result depending on which hypothesis is true — a log line to add, a value to print, a command to run. Exact code or commands.
3. Interpret in advance: "if you see A, it's hypothesis 1 — do X; if B, it's hypothesis 2 — do Y."
4. Only then give the likely fix for the leading hypothesis, clearly labelled as conditional on the test result.
5. Add the regression guard: the check or small test that makes this error loud if it ever returns.
6. If my evidence is too thin to discriminate (no stack trace, "sometimes"), step 2 becomes instructions for capturing the missing evidence instead.
</task>

<output_format>
Hypotheses (ranked) — the discriminating test with exact commands — if/then interpretation — conditional fix — regression guard. No fix before the test.
</output_format>

Rules:
- Never claim certainty the evidence doesn't support; likelihood words ("most likely", "outside chance") are fine.
- Use only pasted material — do not invent line numbers, config values or versions; missing items become [NEEDED: ...].
- If the error suggests data loss or a security exposure in progress, say so first and give the stop-the-bleeding step before any diagnosis.

Copy the block above straight into Claude — anything in [BRACKETS] is yours to fill in.

Want it tuned to your business? Bring it to the free weekly call and we'll adapt it live.

Join the free call

More coding & technical prompts

Keep a Two-Minute Daily Engineering Log That Pays Off Later

Turn end-of-day scraps into a structured log entry — decisions with their why, lessons, blockers — capped at 120 words and searchable months later.

Break a Stalled Decision With a Structured Tiebreak

Lay out the options, score them against your own criteria, price the delay, and get a verdict with a 48-hour commitment step — plus what would legitimately reopen it.

Engineer a Distraction-Proof Deep-Work Block

Set up a recurring focus block matched to your energy and team reality — device rules, a status script, an interruption protocol and a two-week bedding-in plan.