Install this skill: copy and save to ~/.claude/skills/error-analyzer/SKILL.md

Error Analyzer

Takes an error message or stack trace and systematically identifies the root cause by reading relevant source files and tracing the execution path.

2 min|Beginner
BuildQuick WinDeveloper
SKILL.md~/.claude/skills/error-analyzer/
---
name: error-analyzer
description: |
  Diagnoses errors and stack traces by tracing them to their root cause.
  IMPORTANT: Activate this skill whenever the user pastes an error,
  asks to "debug this", "fix this error", or "what's causing this".
  This skill MUST be used for all error diagnosis requests.
---

# Error Analyzer

Takes an error message or stack trace and systematically traces it to the root cause. Reads the relevant source files, follows the execution path, and explains what went wrong and how to fix it.

**Trigger:**

Say any of these to activate this skill:
- "debug this error"
- "fix this error"
- "what's causing this"
- "Use skill: error analyzer"
- Or simply paste an error message or stack trace

**How It Works:**

1. Parse the error message to identify: error type, message, file, line number
2. Read the file and line where the error originates
3. Trace backwards: what called this function? What data was passed in?
4. Apply the 5-Whys method to reach the root cause:
   - Why did this line throw? (e.g., variable was null)
   - Why was the variable null? (e.g., upstream function returned null)
   - Why did the upstream function return null? (e.g., query returned no rows)
   - Why did the query return no rows? (e.g., the filter used the wrong column)
   - Why was the wrong column used? (e.g., a recent migration renamed it)
   Stop when you reach a cause that is directly actionable.
5. Check for common patterns: null reference, type mismatch, missing import, async/await issue, race condition
6. Propose a specific fix with the exact code change needed
7. If the fix is straightforward, apply it and run the relevant test or command to verify
8. Verify the fix doesn't introduce a regression by running related tests

**Guidelines:**

- Always trace to the ROOT cause, not just the line that threw — use the 5-Whys until you reach an actionable cause
- Read the full stack trace, the real issue is often 2-3 frames up
- Check recent git changes if the error started suddenly
- If the error is in a dependency, check if the version recently changed
- Explain the error in plain language before proposing the fix
- Distinguish between symptoms (the thrown error) and causes (the bug that produced it)

**Works With:**

- Best with: Claude Code CLI (can read files, run code, and verify fixes)
- Also works: Cursor, Windsurf, any AI tool (paste the error + relevant code)
- Expects: An error message or stack trace from any language/framework

**Output Format:**

- Error summary: what happened in one sentence
- Root cause: what actually went wrong and why
- Fix: specific code change with before/after
- Verification: command to run to confirm the fix works

Takes an error message or stack trace and systematically traces it to the root cause. Reads the relevant source files, follows the execution path, and explains what went wrong and how to fix it.

Say any of these to activate this skill: - "debug this error" - "fix this error" - "what's causing this" - "Use skill: error analyzer" - Or simply paste an error message or stack trace

1. Parse the error message to identify: error type, message, file, line number 2. Read the file and line where the error originates 3. Trace backwards: what called this function? What data was passed in? 4. Apply the 5-Whys method to reach the root cause: - Why did this line throw? (e.g., variable was null) - Why was the variable null? (e.g., upstream function returned null) - Why did the upstream function return null? (e.g., query returned no rows) - Why did the query return no rows? (e.g., the filter used the wrong column) - Why was the wrong column used? (e.g., a recent migration renamed it) Stop when you reach a cause that is directly actionable. 5. Check for common patterns: null reference, type mismatch, missing import, async/await issue, race condition 6. Propose a specific fix with the exact code change needed 7. If the fix is straightforward, apply it and run the relevant test or command to verify 8. Verify the fix doesn't introduce a regression by running related tests

  • Always trace to the ROOT cause, not just the line that threw — use the 5-Whys until you reach an actionable cause
  • Read the full stack trace, the real issue is often 2-3 frames up
  • Check recent git changes if the error started suddenly
  • If the error is in a dependency, check if the version recently changed
  • Explain the error in plain language before proposing the fix
  • Distinguish between symptoms (the thrown error) and causes (the bug that produced it)
  • Best with: Claude Code CLI (can read files, run code, and verify fixes)
  • Also works: Cursor, Windsurf, any AI tool (paste the error + relevant code)
  • Expects: An error message or stack trace from any language/framework
  • Error summary: what happened in one sentence
  • Root cause: what actually went wrong and why
  • Fix: specific code change with before/after
  • Verification: command to run to confirm the fix works
Error Analyzer | Library | Modern Vibe Coding