code-debugginglisted
Install: claude install-skill sergeeey/Claude-cod-top-2026
# Code Debugging
Systematically debug experiment code with structured error categorization and fix strategies.
## Input
- `$0` — Error message, stderr output, or code file with issues
- `$1` — Optional: the code that produced the error
## References
- Debug patterns and state machine: `~/.claude/skills/code-debugging/references/debug-patterns.md`
## Workflow
### Step 1: Categorize the Error
| Category | Examples | Severity |
|----------|----------|----------|
| SyntaxError | Invalid syntax, indentation | Low |
| ImportError | Missing module, wrong name | Low |
| RuntimeError | Division by zero, shape mismatch | Medium |
| TimeoutError | Infinite loop, too slow | Medium |
| OutputError | Missing files, wrong format | Medium |
| LogicError | Wrong results, 0% accuracy | High |
### Step 2: Analyze Root Cause
1. Read the error traceback (last 1500 chars if truncated)
2. Identify the exact line and variable causing the error
3. Check for common patterns:
- Device mismatch (CPU vs GPU tensors)
- Shape mismatch in matrix operations
- Missing data normalization
- Off-by-one errors in indexing
- Incorrect loss function for task type
### Step 3: Apply Fix Strategy
**For syntax/import errors**: Direct fix, single attempt
**For runtime errors**: Fix and rerun, up to 4 retries
**For logic errors**: Reflect on approach, consider alternative methods
**For timeout**: Reduce dataset size, optimize bottleneck, add early stopping
### Step 4: Reflect and Prevent
After