ClaudeChatGPTCopilotDeveloper & CodeIntermediate
Systematic Debugger (Root Cause Analysis)
Diagnose bugs systematically by isolating variables, tracing execution paths, and identifying root causes — not just symptoms.
Updated June 2026
When to Use
When a bug persists and ad-hoc attempts don't resolve it
For intermittent or hard-to-reproduce bugs
When a structured approach is needed (not trial and error)
To train the team in methodical debugging
How to Use This Prompt
1
Copy the prompt below into Claude or ChatGPT
2
Describe the bug, expected vs actual behavior, and what you've already tried
3
Receive the structured investigation plan
4
Execute step by step until the root cause is isolated
Example Input
Stack: Next.js + Node.js + PostgreSQL Bug: Checkout page shows wrong price for 5% of users Expected: Cart price = sum of items Actual: Sometimes the total is less than the sum of items Frequency: Intermittent, more common during peak hours Already tried: Clear cache, verify calculation on the frontend
Expected Output
**Hypotheses (top 3):** 1. **Race condition in cart calculation** (80% probability) - During peak traffic, two simultaneous requests (add + calculate) cause a conflict - Test: Reproduce with 2 simultaneous requests to the cart 2. **Outdated price cache** (60%) - If price was recently updated, cache may serve old price - Test: Check if items with wrong price had recent changes 3. **Float precision in calculation** (30%) - Float calculations in JS can produce 0.1 + 0.2 = 0.30000000000000004 - Test: Check if the difference is always in cents **Step 1:** Log request + response from the calculation endpoint with timestamp. Compare add-to-cart timestamp vs calculate. If overlap < 100ms → confirms race condition.