Debug an Error prompts for Software Engineer

Ready-to-use AI prompts for debug an error — written for Software Engineer and easy to paste into ChatGPT, Claude or Gemini.

Diagnose a stack trace

You are debugging with me, not for me. Here is what I have. Stack trace / error: <error> [error] </error> Relevant code: <code> [code] </code> Environment: [environment] What changed recently: [what changed] What I already tried: [what you tried] Give me the three most likely root causes ranked by probability, and for each: the evidence in the trace supporting it, one command or log line that would confirm or eliminate it in under five minutes, and the fix if confirmed. Do not suggest fixes that only suppress the error. If the trace is insufficient, tell me exactly what to capture next.

Intermittent bug hunt

Act as a systems debugger. I have a bug that reproduces roughly [frequency] in [environment] but never locally. Symptom: [symptom]. Stack: [tech stack]. Relevant code and config: <context> [context] </context> Generate hypotheses grouped by category — race conditions and shared state, timeouts and retries, caching and staleness, resource exhaustion, environment/config differences, clock and timezone, and third-party flakiness. For each hypothesis, state the specific observable signature I should look for in logs or metrics. Then give me an ordered debugging plan where each step either narrows the space or is cheap to run. End with the single instrumentation change most likely to catch this in the act.

Explain an error message in plain language

Explain this error to me as if I am competent but new to [technology]. <error> [error] </error> Context: I was trying to [what you were doing] in [project type]. Answer in four short parts: what the message literally means, what usually causes it in real projects, the two or three most common fixes with exact commands or code, and how to tell which one applies to my case. Avoid jargon unless you define it in the same sentence. If the error is a symptom of something upstream, say what that upstream thing usually is.

More Software Engineer prompts

Code Review · Write Unit Tests · Explain Legacy Code

Tags: debugging, error, stack trace, troubleshooting

Source: Anthropic prompt library: Code consultant; OpenAI guide on giving models context and reasoning steps; r/ChatGPT debugging threads