Let Claude drive the debugger to narrow down a bug
Когда использовать: You've been reading logs for 20 minutes. Time to let Claude set strategic breakpoints and check variable state.
Предварительные требования
.vscode/launch.jsonwith a runnable config — Use${file}for the first config so Claude can run whichever file you have open- claude-debugs-for-you extension installed — VS Code Marketplace
Поток
-
Start the extension serverStart the debug MCP server. Note the path it prints and paste into Claude Desktop config.✓ Скопировано→ Extension status bar shows running
-
Describe the bugMy function
computeTotal()returns NaN when cart has sale items. Place a breakpoint at the start, step through, and tell me where it goes wrong.✓ Скопировано→ Breakpoint set, program runs to it, Claude inspects locals -
DiagnoseBased on the values at each step, what's the root cause and what's the smallest fix?✓ Скопировано→ Root cause + patch
Итог: Bug found by Claude driving the debugger — faster than print-logging.
Подводные камни
- launch.json is misconfigured and the debugger can't start — Test with F5 in VS Code first; only then let Claude drive
- Claude sets too many breakpoints and slows everything to a crawl — Tell it to use conditional breakpoints where possible