Skip to content
Back to prompts
Engineering

Debug an issue systematically

Turn a vague bug report into testable explanations and a small, verifiable fix.

  • Debugging
  • Root cause
  • Testing

Before you use it

Replace the text in [brackets] with your own context. Review the response before using it.

Help me investigate a bug in [application or system]. I want to identify the root cause and make the smallest fix that preserves the intended behavior.

Expected behavior:
[What should happen]

Observed behavior:
[What actually happens, including the exact error]

Available evidence:
[Relevant code, logs, reproduction steps, environment, and recent changes]

Start by separating observations from assumptions. Trace the path from the triggering input to the failing operation. Suggest a short, ranked list of explanations, and identify one useful check that could confirm or rule out each explanation. Ask for missing information only when it changes the next step.

Use the evidence to narrow the search before changing code. Avoid broad rewrites, disabling validation, or hiding an error without explaining its cause. Preserve existing error handling and user data.

Return the most likely cause, the evidence supporting it, the proposed change, and a reproduction or regression check. Mark anything still uncertain. Do not claim a command or test passed unless you actually ran it.