← Back to Prompt Library

💻 Coding & Development

Production Error Log Triage

Paste a stack trace or log excerpt and get a ranked list of likely causes, the fastest way to confirm each, and the immediate mitigation.

The Prompt — replace [BRACKETS] with your details

Act as an on-call engineer triaging a production issue. Be direct and prioritise stopping the bleeding.

The error:
```
[PASTE THE STACK TRACE, ERROR MESSAGE, OR LOG EXCERPT]
```

Context:
- Stack: [LANGUAGE, FRAMEWORK, RUNTIME, HOSTING]
- When it started: [TIME, AND WHAT CHANGED AROUND THEN — DEPLOY, CONFIG, TRAFFIC SPIKE, DEPENDENCY UPDATE]
- Blast radius: [HOW MANY USERS, WHICH FEATURE, IS IT ERRORING OR JUST SLOW]
- Frequency: [CONSTANT / INTERMITTENT / ONLY UNDER LOAD]
- What I have already tried: [ANYTHING]

Deliver:
1. What this error means in plain language, and the layer it originates from
2. Ranked hypotheses for the cause, most likely first, each with a confidence level and the reasoning
3. For each hypothesis, the single fastest check that would confirm or eliminate it — a command, a log query, a metric to look at
4. The immediate mitigation to reduce user impact now, separated clearly from the real fix
5. What to capture before restarting or rolling back, so the evidence is not lost
6. Once fixed: the monitoring or alert that would have caught this sooner, and the test that would prevent a recurrence
7. Anything in the trace that you cannot interpret without more context, stated as a question

Do not guess at code you have not seen. If the trace points into a library, say what the library was doing when it failed.

How to use this prompt

  • Include what changed just before the error started; deploys and dependency bumps explain most incidents.
  • Do step 5 before you restart anything — a restart that clears the evidence turns a one-hour investigation into a week.
  • Mitigate first, understand second. Section 4 exists for a reason.

Why this prompt works

Under pressure the temptation is to act on the first plausible cause. Ranked hypotheses each paired with a cheap disconfirming check turns triage into elimination, and separating mitigation from the fix keeps you from debugging while users are still failing.

Variations to try

  • Add "here are the last three deploys" and ask which is the most likely culprit and why.
  • Ask for the post-incident review template filled in once you have the facts.
  • Paste the fix and ask what else in the codebase has the same shape of bug.

Common mistakes to avoid

  • Pasting logs containing tokens, keys, customer emails, or personal data. Redact before sharing.
  • Accepting the first hypothesis without running its check, then fixing something that was never broken.
  • Restarting to clear the error and never learning what caused it, guaranteeing a repeat.

Works well with

Claude
ChatGPT
Gemini

Need a custom version of this prompt?

The free prompt generator builds a prompt tailored to your exact goal, framework, and target AI model — or paste this template into the optimizer to refine it.