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