# Debug

> Debug errors with systematic 6-step protocol. Paste error message or describe the bug.

- Skill: `rhythmmittal19/debug` (Agent Skill)
- Install (CLI): `npx skillmds@latest add rhythmmittal19/debug`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rhythmmittal19/debug/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: RhythmMittal19 (https://skillmd.com/u/rhythmmittal19)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/rhythmmittal19/debug

---


## Error/Bug Report
$ARGUMENTS

## Current State
!`git branch --show-current 2>/dev/null`
!`git diff --stat 2>/dev/null | head -10`

## Debugging Protocol — Follow these steps IN ORDER:

### Step 1: Reproduce
- Identify the exact trigger for the error
- Note the full stack trace and error message

### Step 2: Isolate
- Use subagents to search for relevant code: the error source, related modules, tests
- Identify the smallest possible scope where the bug lives

### Step 3: Hypothesize
- Form 2-3 hypotheses about root cause
- List evidence for/against each

### Step 4: Verify
- Test the most likely hypothesis FIRST
- Use targeted reads, not full-file scans
- Check git blame if the code worked before: when did it break?

### Step 5: Fix
- Make the minimal change that fixes the root cause (not symptoms)
- NEVER change code you don't understand hoping it fixes things

### Step 6: Confirm
- Run tests to verify the fix
- Check for regressions in related functionality
- Explain what caused the bug and why the fix works

IMPORTANT: If you've tried the same approach twice and it didn't work, STOP and try a fundamentally different strategy.

