AI-powered debugging assistant with seamless Claude Code integration - Transform error messages into actionable solutions with advanced AI analysis, multi-language support, and native Claude Code commands. Let AI understand your bugs instantly!
- ๐ Extended Language Support - Now supports 10+ languages including Shell/Bash, Docker, YAML/JSON, Kotlin, Swift, and SQL
- ๐ณ Docker & Container Analysis - Comprehensive Dockerfile and Docker Compose error detection
- ๐ Configuration File Support - Smart YAML/JSON analysis for CI/CD pipelines and Kubernetes
- ๐ฑ Mobile Development - Full support for Kotlin (Android) and Swift (iOS) error analysis
- ๐ 60% Faster Pattern Matching - Completely rewritten engine for better performance
- ๐ฏ Enhanced Pattern Recognition - 50+ new error patterns per language
- ๐ Multi-Language Support - Full i18n with Chinese (ไธญๆ) and English interface
- ๐ง Advanced Error Analysis - Three intelligent analyzers: Stack Trace, Pattern, and Code Context
- ๐ฏ ML-Ready Suggestion Engine - Confidence-scored solutions based on error patterns
- ๐ Deep Stack Trace Analysis - Support for Python, JavaScript, TypeScript, Java, Ruby, Go, Shell/Bash, Docker, YAML/JSON, Kotlin, Swift, SQL
- ๐ค Claude Code Integration - Native
/ccdebugslash command for seamless workflow - ๐ Smart Clipboard Integration - Auto-detect and analyze errors from clipboard
- ๐จ Beautiful Terminal UI - Rich, colorful output with progress indicators
- ๐ Intelligent Error Patterns - Pre-configured patterns for common errors
- ๐ง Extensible Architecture - Plugin system for custom analyzers and patterns
- ๐ Learning System - Improves suggestions based on successful resolutions
- ๐ Performance Optimized - Direct Python API for faster analysis
- ๐ Secure by Default - Safe error handling without exposing sensitive data
# Install from source
git clone https://github.com/888wing/ClaudeCode-Debugger.git
cd ClaudeCode-Debugger
pip install -e .
# Setup Claude Code integration (NEW!)
python setup_claude_code.py# Analyze error with Chinese interface
ccdebug "TypeError: Cannot read property 'name' of undefined" --lang zh
# Deep analysis with suggestions
ccdebug "AttributeError: 'NoneType' object" --analyze-stack --suggest
# Read from clipboard
ccdebug -c --lang zh
# Interactive mode
ccdebug -i
# Claude Code integration
# In Claude Code, when you encounter an error:
/ccdebug --last --zh --deep# Chinese interface (ไธญๆ็้ข)
cczh "้ฏ่ชคไฟกๆฏ" # Quick Chinese analysis
ccfull # Full analysis in Chinese
# English interface
ccen "error message" # Quick English analysis
ccdebug --lang en # Explicit English- Shell/Bash - Script errors, command not found, syntax issues
- Docker - Dockerfile syntax, build errors, runtime issues
- YAML/JSON - Configuration errors, CI/CD pipelines, Kubernetes manifests
- Kotlin - Null safety, coroutines, Android-specific patterns
- Swift - Optionals, memory management, SwiftUI errors
- SQL - Query syntax, joins, performance hints
- Python - Full stack traces, import errors, type errors
- JavaScript/TypeScript - Runtime errors, async issues, type mismatches
- Java - Exceptions, null pointers, classpath issues
- Ruby - Rails errors, gem conflicts, syntax issues
- Go - Compilation errors, goroutine panics, interface issues
CCDebugger now seamlessly integrates with Claude Code! Errors are automatically detected and analyzed without any manual intervention.
When you run commands in Claude Code that produce errors, CCDebugger automatically:
- Detects error patterns in real-time
- Extracts error context and stack traces
- Generates AI-powered debugging suggestions
- Provides instant solutions in Chinese or English
# Analyze last error
ccdebug last
# View error history
ccdebug history
# Start monitoring mode
ccdebug monitor start
# Configure settings
ccdebug config set defaultLanguage zh# When you run code with errors in Claude Code:
result = undefined_function() # NameError
# CCDebugger automatically shows:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ๐ CCDebugger ่ชๅ้ฏ่ชคๅๆ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ ๏ธ **CCDebugger ้ฏ่ชคๅๆๅ ฑๅ**
**้ฏ่ชค้กๅ**: NameError
**ๅด้็จๅบฆ**: high
**AI ่ชฟ่ฉฆๆ็คบ**:
ไฝ ้ๅฐไบไธๅ NameError๏ผ้่กจ็คบ Python ็กๆณๆพๅฐๅ็บ 'undefined_function' ็ๅฝๆธใ
**๐ฏ ๆบ่ฝๅปบ่ญฐ**:
1. ๆชขๆฅๆฏๅฆๆญฃ็ขบๅฐๅ
ฅไบ่ฉฒๅฝๆธ
2. ็ขบ่ชๅฝๆธๅ็จฑๆผๅฏซๆฏๅฆๆญฃ็ขบ
3. ๆชขๆฅๅฝๆธๆฏๅฆๅจ็ถๅไฝ็จๅๅ
งๅฎ็พฉSee CLAUDE_CODE_INTEGRATION.md for full documentation.
$ ccdebug "AttributeError: 'NoneType' object has no attribute 'profile'" --lang zh --suggest
๐จ Python ้ฏ่ชค - HIGH ๅชๅ
็ด
ๆชขๆธฌๅฐ: AttributeError - NoneType ้ฏ่ชค
๐ ๅ ็่ฟฝ่นคๅๆ:
- ๆ นๆฌๅๅ : ๅ่ฉฆ่จชๅ None ๅฐ่ฑก็ๅฑฌๆง
- ๅฝฑ้ฟ็ฏๅ: 1 ๅๆไปถๅๅฝฑ้ฟ
๐ฏ ๆบ่ฝๅปบ่ญฐ (ไฟกๅฟๅบฆ: 85%):
1. ๆทปๅ None ๆชขๆฅ:
```python
if user and hasattr(user, 'profile'):
return user.profile.avatar_url
return None-
ไฝฟ็จ getattr ๅฎๅ จ่จชๅ:
profile = getattr(user, 'profile', None) if profile: return profile.avatar_url
-
ไฝฟ็จ try-except ่็:
try: return user.profile.avatar_url except AttributeError: return None
โ ๅทฒ่ค่ฃฝๅฐๅช่ฒผๆฟ
### JavaScript TypeError with Code Context
```bash
$ ccdebug --last --lang en --analyze-stack --suggest
๐จ JavaScript Error - HIGH Priority
TypeError: Cannot read property 'map' of undefined
๐ Stack Trace Analysis:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ at TodoList (TodoList.jsx:15:19) โ
โ at renderWithHooks (react-dom.js:14985)โ
โ at mountComponent (react-dom.js:17441) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Pattern Analysis:
- Error Pattern: undefined_property_access
- Common in: React component props
- Severity: HIGH
๐ฏ Suggestions (Confidence: 92%):
1. Add default props:
```javascript
function TodoList({ todos = [] }) {
return <ul>{todos.map(todo => <li>{todo.text}</li>)}</ul>
}
-
Add conditional rendering:
function TodoList({ todos }) { if (!todos || !Array.isArray(todos)) { return <div>No todos available</div> } return <ul>{todos.map(todo => <li>{todo.text}</li>)}</ul> }
-
Use optional chaining:
return <ul>{todos?.map(todo => <li>{todo.text}</li>) || null}</ul>
[โ Analysis complete]
### Claude Code Integration
```bash
# In Claude Code, when you encounter an error:
User: python manage.py runserver
Claude: [Shows Django error]
User: /ccdebug --last --zh --deep
Claude:
๐จ Django ้ฏ่ชคๅๆ
ๆชขๆธฌๅฐ: ImproperlyConfigured
๐ ๆทฑๅบฆๅๆ:
- ้ฏ่ชคไฝ็ฝฎ: settings.py:89
- ๆ นๆฌๅๅ : DATABASES ้
็ฝฎ็ผบๅคฑ
- ๅฝฑ้ฟ: ๆ็จ็จๅบ็กๆณๅๅ
๐ฏ ่งฃๆฑบๆนๆก:
1. ๆชขๆฅ settings.py ไธญ็ DATABASES ้
็ฝฎ
2. ็ขบไฟ็ฐๅข่ฎๆธๆญฃ็ขบ่จญ็ฝฎ
3. ้ฉ่ญๆธๆๅบซ้ฃๆฅๅๆธ
[่ฉณ็ดฐๆญฅ้ฉๅไปฃ็ขผ็คบไพ...]
$ ccdebug "./deploy.sh: line 42: syntax error near unexpected token 'fi'" --lang en
๐จ Bash Script Error - HIGH Priority
Syntax error detected in shell script
๐ Error Analysis:
- Error Type: Syntax Error
- Location: deploy.sh, line 42
- Issue: Missing 'then' after 'if' statement
๐ฏ Solution:
Add 'then' keyword after your if condition:
```bash
if [ "$ENVIRONMENT" = "production" ]; then # Add 'then' here
deploy_production
fi
#### Docker Build Error
```bash
$ ccdebug "Service 'web' failed to build: COPY failed: no source files" --lang zh
๐จ Docker ๆงๅปบ้ฏ่ชค - HIGH ๅชๅ
็ด
Docker ๆงๅปบ้็จไธญๆชๆก่ค่ฃฝๅคฑๆ
๐ ้ฏ่ชคๅๆ:
- ้ฏ่ชค้กๅ: COPY ๆไปคๅคฑๆ
- ๅๅ : ๆบๆชๆกไธๅญๅจๆ่ทฏๅพ้ฏ่ชค
- ๅฝฑ้ฟ: Docker ๆ ๅ็กๆณๆงๅปบ
๐ฏ ่งฃๆฑบๆนๆก:
1. ๆชขๆฅ Dockerfile ไธญ็ COPY ่ทฏๅพ:
```dockerfile
# ็ขบไฟ่ทฏๅพ็ธๅฐๆผๆงๅปบไธไธๆ
COPY ./app /app # ่้ COPY app /app
- ้ฉ่ญๆงๅปบไธไธๆๅ
ๅซๆ้ๆชๆก:
docker build -f Dockerfile . # '.' ๆฏๆงๅปบไธไธๆ
#### YAML Configuration Error
```bash
$ ccdebug "error validating data: ValidationError(Deployment.spec.replicas): invalid type" --lang en
๐จ Kubernetes YAML Error - MEDIUM Priority
Invalid YAML configuration detected
๐ Error Analysis:
- Error Type: Type Validation Error
- Field: spec.replicas
- Expected: integer, Got: string
๐ฏ Solution:
Fix the replicas field to use a number:
```yaml
spec:
replicas: 3 # Not "3" (string)
## ๐ ๏ธ Advanced Features
### Intelligent Analyzers
CCDebugger includes three advanced analyzers:
```python
# Stack Trace Analyzer - Multi-language support
from claudecode_debugger.analyzers import StackTraceAnalyzer
analyzer = StackTraceAnalyzer()
result = analyzer.analyze(error_text)
# Returns: language, frames, root_cause, error_type
# Pattern Analyzer - Detects common error patterns
from claudecode_debugger.analyzers import PatternAnalyzer
analyzer = PatternAnalyzer()
patterns = analyzer.analyze(error_text)
# Returns: matched patterns with solutions
# Code Context Analyzer - Extracts code context
from claudecode_debugger.analyzers import CodeContextAnalyzer
analyzer = CodeContextAnalyzer()
context = analyzer.extract_context("app.py", line_number=42)
# Returns: code snippet with surrounding lines
from claudecode_debugger.suggestions import SuggestionEngine
engine = SuggestionEngine()
suggestions = engine.generate_suggestions(
error_type="AttributeError",
error_patterns=["null_reference"],
stack_trace_info=stack_info
)
# Returns: Ranked suggestions with confidence scoresCreate ~/.ccdebugrc for personal preferences:
{
"defaultLanguage": "zh",
"defaultMode": "deep",
"autoSuggest": true,
"copyToClipboard": true,
"contextLines": 10,
"favoriteFrameworks": ["django", "react", "vue"],
"customPatterns": {
"myapp": {
"errorPattern": "MyAppError:",
"suggestion": "Check MyApp configuration"
}
}
}The /ccdebug command seamlessly integrates with Claude Code:
# Auto-detection and analysis
/ccdebug --last --zh
# Different analysis modes
/ccdebug --quick # Fast analysis
/ccdebug --deep # Detailed analysis with suggestions
/ccdebug --full # Complete analysis with code context
# Batch processing
/ccdebug --batch --dir logs/
# Watch mode
/ccdebug --watch server.logAdd your own error patterns:
from claudecode_debugger.analyzers.pattern import ErrorPattern
custom_pattern = ErrorPattern(
name="custom_api_error",
pattern=r"API Error: (\d+)",
description="Custom API error",
category="api",
severity="high",
common_causes=["Invalid API key", "Rate limit exceeded"],
solutions=["Check API credentials", "Implement retry logic"]
)CCDebugger is built with a modular, extensible architecture:
claudecode_debugger/
โโโ analyzers/ # Intelligent error analyzers
โ โโโ stack_trace.py # Multi-language stack trace analysis
โ โโโ pattern.py # Error pattern detection
โ โโโ code_context.py # Code context extraction
โโโ suggestions/ # ML-ready suggestion engine
โ โโโ engine.py # Confidence-scored solutions
โโโ i18n/ # Internationalization
โ โโโ translator.py # Translation engine
โ โโโ messages/ # Language files (en, zh)
โโโ formatters/ # Output formatters
โ โโโ console.py # Rich terminal output
โ โโโ markdown.py # Markdown formatting
โโโ cli_new.py # Enhanced CLI with full features
- I18n System: Full internationalization with automatic language detection
- Analyzer Framework: Pluggable analyzers for different error types
- Suggestion Engine: Knowledge base with confidence scoring
- Claude Code Integration: Native slash command support
- Rich UI: Beautiful terminal output with progress indicators
We welcome contributions! Please see our Contributing Guidelines for details.
# Clone the repository
git clone https://github.com/888wing/ClaudeCode-Debugger.git
cd ClaudeCode-Debugger
# Install in development mode
make dev
# Run tests
make test
# Format code
make formatThis project is licensed under the MIT License - see the LICENSE file for details.
- Built for the Claude Code community
- Inspired by the need for better debugging workflows
- Special thanks to all contributors
- ๐ Claude Code Integration Guide
- ๐ฏ /ccdebug Command Reference
- ๐ Real-World Examples
- ๐ Issue Tracker
- ๐ฌ Discussions
- ๐ Changelog
- ๐ Added support for Shell/Bash, Docker, YAML/JSON, Kotlin, Swift, and SQL
- ๐ 60% performance improvement in pattern matching
- ๐ 500+ error patterns across all supported languages
- ๐ณ Docker and container-specific error analysis
- ๐ Configuration file validation for CI/CD pipelines
- ๐ฑ Mobile development support (Kotlin/Swift)
- ๐ฏ Enhanced confidence scoring algorithm
- ๐ Full internationalization (i18n) with Chinese and English support
- ๐ง Three new intelligent analyzers for deep error analysis
- ๐ฏ ML-ready suggestion engine with confidence scoring
- ๐ค Native Claude Code integration with
/ccdebugcommand - ๐ Advanced error pattern detection
- ๐ Multi-language stack trace analysis
- โจ Complete architectural overhaul for extensibility