microsoft/debug-live
Drive an interactive VS Code debugger to investigate bugs, failing tests, wrong/null variable values, unexpected runtime behavior, and other "it doesn't work" reports. Use this skill whenever speculation about runtime behavior would be cheaper to *verify* by stepping through the code than to reason about. Pairs with the DebugMCP MCP server, which exposes the underlying breakpoint / step / inspect tools.
npx skills add https://github.com/microsoft/DebugMCP --skill debug-live
This skill teaches an agent how to use the DebugMCP MCP server effectively. The MCP server
itself exposes only tools (with brief, behavioral descriptions); the *workflow*, *root cause
analysis framework*, and *language-specific guidance* live here.
> The allowed-tools list above uses the tool names registered by the DebugMCP MCP server.
> Some runtimes namespace MCP tools (e.g. mcp__debugmcp__start_debugging); adapt as needed.
Reach for this skill whenever you would otherwise *guess* at runtime behavior:
null / undefined / wrong type / wrong value.If you can step through the code in a few tool calls, do that instead of speculating.
add_breakpoint with the file path and the 1-basedline number you want to pause on. Place it at the earliest point that's still
relevant to the suspected issue.
data boundaries (where input enters, where output is produced).
start_debugging with the source file path. For a singletest, pass testName; the server routes through VS Code's Testing API so test runners
like dotnet test / pytest / jest work correctly. The call returns when the
program either hits a breakpoint (stopped) or runs to completion without pausing
(terminated).
step_over, step_into, step_out, continue_executionto move through code. Use pause_execution to interrupt a freely-running program
(e.g. a busy loop or embedded target) when there is no breakpoint to stop at.
Use list_variable_names to see what is in scope (names and types only, no values),
then get_variables_values with the specific variableNames you care about, and
evaluate_expression to test hypotheses live (call methods, read properties, run
list comprehensions, etc.).
> get_variables_values requires explicit variableNames — it will not dump the
> whole scope. This is deliberate: a scope dump hands you unrelated process state such
> as API keys, tokens and environment variables. Values that still look like credentials
> are replaced with <redacted: possible secret>; don't try to work around it.
you see — trace it back to *why*.
clear_all_breakpoints when you're done so you don't pollute thenext session, and stop_debugging if the session is still active.
When you encounter an issue during debugging (null variable, unexpected value, thrown
error, wrong branch taken), apply this systematic approach.
user is null").user is null because getUserById()returned null because the DB query failed because the connection string in
appsettings.json points at the wrong host").
thrown exception? Record the current state.
this condition evaluate this way?
forward to watch where the wrong state first appears.
cause — usually where data enters the system, a config is read, or an assumption
is first violated.
null / undefined variable but didn't check why it's that way.❌ Symptom-only: "The user object is null on line 45."
✅ Root cause: "user is null because getUserById() returned null because the DB
query failed because the connection string is incorrect in the configuration file."
Investigation:
user is null → set breakpoint in getUserById().getUserById() returns null → set breakpoint inside the function.❌ Symptom-only: "processOrder() exits early due to invalid payment status."
✅ Root cause: "processOrder() exits early because payment validation fails when
the payment service doesn't receive the required currency field, which wasn't
included in the request due to a missing form field in the UI."
Investigation:
currency missing → trace back to request formation.currency field → root cause identified.❌ Symptom-only: "Calculation result is NaN."
✅ Root cause: "The result is NaN because one input is a string instead of a
number, because parseFloat() fails when the input contains currency symbols that
weren't stripped by the sanitization function."
Investigation:
NaN → check input parameters.parseFloat() fails → check what's being parsed.Before ending the debug session, confirm you can answer:
you isolate the issue, add tighter breakpoints around the problematic region.
add_breakpoint takes a 1-based line; re-check the line afteredits since numbers shift when code changes.
across many iterations without stopping, use add_logpoint with {expression}
interpolation (e.g. iter {i}: total={total}) instead of repeatedly continuing from a
breakpoint. Logpoints also avoid distorting timing-sensitive code.
ones. After each session, clear_all_breakpoints to start fresh.
testName to start_debugging. The server routes throughVS Code's Testing API so test runners (dotnet test, pytest, jest, etc.) are
driven correctly and the debugger attaches to the child test-host process.
calculate.pyadd_breakpoint fileFullPath=/repo/src/calculate.py line=42
start_debugging fileFullPath=/repo/src/calculate.py workingDirectory=/repo
# session pauses on the breakpoint
list_variable_names scope=local
get_variables_values variableNames=["raw","total"] scope=local
evaluate_expression expression="type(raw).__name__"
step_into
# … iterate until root cause found …
clear_all_breakpoints
add_breakpoint fileFullPath=C:\Repo\Calculator.Tests\CalculatorTests.cs line=18
start_debugging fileFullPath=C:\Repo\Calculator.Tests\CalculatorTests.cs workingDirectory=C:\Repo testName=Add_ReturnsSum
# pauses inside the test
step_into
list_variable_names
get_variables_values variableNames=["result","expected"]
restart_debugging
# session restarts with the same configuration; breakpoints persist
continue_execution
Load the relevant reference file for the language you're debugging:
references/troubleshooting/python.mdreferences/troubleshooting/javascript.mdreferences/troubleshooting/java.mdreferences/troubleshooting/csharp.mdreferences/troubleshooting/cpp.mdreferences/troubleshooting/go.mdEach reference covers prerequisites (which VS Code extension to install), framework-specific
configuration (e.g. enabling pytest test discovery, building .NET projects before
launch), and common pitfalls.
get_variables_values and evaluate_expression are for.
start_debugging without first setting a breakpoint. The program willrun to completion and you'll learn nothing.
places. Always clear_all_breakpoints when done.
VS Code debugger; if the program blocks on stdin, no tool call can unblock it. Pick
a code path that doesn't require interactive input, or pre-supply input via the
launch config / fixture.
Take microsoft/debug-live from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.