Overview
Bug fixing with Forge combines human debugging intuition with AI agent execution power. You identify and reproduce the bug, AI agents help fix it, and you verify the solution actually works.The Bug Fixing Cycle
Step 1: Capture the Bug Report
Start with clear bug documentation.Bug Report Template
Create a detailed task card with:- Via UI
- Via CLI
- Via MCP (Claude Code)
Step 2: Reproduce the Bug
Before fixing, ensure you can reliably reproduce it.Create Reproduction Task
Why Reproduction Matters
Benefits of Reproduction
✅ Confirms the bug exists
✅ Provides regression test
✅ Documents exact conditions
✅ Verifies fix actually works
Example Reproduction Test
The AI agent might create:Step 3: Diagnose Root Cause
Use AI agents to help analyze the problem.Diagnostic Approaches
- Code Analysis
- Log Analysis
- Stack Trace Analysis
Step 4: Create Fix Tasks
Break down the fix into focused tasks.Example: JSON Parsing Bug Fix
Step 5: Try Multiple Approaches
Use Forge’s multi-attempt feature to explore different solutions.Approach Comparison
1
Attempt 1: Middleware Approach (Claude)
2
Attempt 2: Custom Parser (Gemini)
3
Attempt 3: Wrapper with Validation (Cursor)
Compare Attempts
| Criterion | Claude (Middleware) | Gemini (Custom) | Cursor (Validation) |
|---|---|---|---|
| Code Quality | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ |
| Performance | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Maintainability | ⭐⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐ |
| Security | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Winner | ✅ Best overall | ❌ | ⚠️ Good alternative |
Step 6: Verify the Fix
Never trust a fix without verification.Verification Checklist
1. Reproduction Test Passes
1. Reproduction Test Passes
2. Edge Cases Covered
2. Edge Cases Covered
- Missing closing bracket
- Extra commas
- Invalid escape sequences
- Empty request body
- Non-JSON content type
3. No Regressions
3. No Regressions
4. Performance Impact
4. Performance Impact
Step 7: Add Regression Test
Prevent the bug from coming back.Example Regression Test Suite
Step 8: Document the Fix
Update documentation to help prevent similar bugs.- Code Comments
- CHANGELOG
- API Documentation
Real-World Example: Memory Leak Bug
Here’s a complete bug fix workflow for a production memory leak:1
Day 1 - Investigation
2
Day 2 - Fix Attempts
3
Day 3 - Verification & Ship
Bug Severity & Agent Strategy
Choose your approach based on bug severity:- Critical (P0)
- High (P1)
- Medium (P2)
- Low (P3)
Characteristics: Production down, data loss, security breachStrategy:
Pro Tips for Bug Fixing
Always Reproduce First
Always Reproduce First
Never start fixing until you have a failing test:
Use Git Bisect for Regression Bugs
Use Git Bisect for Regression Bugs
Label Bugs Clearly
Label Bugs Clearly
Good labels help with prioritization and analytics:
Link to Issues and PRs
Link to Issues and PRs
Common Bug Patterns
Null/Undefined Errors
Best Agent: Claude Code (thorough type checking)
Race Conditions
Best Agent: Claude Code (complex async logic)
Memory Leaks
Best Agent: Claude Code or Cursor CLI
Performance Issues
Best Agent: Try multiple, compare benchmarks
Next Steps
Feature Development
Build new features with confidence
Refactoring Workflow
Safe code improvements with AI
Code Review
Multi-agent PR review process
Testing Guide
Comprehensive testing strategies
Remember: Bugs are opportunities to improve. With Forge, you can experiment with multiple fix approaches in isolation, choose the best solution, and ensure it never happens again.

