Bug Hunter
CodingIntermediate
Paste an error message or stack trace, and it searches the codebase to find the root cause, suggesting solutions ranked by likelihood.
Trigger
/bugFrequencyAs needed
On-call engineer dealing with a late-night incident? Paste the error log to get root cause + fix code within 5 minutes
DebuggingErrorsTroubleshooting
How It Works
Input error message -> parse error
↓
Phase 1: 2 searches in parallel
code-search
Search related files
path-trace
Trace execution path
↓
Infer root cause (ranked) -> generate fix
↓
✓ Root cause + fix code + prevention guide
Skill Code
# Bug Hunter Skill
## Trigger: Paste an error message or describe a bug
When user shares an error:
1. Parse the error:
- Error type (TypeError, SyntaxError, etc.)
- File and line number
- Stack trace analysis
2. Search codebase:
- Find the relevant file(s)
- Read surrounding context
- Trace the execution path
3. Identify root cause:
- List possible causes ranked by likelihood
- Show the problematic code section
4. Suggest fix:
- Provide corrected code
- Explain why the fix works
- Suggest prevention measures
5. Output format:
---
## 🐛 Bug Analysis
**Error**: [error type]
**Location**: `file:line`
### Root Cause
[explanation]
### Fix
```
[corrected code]
```
### Prevention
- [how to prevent this in the future]
---
Copy and paste into your CLAUDE.md to start using immediately.
How Bug Hunter Works
Bug Hunter takes an error message or bug description, traces through your codebase to find the root cause, analyzes the call stack and data flow, and proposes a targeted fix with an explanation of why the bug occurred.
When to Use Bug Hunter
Excels at cryptic runtime errors that span multiple files, especially when the error message points to a symptom rather than the root cause — it follows the chain of dependencies to find the actual source.
Key Strengths
- Traces root cause across multiple files and modules
- Explains why the bug occurs, not just how to fix it
- Handles cryptic error messages by analyzing context
- Proposes minimal, targeted fixes to avoid side effects