/fix-error
Analyzes error messages to identify root causes, predict resolution time, and suggest proven fixes. Learns patterns from similar errors to provide immediate solutions.
> /plugin marketplace add wasabeef/claude-code-cookbookHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/fix-error
Context preview
What this command does when you run it.
Analyzes error messages to identify root causes, predict resolution time, and suggest proven fixes. Learns patterns from similar errors to provide immediate solutions.
Command definition
fix-error.mdIdentify root cause and suggest proven solutions
Analyzes error messages to identify root causes, predict resolution time, and suggest proven fixes. Learns patterns from similar errors to provide immediate solutions.
Usage
/fix-error [options]
Options
- None: Standard error analysis
- `--deep`: Deep dive including dependencies and environment
- `--preventive`: Focus on preventing future occurrences
- `--quick`: Quick fixes only
Basic Examples
# 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"
Collaboration with Claude
# 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"
Error Resolution Time Prediction
π 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
Similar Error Pattern Database
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
Error Analysis Priority Matrix
| 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 |
Analysis Process
Phase 1: Error Information Collection
π΄ 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
Phase 2: Root Cause Analysis
1. **Identify symptoms**
- Exact error message
- When and how it happens
- What's affected
2. **Find root causes**
- Use 5 Whys analysis
- Check dependencies
- Compare environments
3. **Test your theory**
- Create minimal repro
- Isolate the issue
- Confirm the cause
Phase 3: Solution Implementation
π΄ 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
Output Example
π¨ 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
Read more
Identify root cause and suggest proven solutions
Analyzes error messages to identify root causes, predict resolution time, and suggest proven fixes. Learns patterns from similar errors to provide immediate solutions.
Usage
/fix-error [options]
Options
- None: Standard error analysis
- `--deep`: Deep dive including dependencies and environment
- `--preventive`: Focus on preventing future occurrences
- `--quick`: Quick fixes only
Basic Examples
# 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"
Collaboration with Claude
# 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"
Error Resolution Time Prediction
π 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
Similar Error Pattern Database
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
Error Analysis Priority Matrix
| 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 |
Analysis Process
Phase 1: Error Information Collection
π΄ 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
Phase 2: Root Cause Analysis
1. **Identify symptoms**
- Exact error message
- When and how it happens
- What's affected
2. **Find root causes**
- Use 5 Whys analysis
- Check dependencies
- Compare environments
3. **Test your theory**
- Create minimal repro
- Isolate the issue
- Confirm the cause
Phase 3: Solution Implementation
π΄ 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
Output Example
π¨ 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
A collection of commands, roles, and automation scripts for Claude Code. Automate your workflow without unnecessary confirmations, allowing you to focus on what matters.
Repo: wasabeef/claude-code-cookbook
Other commands on claude-code-cookbook.
- /analyze-dependencies
Analyzes your project's dependencies and checks architecture health.
Open command - /analyze-performance
Analyzes application performance from a user experience perspective and quantifies experience improvements from optimizations. Calculates UX scores based on Core Web Vitals and proposes prioritized optimization strategies.
Open command - /check-fact
Verifies if a statement is true by checking your project's code and documentation.
Open command - /check-prompt
A comprehensive collection of best practices for evaluating and improving the quality of prompts for AI Agents. It systematizes knowledge gained from actual prompt improvement processes, covering all important aspects such as ambiguity elimination, information integration,
Open command - /commit-message
Generates commit messages from staged changes (git diff --staged). This command only creates messages and copies them to your clipboardβit doesn't run any git commands.
Open command - /context7
Searches technical documentation using MCP's Context7.
Open command

