How AI Fix works
When your bot crashes, the platform offers a one-click "Fix with AI" button. Behind the button: Claude reads your code, your traceback, and your bot's recent context, then proposes a diff. This page explains what's inside the box, what it catches well, and where to be careful.
In this guide
How it works under the hood
The flow, end to end:
- Your bot raises an unhandled exception. The runtime captures the traceback, the bot's code, and the last ~50 log lines.
- The dashboard shows a red banner with the error and a Fix with AI button.
- You click it. The platform sends a POST to
watchdogbot.cloud/api/ai/fixwith: your code, the traceback, recent logs, and the bot's metadata (exchange, framework version, language version). - The backend prompts Claude with a tightly scoped system prompt: "You are debugging a Python trading bot. Output JSON with the proposed code change and an explanation. Do not change unrelated lines."
- Claude responds with a structured diff and a short explanation. The dashboard shows the diff inline. You click Apply, the file is updated, and you can restart the bot.
Approximate latency: 3–8 seconds end to end depending on Claude's response time.
What AI Fix is good at
Based on real usage, AI Fix has the highest success rate on these error categories:
| Error class | Hit rate | Why it works |
|---|---|---|
| SyntaxError / IndentationError | ~95% | Mechanical — Claude sees the line and fixes it |
| TypeError / AttributeError | ~85% | Usually a missing None check or wrong type assumption |
| KeyError on dict access | ~80% | Suggest .get() with a default, or check the key exists first |
| ImportError (subtle ones) | ~75% | For dependency package-name mismatches (the auto-installer handles the simple cases) |
| Async/await mistakes | ~70% | asyncio errors have a clear structural fix |
| HTTP response parsing | ~65% | Common — bot assumes the API always returns a number, sometimes it returns null |
Overall success rate across real user reports: roughly 70%.
Where AI Fix struggles
AI Fix is a code-level debugger, not a strategist. It will not help with:
- Logic errors that don't crash. Your bot losing money silently is not something Claude can see in a traceback.
- Rate limit / 429 responses. The fix is policy (slow down requests), and Claude doesn't know your real rate budget.
- Network outages. If Binance is down, no code change helps.
- Strategy bugs. If your math is wrong (off-by-one, wrong sign on a return calculation), the bot might run fine and the error appears in your P&L, not in a traceback.
- Concurrent access bugs. Race conditions are notoriously hard for LLMs because the symptom rarely reproduces from a single trace.
Heuristic: If the error message points to a specific line of YOUR code, AI Fix usually helps. If the error message is generic ("Connection reset", "rate limit exceeded", "timeout"), the fix is operational, not code.
When to trust the suggestion
Three quick checks before clicking Apply:
- Read the diff. Even if it's three lines. Claude occasionally "fixes" the symptom by silently catching the exception, which masks the real bug. If the diff is just
except Exception: pass, reject it. - Check that unrelated logic isn't touched. A good AI Fix changes exactly the broken thing. If it rewrites a function that was working, something is off.
- Run in demo mode first. WatchDog Bot has
wd.is_demo()for exactly this — restart in demo, verify the fix actually runs end-to-end without errors, then promote to live.
If the suggested fix looks wrong, you can re-ask AI Fix with extra context (a longer log excerpt, or a comment explaining what you actually intended). The dashboard lets you edit the prompt context before re-submitting.
Rate limits & cost
AI Fix is included in every WatchDog Bot subscription. There's a soft cap of 50 calls per 24-hour window per user to prevent runaway scripted abuse. In normal use no one hits this — most users call AI Fix once or twice a week.
If you do hit the limit, you'll see "AI Fix daily limit reached. Try again in N hours." The counter resets on a rolling 24h basis.
Privacy & what gets sent
When you click Fix with AI, the platform sends to Claude:
- Your bot's source code (the file you wrote)
- The Python traceback
- The last ~50 lines of bot logs
- Bot metadata: bot ID, bot name (if you set one), and the connection name if the error involves an API call
What does not get sent:
- API keys or secrets — these are pulled at runtime via
wd.connection(...)and never appear in code we send - Your account email, IP address, or any user identifier beyond the bot ID
- Other bots' code or logs
- Your past chat history with the platform
Claude processes the request through Anthropic's API under their standard terms. Anthropic does not train on API data unless explicitly opted in. We don't retain the prompt or response on our backend longer than the request lifetime (~30 seconds) — only an audit row in app_errors recording the call happened and whether it succeeded.
Bottom line: The model sees your code, not your money. We designed AI Fix so a leak to Anthropic would expose your strategy IP but never your trading capital.
Try AI Fix on your next bug
Included in every WatchDog Bot subscription. Free trial, no credit card.
Start Free Trial →
WatchDog Bot