P
💻DeveloppementAdvancedClaude

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

Adapt this prompt

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:

  1. Identify the likely root cause (Root Cause Analysis)
  2. List 3 hypotheses in order of probability with their justification
  3. Propose immediate diagnostic steps to confirm the cause
  4. Provide an immediate fix plan (hotfix) and a long-term solution
  5. 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

Production incident resolutionIncident post-mortemsTechnical crisis management training

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 Optimizer

Comments

Be the first to comment on this prompt.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

💻DeveloppementIntermediateClaude

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.

1681
💻DeveloppementIntermediateClaude

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.

640
💻DeveloppementAdvancedAll AIs

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.

411
💻DeveloppementIntermediateAll AIs

Generate Storybook Stories for UI Components

Generate Storybook stories for a UI component, with visual variants, interactive controls, interaction tests, and MDX documentation.

474