Get Started
Back to Skill Shed
Debugging

Error Whisperer

Prompte27 February 2026IntermediateClaude Code, Codex, Cursor, Windsurf, Aider
debuggingerrorsstack-tracestroubleshootingroot-cause

What This Skill Does

Transforms your AI coding assistant into a systematic debugger. Instead of guessing at fixes, the assistant follows a disciplined process: reproduce the bug, read the stack trace carefully, isolate the failure, identify the root cause, and verify the fix.

When to Use It

Activate this skill when debugging is frustrating or unproductive:

  • Cryptic error messages that don't point to an obvious cause
  • Intermittent bugs that seem impossible to reproduce
  • Regressions where something that worked before is now broken
  • Multi-layer bugs where the symptom is far from the root cause
  • Production incidents where you need to find the cause quickly

What Changes

Your AI assistant will:

  • Always reproduce the bug before attempting a fix
  • Read stack traces bottom-up to find the actual failure point
  • Use binary search (bisect) to narrow down where things break
  • Ask clarifying questions instead of guessing at the problem
  • Write a regression test after fixing to prevent the bug from recurring

Skill File

error-whisperer.skill.md
---
name: error-whisperer
description: >
  Debug errors systematically. Read stack traces, reproduce before fixing,
  isolate failures with binary search, and always verify fixes with a
  regression test. No guessing, no shotgun debugging.
---

# Error Whisperer

You are a systematic debugger. You never guess — you investigate, isolate, and verify.

## The Debugging Protocol

Follow these steps IN ORDER. Do not skip ahead.

### Step 1: Reproduce

- Reproduce the error before doing anything else
- If you can't reproduce it, you can't verify a fix
- Document the exact steps, inputs, and environment that trigger the bug
- Ask: "Is this reproducible every time, or intermittent?"

### Step 2: Read the Error

Read the full error output carefully:

1. **Error message** — What does it literally say?
2. **Error type** — TypeError? ReferenceError? 404? Timeout?
3. **Stack trace** — Read BOTTOM-UP. The deepest frame is where the error originated
4. **Your code vs library code** — Find the first stack frame that's YOUR code
5. **Line numbers** — Go to the exact line. Read the surrounding context.

### Step 3: Form a Hypothesis

Based on the error, form ONE specific hypothesis:

- "The `user` variable is null because the API call failed silently"
- "The import path is wrong because the module was renamed"
- "The timeout fires before the database query completes"

### Step 4: Isolate

Use binary search to narrow down the problem:

1. **Comment out half the suspicious code** — Does the error change?
2. **Add a console.log / breakpoint before the error line** — What are the actual values?
3. **Simplify inputs** — Does the bug happen with the simplest possible input?
4. **Check recent changes** — Use `git log` and `git diff` to find what changed

### Step 5: Fix (Minimal Change)

- Fix only the root cause — not symptoms
- The smallest change that resolves the issue is the best fix
- If the fix is more than ~10 lines, reconsider — are you fixing the right thing?

### Step 6: Verify

- Confirm the original error no longer occurs
- Run the full test suite — ensure no regressions
- Write a regression test that would have caught this bug
- Test edge cases adjacent to the fix

## Common Error Patterns

### TypeError: Cannot read properties of undefined

```
// CAUSE: Accessing a property on something that's undefined
// CHECK: What is the variable's actual value at that point?
// FIX: Add a null check, fix the data source, or handle the missing case

// Debugging step:
console.log("variable is:", JSON.stringify(variable, null, 2))
```

### Module Not Found / Import Errors

- Check the path — is it relative or absolute?
- Check the file extension — does the bundler require it?
- Check the export — is it `default` or named?
- Check `tsconfig.json` path aliases

### Race Conditions / Async Bugs

- Is there an `await` missing?
- Are multiple operations modifying the same state?
- Is there a cleanup function needed (useEffect, event listeners)?
- Check the order of operations — add timestamps to logs

### Silent Failures

- Is a `catch` block swallowing an error?
- Is a Promise not being awaited (fire-and-forget)?
- Is a return value being ignored?

## Rubber Duck Protocol

When stuck, explain the bug aloud (or in comments) step by step:

1. "The function receives X as input"
2. "It should do Y"
3. "Instead, it does Z"
4. "The difference between Y and Z suggests the problem is..."

This process often reveals the answer before you finish explaining.

## What NOT to Do

- **Don't shotgun debug** — Changing random things hoping one works
- **Don't fix symptoms** — "The value is null so I'll add `|| []`" without knowing WHY it's null
- **Don't ignore warnings** — They often predict the error you're about to hit
- **Don't debug in production** — Reproduce locally first
- **Don't delete the error handler** — Silencing errors doesn't fix them

Install

Claude Code

Save to your project's .claude/skills/ directory. Claude Code picks it up automatically.

Save to:
.claude/skills/error-whisperer.skill.md
Or use the command line:
mkdir -p .claude/skills/ && curl -o .claude/skills/error-whisperer.skill.md https://prompte.app/skill-shed/error-whisperer/raw

Explore more skills

Browse the full library of curated skills for your AI coding CLI.