Analyzes error messages to identify root causes, predict resolution time, and suggest proven fixes. Learns patterns from similar errors to provide immediate solutions.
Analyzes error messages to identify root causes and suggest proven fixes. Use it after encountering build failures, runtime exceptions, or test errors to get immediate solutions with predicted resolution times.
/plugin marketplace add wasabeef/claude-code-cookbook/plugin install cook-en@claude-code-cookbookAnalyzes error messages to identify root causes, predict resolution time, and suggest proven fixes. Learns patterns from similar errors to provide immediate solutions.
/fix-error [options]
--deep: Deep dive including dependencies and environment--preventive: Focus on preventing future occurrences--quick: Quick fixes only# Standard error analysis
npm run build 2>&1
/fix-error
"Analyze this build error and suggest fixes"
# Deep analysis mode
python app.py 2>&1
/fix-error --deep
"Find the root cause, including environment issues"
# Quick fixes only
cargo test 2>&1
/fix-error --quick
"Just give me a quick fix"
# Prevention-focused
./app 2>&1 | tail -50
/fix-error --preventive
"Fix this and help me prevent it next time"
# Analyze error logs
cat error.log
/fix-error
"What's causing this error and how do I fix it?"
# Resolve test failures
npm test 2>&1
/fix-error --quick
"These tests are failing - need a quick fix"
# Analyze stack traces
python script.py 2>&1
/fix-error --deep
"Dig into this stack trace and check for environment issues"
# Handle multiple errors
grep -E "ERROR|WARN" app.log | tail -20
/fix-error
"Sort these by priority and tell me how to fix each one"
🚀 Immediate Fix (< 5 minutes)
├─ Typos, missing imports
├─ Environment variables not set
├─ Undefined variable references
└─ Predicted time: 2-5 minutes
⚡ Quick Fix (< 30 minutes)
├─ Dependency version conflicts
├─ Configuration file errors
├─ Type mismatches
└─ Predicted time: 10-30 minutes
🔧 Investigation Required (< 2 hours)
├─ Complex logic errors
├─ Async processing race conditions
├─ API integration issues
└─ Predicted time: 30 minutes-2 hours
🔬 Deep Analysis (Half day or more)
├─ Architecture-related issues
├─ Multi-system integration problems
├─ Performance degradation
└─ Predicted time: 4 hours-several days
Common Errors and Immediate Solutions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 "Cannot read property 'X' of undefined/null" (Frequency: Extremely High)
├─ Primary cause: Insufficient null checks on objects
├─ Resolution time: 5-10 minutes
└─ Solution: Add Optional chaining (?.) or null checks
📊 "ECONNREFUSED" / "ENOTFOUND" (Frequency: High)
├─ Primary cause: Service not running or URL misconfiguration
├─ Resolution time: 5-15 minutes
└─ Solution: Check service startup, environment variables
📊 "Module not found" / "Cannot resolve" (Frequency: High)
├─ Primary cause: Package not installed, incorrect path
├─ Resolution time: 2-5 minutes
└─ Solution: Run npm install, check relative paths
📊 "Unexpected token" / "SyntaxError" (Frequency: Medium)
├─ Primary cause: Bracket/quote mismatch, reserved word usage
├─ Resolution time: 2-10 minutes
└─ Solution: Check syntax highlighting, run linter
📊 "CORS policy" / "Access-Control-Allow-Origin" (Frequency: Medium)
├─ Primary cause: Insufficient CORS configuration on server
├─ Resolution time: 15-30 minutes
└─ Solution: Configure server CORS, setup proxy
📊 "Maximum call stack size exceeded" (Frequency: Low)
├─ Primary cause: Infinite loops/recursion, circular references
├─ Resolution time: 30 minutes-2 hours
└─ Solution: Check recursion termination conditions, resolve circular references
| Priority | Icon | Impact Range | Resolution Difficulty | Response Deadline | Description |
|---|---|---|---|---|---|
| Critical | 🔴 Emergency | Wide | Low | Start within 15 min | System-wide outage, data loss risk |
| High Priority | 🟠 Early Response | Wide | High | Start within 1 hour | Major feature outage, many users affected |
| Medium | 🟡 Planned Response | Narrow | High | Address same day | Partial feature limitation, workaround available |
| Low | 🟢 Monitor | Narrow | Low | Next maintenance cycle | Minor bugs, minimal UX impact |
🔴 Must have:
- Full error message
- Stack trace
- Steps to reproduce
🟡 Should have:
- Environment details (OS, versions, dependencies)
- Recent changes (git log, commits)
- Related logs
🟢 Nice to have:
- System resources
- Network state
- External services
Identify symptoms
Find root causes
Test your theory
🔴 Quick fix (hotfix):
- Stop the bleeding
- Apply workarounds
- Get ready to deploy
🟡 Root cause fix:
- Fix the actual problem
- Add tests
- Update docs
🟢 Prevent future issues:
- Better error handling
- Add monitoring
- Improve CI/CD
🚨 Error Analysis Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📍 Error Overview
├─ Type: [Compilation/Runtime/Logical/Environmental]
├─ Urgency: 🔴 High / 🟡 Medium / 🟢 Low
├─ Impact Scope: [Feature name/Component]
└─ Reproducibility: [100% / Intermittent / Specific conditions]
🔍 Root Cause
├─ Direct Cause: [Specific cause]
├─ Background Factors: [Environment/Configuration/Dependencies]
└─ Trigger: [Occurrence conditions]
💡 Solutions
🔴 Immediate response:
1. [Specific fix command/code]
2. [Temporary workaround]
🟡 Fundamental solution:
1. [Essential fix method]
2. [Necessary refactoring]
🟢 Preventive measures:
1. [Error handling improvement]
2. [Add tests]
3. [Monitoring setup]
📝 Verification Procedure
1. [Method to confirm after applying fix]
2. [Test execution command]
3. [Operation check items]
# TypeScript type errors
Must check (high):
- tsconfig.json settings
- Presence of type definition files (.d.ts)
- Accuracy of import statements
# Rust lifetime errors
Must check (high):
- Ownership movement
- Reference validity periods
- Mutability conflicts
# Null/Undefined references
Must check (high):
- Insufficient optional chaining
- Initialization timing
- Waiting for async processing completion
# Memory-related errors
Must check (high):
- Heap dump acquisition
- GC log analysis
- Circular reference detection
# Version conflicts
Must check (high):
- Lock file consistency
- Peer dependencies requirements
- Transitive dependencies
# Module resolution errors
Must check (high):
- NODE_PATH settings
- Path alias configuration
- Symbolic links
/design-patterns: Analyze code structure issues and suggest patterns/tech-debt: Analyze root causes of errors from a technical debt perspective/analyzer: For cases requiring deeper root cause analysis/fix-errorIdentifica a causa raiz a partir de mensagens de erro, prediz o tempo de resolução e propõe soluções comprovadas. Aprende padrões de erros similares e apresenta imediatamente o método de resolução apropriado.