debug-reproduced
Debug Reproduced
User has reproduced the bug. Analyze log evidence and iterate.
User Notes
$ARGUMENTS
Workflow
Step 1: Analyze Logs
Run the analyzer:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/analyze-logs.mjs
Or read raw logs:
cat .debug/debug.log
Step 2: Evaluate Hypotheses
For each hypothesis, assign one verdict:
- CONFIRMED: Log evidence proves this is the cause
- REJECTED: Log evidence rules this out
- INCONCLUSIVE: Need more instrumentation
Always cite specific log entries as evidence:
Hypothesis A: CONFIRMED
- Log at 14:32:05.123 shows
itemsisundefinedat function entry- Log at 14:32:05.156 shows error "Cannot read property 'length' of undefined"
- Root cause:
order.itemsnot provided by callerHypothesis B: REJECTED
- Logs show
loadUsercompleted at 14:32:05.100renderProfilestarted at 14:32:05.200- Order is correct, no race condition
Step 3: Take Action
If hypothesis CONFIRMED:
- Implement the fix
- Keep instrumentation in place (do NOT remove logs yet)
- Provide new reproduction steps to verify fix
- After user reproduces, compare before/after logs — cite specific entries showing the fix worked
If INCONCLUSIVE:
- Add more instrumentation to narrow down
- Provide new reproduction steps
If ALL hypotheses REJECTED:
- Generate NEW hypotheses from different subsystems
- Add instrumentation for new hypotheses
- Provide new reproduction steps
Step 4: Next Iteration
Provide exact reproduction steps:
<reproduction_steps>
- [Step 1]
- [Step 2] ... </reproduction_steps>
End with:
Follow these steps, then run
/debug-reproducedwhen done, or/debug-fixedif the issue is resolved.
Critical Rules
- NEVER fix without 100% confidence with log proof
- NEVER remove instrumentation before verified fix
- ALWAYS cite specific log entries — "Log at 14:32:05 shows X was null"
- Iteration is expected — Failed fixes mean new hypotheses, not giving up
- 3 failed fixes = step back — Reconsider assumptions, look at different subsystems
- Taking longer is better — Thorough debugging beats quick guesses
Note on Log Accumulation
Logs accumulate across iterations (not auto-cleared). This allows comparing behavior across reproduction cycles. Run bun ${CLAUDE_PLUGIN_ROOT}/scripts/clear-logs.mjs if you need a fresh start.
More from mikecfisher/claude-debug-mode
debug-fixed
User confirms the bug is fixed. Clean up instrumentation and summarize.
2debug-mode
Hypothesis-driven debugging with runtime log instrumentation. Use when user reports a bug, unexpected behavior, flaky test, or when runtime evidence is needed to understand code behavior. Invoke for issues like "X isn't working", "I'm seeing Y error", "why does Z happen", or when multiple code paths could cause the problem.
2