Debug a Production Error
Quickly analyze a production error with a structured Root Cause Analysis approach and an immediate action plan.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
You are an on-call engineer specializing in debugging production incidents. I have a critical error affecting [number of users] users for [duration]. Here is the available information:
Stack trace:
[paste the stack trace]
Application logs (last 50 lines):
[paste the logs]
Context:
- Tech stack: [e.g. Node.js 18, PostgreSQL 14, Redis 7]
- Last deployment: [date and time]
- Recent changes: [description of changes]
- Environment: [prod/staging]
Analyze this situation using a structured approach:
- Identify the likely root cause (Root Cause Analysis)
- List 3 hypotheses in order of probability with their justification
- Propose immediate diagnostic steps to confirm the cause
- Provide an immediate fix plan (hotfix) and a long-term solution
- Suggest alerts or metrics to add to prevent this type of incident
Prioritize speed of resolution since the incident is active.
Personalize this prompt with Léa · AI assistant
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Why this prompt works
This prompt replicates the mental process of an experienced SRE engineer facing a production incident. By providing structured context (stack trace, logs, recent changes), the AI can formulate relevant hypotheses rather than generic answers. Requesting 3 hypotheses ranked by probability forces the AI to reason rather than propose the first solution that comes to mind. This considerably increases diagnostic accuracy, especially for complex bugs related to inter-service interactions. Adding the question about alerts to set up transforms a simple debugging session into a systemic improvement opportunity, which is the hallmark of a senior engineer thinking in terms of long-term reliability.
Use Cases
Expected Output
A root cause analysis with prioritized hypotheses, diagnostic steps, immediate hotfix, and preventive recommendations.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
Be the first to comment on this prompt.
Glossary Terms
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Improve this prompt with the Optimizer
Analyze the prompt, strengthen the context and get a more precise version.
Claude Prompts
Structure, context and examples to get better answers from Claude.
AI prompts for web developers
Code review and debugging, keeping API keys and secrets out of the prompt.
Security, GDPR & Business Plans
ChatGPT Business, Claude Team, Gemini Workspace and Mistral Vibe compared from vendor sources: training, EU hosting and a GDPR checklist.
Similar Prompts
Task brief for Claude Code: frame a feature end to end
Brief template to delegate a complete feature to Claude Code: goal, starting point, constraints, definition of done, working rules and recap format.
Write a project's CLAUDE.md: the brief Claude Code reads at every session
Turns your project description into a dense CLAUDE.md: commands, structure, conventions, pitfalls, off-limits areas and situations where the agent must ask before acting.
Design a Secure Webhook API
Design a webhook API with event subscriptions, signed deliveries, retry limits, and a delivery log your support team can inspect.
Generate Storybook Stories for UI Components
Generate Storybook stories for a UI component, with visual variants, interactive controls, interaction tests, and MDX documentation.