Draft Reproducible Bug Reports from Error Stack Traces

Turn messy error logs and stack traces into structured, actionable bug reports with minimal reproduction scripts.

Agent prompt for ChatGPT and Claude

Prompt

Prompt
Act as a Senior Software Engineer. Your job is to analyze raw error logs and stack traces to create a professional, reproducible bug report. Before starting, ask me these 3 questions: 1. Paste the full stack trace or error log. 2. What framework or language version are you using? 3. What were the specific user actions or inputs leading to this error? Wait for my answers. Once I provide them, generate the response using these rules: First, identify the exact failing function call chain. Second, write a minimal, self-contained reproduction script in the original language. Third, create an Expected vs Actual Behavior table. Fourth, list 3 potential root causes based on the trace. Output format: # Bug Report: [Short Title] ## Failing Call Chain: [List the chain] ## Minimal Reproduction Script: [Code block] ## Behavior Comparison: [Table with columns: Scenario, Expected, Actual] ## Root Cause Analysis: [Numbered list] This is not professional software engineering advice; consult your team lead for critical production system changes.

Example output

Failing call chain behind the RecursionErrorRecursion in DataParser.parse_nested_json
  1. DataParser.process_batch(items)Step 1Entry point processing the batch
  2. DataParser.parse_nested_json(item)Step 2First call on a single item
  3. parse_nested_json(nested_item)Step 3Recurses until max depth is exceeded

Example for: a Python developer facing a recursive depth error in a data processing pipeline.

Bug Report: RecursionError in DataParser.parse_nested_json

Failing Call Chain:

  1. DataParser.process_batch(items)
  2. DataParser.parse_nested_json(item)
  3. DataParser.parse_nested_json(nested_item)

Minimal Reproduction Script:

def parse_nested_json(data):
    return parse_nested_json(data['child'])

# Triggering the failure with deep nesting
deep_data = {'child': {'child': {'child': {}}}}
# Simulating depth limit reached
parse_nested_json(deep_data)

Behavior Comparison:

ScenarioExpectedActual
Deeply nested JSONParse tree to completionRecursionError: maximum recursion depth exceeded

Root Cause Analysis:

  1. The parser lacks an iterative approach or explicit depth counter for deeply nested objects.
  2. The input validation layer is missing a check for max depth before passing to the parser.
  3. The default system recursion limit is set too low for the expected data complexity of this specific integration.

This is not professional software engineering advice; consult your team lead for critical production system changes.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Forces a structured breakdown of the failing call chain for clarity.
  • Ensures you have a minimal reproduction script to verify the fix.
  • Uses a clear table to contrast expected behavior against the actual error.

Use this with ChatGPT, Claude, or GitHub Copilot Chat when you are stuck debugging a cryptic error. Paste your logs directly into the chat after answering the initial questions to get a clear path to reproduction.

Common edits

  • Add specific environment variables or hardware constraints if they are relevant to your bug.
  • Include additional sections for security implications if the error exposes sensitive data.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

Agent Orchestration

Create Error Handling Contracts for AI Agents

This prompt transforms raw stack traces into structured error envelopes that provide agents with specific remediation steps and valid parameter constraints for self-correction.

AI Coding AgentsClaude Code

Generate Reproducible Bug Fix Specs for Coding Agents

Get a standalone reproduction test script and a precise technical plan to fix a bug, ensuring your AI agent stays focused and avoids unnecessary file changes.

Turn Sentry Errors into Reproducible Codex Test Cases

Transforms a production Sentry stack trace and context payload into a self-contained failing unit test designed for Codex repo tasks.

Coding

Paste a Bug Report, Get a Test-First Fix in Any AI Chat

Get a failing test that reproduces your pasted bug, the root cause, the smallest fix as a diff and its risks, in any chat assistant with no repository access needed.

Coding

Root Cause Analysis from Stack Trace and Logs

Turns an error report, stack trace, and logs into ranked root-cause hypotheses. Includes the cheapest checks to confirm each one, a fix proposal, and a regression test plan.