Debug Buddy - AI-Powered Browser Debugging Assistant Using Claude Code
β οΈ Debug Buddy requires your own Anthropic (Claude) API key to generate fixes.
Debug Buddy is a Chrome extension that monitors browser console errors in real-time and uses Claude AI to provide instant explanations and code fixes. It displays in a convenient side panel, so it doesnβt block your work.
Features
- π Real-time Error Detection - Automatically captures console.error, console.warn, uncaught exceptions, and network failures
- π€ AI-Powered Analysis - Uses Claude Sonnet 4 to analyze errors and provide actionable fixes
- π Copy-to-Clipboard - One-click copy for suggested code fixes
- π― Domain Whitelist - Only monitors specific domains (localhost, staging sites, etc.)
- π¨ **Cleβ¦
Debug Buddy - AI-Powered Browser Debugging Assistant Using Claude Code
β οΈ Debug Buddy requires your own Anthropic (Claude) API key to generate fixes.
Debug Buddy is a Chrome extension that monitors browser console errors in real-time and uses Claude AI to provide instant explanations and code fixes. It displays in a convenient side panel, so it doesnβt block your work.
Features
- π Real-time Error Detection - Automatically captures console.error, console.warn, uncaught exceptions, and network failures
- π€ AI-Powered Analysis - Uses Claude Sonnet 4 to analyze errors and provide actionable fixes
- π Copy-to-Clipboard - One-click copy for suggested code fixes
- π― Domain Whitelist - Only monitors specific domains (localhost, staging sites, etc.)
- π¨ Clean Side Panel UI - Non-intrusive interface that doesnβt block your work
- β‘ Rate Limited - Smart rate limiting to avoid API spam (1 request/second)
Installation
Requires a recent version of Chrome with Side Panel support (Chrome 114+).
Step 1: Download the Extension
Clone or download this repository to your local machine:
git clone https://github.com/mechramc/debug-buddy-claude.git
# or download and extract the ZIP file
Step 2: Load in Chrome
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in the top-right corner)
- Click Load unpacked
- Select the
debug-buddy-claudefolder containingmanifest.json
Step 3: Configure Your API Key
- Click the Debug Buddy icon in your Chrome toolbar
- Click the Settings (gear) icon in the side panel
- Enter your Anthropic API key
- Click Save Settings
π‘ Get your API key: Visit console.anthropic.com to create an account and generate an API key.
Configuration
API Key
Your Anthropic API key is stored securely in Chromeβs sync storage. To update it:
- Open the Debug Buddy side panel
- Click the Settings icon (βοΈ)
- Enter your new API key
- Click Save Settings
Domain Whitelist
By default, Debug Buddy only monitors errors on these domains:
localhost127.0.0.1*.localstaging.**.staging.*
To customize the whitelist:
- Open Settings
- Edit the domain list (one domain per line)
- Use
*as a wildcard (e.g.,*.example.com) - Click Save Settings
Enable/Disable Monitoring
You can temporarily disable error monitoring without uninstalling the extension:
- Open Settings
- Toggle "Enable error monitoring"
- Click Save Settings
Usage
Viewing Errors
- Open any website in your whitelist
- Click the Debug Buddy icon to open the side panel
- Errors will appear automatically as they occur
- Click any error to see detailed analysis
Understanding the Analysis
Each error analysis includes:
| Field | Description |
|---|---|
| Severity | Low, Medium, High, or Critical |
| Explanation | Clear description of what happened |
| Root Cause | Why the error occurred |
| Suggested Fix | Copy-paste ready code solution |
| Prevention | How to avoid this error in the future |
Copying Fixes
- Click an error to open the detail view
- Scroll to the "Suggested Fix" section
- Click the Copy Fix button
- Paste the fix into your code
File Structure
debug-buddy/
βββ manifest.json # Extension configuration (Manifest V3)
βββ background.js # Service worker (API calls, error handling)
βββ content.js # Content script (captures errors from pages)
βββ sidepanel.html # Side panel UI structure
βββ sidepanel.js # Side panel logic and rendering
βββ styles.css # UI styling
βββ options.html # Settings page
βββ icons/
β βββ icon16.png # Toolbar icon (16x16)
β βββ icon48.png # Extension page icon (48x48)
β βββ icon128.png # Chrome Web Store icon (128x128)
βββ README.md # This file
Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β β β β
β Web Page ββββββΆβ content.js ββββββΆβ background.js β
β β β (Captures β β (Rate limits, β
β console.error β β errors) β β API calls) β
β window.onerror β β β β β
β β ββββββββββββββββββββ ββββββββββ¬βββββββββ
βββββββββββββββββββ β
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β β β β
β Claude API βββββββ API Request βββββββ sidepanel.js β
β β β β β (Displays β
β Analysis & ββββββΆβ API Response ββββββΆβ results) β
β Fix Generation β β β β β
β β ββββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ
Error Types Captured
| Type | Description |
|---|---|
error | console.error() calls |
warning | console.warn() calls |
exception | Uncaught JavaScript exceptions |
promise_rejection | Unhandled Promise rejections |
network_error | Failed fetch/XHR requests (4xx, 5xx) |
API Usage
Debug Buddy uses the Anthropic Messages API:
- Endpoint:
https://api.anthropic.com/v1/messages - Model:
claude-sonnet-4-20250514 - Rate Limit: 1 request per second (enforced by extension)
- Max Tokens: 1024 per response
Estimated Costs
Approximate costs based on typical usage:
| Errors/Day | Est. Monthly Cost |
|---|---|
| 10 | ~$0.30 |
| 50 | ~$1.50 |
| 100 | ~$3.00 |
Costs vary based on error complexity and stack trace length.
Troubleshooting
"API key not configured" Warning
- Open the Settings panel
- Enter a valid Anthropic API key
- Make sure it starts with
sk-ant-
Errors Not Being Captured
- Check if the domain is in your whitelist
- Verify the extension is enabled
- Refresh the page after making changes
- Check the browser console for extension errors
Analysis Failing
- Verify your API key is valid
- Check your Anthropic account has available credits
- Check your network connection
- Look for rate limit messages in the console
Side Panel Not Opening
- Click the Debug Buddy icon in the toolbar
- If the icon isnβt visible, click the puzzle piece (π§©) and pin Debug Buddy
- Try refreshing the page
Development
Building from Source
No build step required! The extension uses vanilla JavaScript and can be loaded directly.
Making Changes
- Edit the source files
- Go to
chrome://extensions/ - Click the refresh icon (π) on the Debug Buddy card
- Reload the page youβre testing
Adding New Error Types
Edit content.js to capture additional error types. The sendErrorToBackground() function accepts any error object with these fields:
{
type: 'custom_error',
message: 'Error message',
filename: 'source.js',
lineno: 42,
colno: 10,
stack: 'Error stack trace...'
}
Privacy & Security
- API Key Storage: Your API key is stored in Chromeβs sync storage and never sent anywhere except Anthropicβs API
- Error Data: Error messages and stack traces are sent to Claude API for analysis
- No Tracking: Debug Buddy does not collect analytics or track usage
- Local Only: All error data is stored locally in your browser
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
MIT License - see LICENSE for details.
Roadmap
v2.0 (Planned)
- Visual/CSS screenshot analysis
- Team dashboard
- Error sharing/export
v2.1 (Planned)
- Payment integration (Pro tier)
- Usage analytics
- Custom AI prompts
Made with β€οΈ for developers who hate cryptic error messages