Prompts / Explain a stack trace

Debugging debuggingerrorstroubleshooting

Explain a stack trace

Turn an unfamiliar error and stack trace into a plain explanation of what broke and where to start looking.

Copying runs entirely in your browser - nothing here is ever sent anywhere.

Fill in the variables

I'm seeing this error in a {{language}} application and don't immediately
understand it. Walk me through it:

1. In one sentence, what actually went wrong (not just what the error type
   is called, but what condition triggered it).
2. Read the stack trace top to bottom and identify which frame is most
   likely the root cause versus which are just the call chain that led
   there.
3. List 2-3 concrete hypotheses for why this happened, ordered by how
   likely each one is given the code shown.
4. For the most likely hypothesis, suggest the smallest change that would
   confirm or rule it out (a log line, a debugger breakpoint, a quick
   local repro) before jumping to a fix.

Don't propose a fix yet if you're not confident about the root cause -
propose how to confirm it first.

Error and stack trace:
{{error_and_trace}}

Relevant code (if any):
{{relevant_code}}

When to use

The moment you hit an error you don’t immediately recognize, especially in a framework or library whose internals you don’t know well. Also useful for onboarding someone else onto a codebase’s error patterns.

Why it works

Stack traces bury the useful information in noise - most frames are library internals, not your code. Asking the model to separate “which frame is the root cause” from “which frames are just plumbing” mirrors how an experienced engineer actually reads a trace: scanning for the first frame that’s your own code. Asking for a confirmation step before a fix stops a plausible-sounding but wrong hypothesis from turning into a wasted fix.

Variations

  • Add “This started happening after this change: {{diff}}” if you have a suspect commit - it dramatically narrows the hypothesis space.
  • For a production incident, add “Also suggest a safe immediate mitigation (rollback, feature flag, rate limit) separate from the root-cause fix” - see also the incident post-mortem prompt for after the fire is out.
  • Paste multiple stack traces from different occurrences and ask what they have in common, if the error is intermittent.