/rider-skills:debugging-codefrom rider-skills
Uses Rider's debugger for runtime root-cause analysis in .NET/C#, F#, VB, C++, Unity, Unreal Engine, and mixed-language projects. Sets breakpoints, steps, and inspects values when source or logs are insufficient.
Ships in rider-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Debugger-first runtime root-cause analysis for solutions opened in Rider, including C#, C++, F#, VB, Unreal Engine, and other GameDev projects.
Invoke every tool through execute_tool(command="<tool> --arg value ..."). Do not call the underlying handles directly. Read reference/tools.md only for the specific tool you are about to call; do not pre-load the whole tree.
xdebug_set_breakpoints --breakpoints takes one quoted JSON array, for example --breakpoints '[{"filePath":"Program.cs","line":42},{"filePath":"Worker.cs","line":18,"condition":"id == 7"}]'.
Use debugger evidence to answer concrete runtime questions when static code reading is not enough, or to confirm ideas or results from static analysis — including whether execution reaches or does not reach an agent-selected code location via a breakpoint or tracepoint.
Use this skill when at least one of the following is true:
If the user manually activates or refers to this skill, treat that as an explicit request to launch and use the debugger when the required tools are available; do not reduce it to a conceptual discussion.
Skip the debugger when any of these holds (use static analysis or log inspection):
If the codebase domain contains debug-related concepts, reason explicitly about whether the user is talking about their code or actually asking you to launch the debugger. Do not treat identifiers, features, flags, or log categories named debug/Debugger — including System.Diagnostics.Debug or a Debug build configuration — as a debugger request by default.
Use this skill only when the debugger MCP tools are available in the current session. Minimum required set:
xdebug_set_breakpointsxdebug_start_debugger_sessionxdebug_control_sessionxdebug_get_stackxdebug_get_frame_values, xdebug_get_value_by_path, or xdebug_evaluate_expressionget_run_configurationsIf this minimum set is not available: state the blocker explicitly, do not force a debugger workflow, and switch to the best fallback. All tools are documented in reference/tools.md.
Start with minimal static triage (error text, stack trace, nearby source). Start debugger work when one of these is true: static analysis leaves multiple plausible runtime hypotheses; deciding between them requires concrete runtime values or exact control flow; stepping through the code is cheaper than reading a large cross-file path; or the user explicitly requested debugger actions.
Before starting a new run, assess whether a current relevant session can be reused. Set the first breakpoint early and collect concrete evidence before making runtime-behavior changes.
Before code edits for runtime-behavior issues (when debugger evidence is available), collect at minimum:
xdebug_get_stack;xdebug_get_frame_values, xdebug_get_value_by_path, or xdebug_evaluate_expression.Do not assert runtime conclusions before this evidence is captured unless you have already stated a clear blocker.
AUTO: the agent can run and rerun the scenario directly (run config, test, executable, endpoint). Use xdebug_start_debugger_session to launch with debugging, or execute_run_configuration for a non-debug run when you only need output or exit code.ASSISTED: reproduction requires a user-only action (UI flow, auth, external dependency, hardware interaction).HYBRID: try AUTO once or twice, then switch to ASSISTED if the failure does not reproduce.ATTACH: the target process is already running (started outside the IDE, long-lived host, game editor, service) and must not be restarted. Use xdebug_attach_to_process --pid <pid>; set the required breakpoints before attaching when the target may finish quickly. If the result is selection_required, promptly repeat with the same PID and one exact returned availableDebuggers name as --debuggerKind; on attached, take sessionId from the result. See reference/tools/xdebug_attach_to_process.md.If the candidate target is a test, default to AUTO. Never ask the user to reproduce before breakpoints are prepared.
Do not modify the user's project setup (NuGet packages, target framework, .csproj/.sln, run configurations, environment, credentials, services) without explicit approval. If a setup change is needed, state it as a blocker and wait for the user; treat a one-shot instruction as approval scoped to that action only.
--filePath + --line at the test definition (the [Fact] / [Test] / [TestMethod] method or case); the IDE resolves the framework (xUnit, NUnit, MSTest). For an existing test run configuration, use --configurationName. To run a test without debugging (for example, to confirm it fails before setting breakpoints), use execute_run_configuration with the same targeting.execute_tool(command="xdebug_get_debugger_status") and continue in the relevant session."", "/", "__omit__", ".", or fake paths.execute_tool(command="xdebug_get_debugger_status").sessionId and reuse it in all session-scoped calls.sessionId. Use xdebug_get_debugger_status --sessionId <id> after the session stops to read its retained state.SESSION_NOT_ACTIVE for a retained stopped session. SESSION_EXPIRED means that its diagnostics left the five-session retention window.frameIndex or path; re-read from the fresh xdebug_get_stack.configurationName from get_run_configurations; its supportsDynamicLaunchOverrides gates --programArguments / --workingDirectory / --envs (see reference/tools/get_run_configurations.md).dotnet invocations yourself or push a test filter through --programArguments when the config does not support overrides; trust the run configuration, and use launch overrides only when they materially improve reproducibility or observability.execute_tool(command="xdebug_list_breakpoints") and treat the returned owner (user / agent) as source of truth.breakpointId -> enabled) before modifying anything.owner=user breakpoints not required for the current path with xdebug_set_breakpoints ID-mode items; restore them only once, at the end of the debugger cycle.xdebug_remove_breakpoints --breakpoints item defaults to owner=agent. For global cleanup, use [{"owner":"agent"},{"owner":"user"}].Each xdebug_set_breakpoints item has two mutually exclusive targeting modes (location vs breakpointId) — never mix them in one item, and in breakpointId mode pass the full desired state. Results preserve input order and report per-item success/error; confirm every successful result's lineText. Full contract: reference/tools/xdebug_set_breakpoints.md.
When a session keeps suspending on an expected or handled exception that is not the one under investigation (a first-chance System.OperationCanceledException, for example), mute that single type with execute_tool(command="xdebug_ignore_exception --exceptionType System.OperationCanceledException"), then RESUME. This sets the exception breakpoint's suspend policy to NONE and is persistent — it survives the session, exactly like unchecking the exception in the UI — so use it only for the type that is genuinely in the way, and never as a blanket way to silence exception stops. Prefer it over globally muting breakpoints, which would also drop the breakpoints you are relying on.
Breakpoints can be set in library and framework code. read_file reads external source files and the bundled decompiler output for assemblies (and SourceLink / PDB-resolved originals when available). To obtain a path:
xdebug_get_stack returns file paths, including paths into external assemblies — use the path exactly as returned;search_symbol(q="TypeName", include_external=true) returns external / library symbol paths.Always read_file(file_path=<path>) to find the exact line before setting a breakpoint in external code; never guess line numbers. Do not edit sources to insert Console.WriteLine; use a tracepoint instead.
Before the first run, explicitly choose the narrowest reproducible entry point (single test, focused run config, endpoint handler, command handler) and the first breakpoint at the earliest executable line where uncertainty becomes observable (branch decision, mapping boundary, state transition, dynamic dispatch, exception construction). If unsure, place at most 2 coarse breakpoints — one at the entry boundary, one at the suspected failure boundary — run once, then narrow.
Copy this checklist and tick items as you advance:
Debugger Run Progress:
- [ ] Scope the failure: exact error text, expected vs actual, 2-5 candidate anchors in the runtime path
- [ ] `xdebug_get_debugger_status` → reuse an active relevant session OR plan a new one
- [ ] Pick reproduction mode (AUTO / ASSISTED / HYBRID)
- [ ] Snapshot the breakpoint baseline; disable irrelevant user breakpoints
- [ ] Set initial breakpoints; verify `lineText` for each
- [ ] `xdebug_start_debugger_session ...` OR continue inside the existing session
- [ ] Wait for an expected pause after a fresh start; after RESUME, inspect its returned state
- [ ] At each pause: `xdebug_get_stack` + values / eval (`xdebug_get_frame_values`, `xdebug_get_value_by_path`, `xdebug_evaluate_expression`)
- [ ] Decide next movement (`STEP_OVER` / `STEP_INTO` when evidence is nearby, OR a new breakpoint then `RESUME`)
- [ ] For tracepoints: `xdebug_control_session --action DRAIN_EVENTS`, then read the program's own output with `xdebug_get_process_output`
- [ ] Stop on the first proven incorrect state transition or a stated blocker
- [ ] Wrap-up (cleanup + report)
Discipline applied at every step:
--action RESUME --timeout 0 to finish an inspection or let tracepoints run.--action RESUME and inspect its returned state.WAIT_FOR_PAUSE only if the session is still running and that expected stop remains relevant.PAUSE, re-check enabled breakpoints and the expected path; after 2 consecutive timeouts, stop retrying that wait and expand breakpoint coverage.read_file it and set deeper breakpoints there; don't skip it.breakpointErrorsTail / tracepointOutputsTail (xdebug_control_session; see its reference) are populated only by JVM-based debuggers. Rider's debugger is not JVM-based, so do not rely on them: preflight a condition expression with xdebug_evaluate_expression in a paused frame, and read tracepoint logging from the program's own output via execute_tool(command="xdebug_get_process_output --sessionId <id>").xdebug_set_breakpoints item with isLogMessage=true or isLogStack=true and suspendPolicy=NONE.xdebug_evaluate_expression and xdebug_set_variable take a raw expression in the current frame's language (C#, C++, F#, or VB) — see their reference files for the exact input rules. Beyond that contract:
condition field and --expression, prefer fully-qualified names to avoid Unresolved reference caused by missing imports in the debugger expression context.execute_tool(command=...) line with ParametersListUtil. When the expression contains double quotes, wrap the outer command string in single quotes; when it contains single quotes, wrap the outer in double quotes; avoid mixing both without escaping.condition expression with xdebug_evaluate_expression before relying on it.When stopped in a frame, inspect upper frames to reconstruct data provenance: identify who passed the current values and the earliest caller frame where state became incorrect. If the required location is already passed: restart the run with an earlier breakpoint (AUTO), or set an earlier breakpoint and ask the user to reproduce again (ASSISTED). Do not continue from a point already too late for the needed evidence. When a frame points to external / decompiled code, read it with read_file and set breakpoints there if needed to trace provenance deeper.
Use xdebug_get_async_tasks when an await never completes, a .Wait()/.Result call hangs, or the thread stack does not show who called the paused code because the chain crosses an await.
It needs a paused .NET session (.NET or .NET Framework); Mono and Unity are unsupported. Read the graph reference before calling it, and the stack reference before expanding a node.
execute_tool(command="xdebug_get_async_tasks --sessionId <id>") with the captured session ID. The result is paged; totalCount is the full node count. The first page holds deadlocked, blocked, and active nodes first, so start there and fetch the next page with --offset only when a waitsForNodeIds entry is missing.Task plus the threads blocked in a synchronous wait on a task. Running threads and completed tasks are not nodes.initialLocation (the entry method) and currentLocation (the current await or wait point), like the columns of the Rider Tasks view. Most questions are answered by these two. frameCount tells how long the full chain is.thread, blocked, or deadlocked nodes. Follow waitsForNodeIds until you reach an awaiting or scheduled task with an empty list. Its currentLocation is the stuck operation.waitsForNodeIds for its id. Keep a visited set; a cycle is a deadlock.execute_tool(command="xdebug_get_async_task_stack --sessionId <id> --nodeId <id>") only when the two locations are not enough: to find the caller of a shared helper, or to read every await on the path. Frames go from the entry method (index 0) to the current wait point; they are method chains, not evaluation frames. Each frame carries presentation and, when symbols exist, file and line; use them to read the code or to place a breakpoint.thread node blocked on an awaiting task is a sync-over-async candidate: check whether the awaited continuation needs that same thread (UI or classic ASP.NET context). The graph does not model synchronization contexts.scheduled leaf either has not started or waits on something the graph does not model: a timer (Task.Delay), I/O, or a TaskCompletionSource that nobody completes. It has no currentLocation; use initialLocation to find the producer in code and set a breakpoint there.deadlocked means a thread-level lock/Monitor cycle, not an async wait cycle. Inspect the involved threads with xdebug_get_stack.threadId is present for thread nodes and for task nodes that run on a thread right now. To read values, locate that thread in xdebug_get_threads (threadId matches the @<id> suffix of the thread name) and use a fresh xdebug_get_stack.id values stay valid within one pause; both tools share them. Do not reuse them after RESUME, STEP_*, or xdebug_run_to_line. taskId is the runtime Task.Id and stays stable across pauses while the task lives.Before concluding, capture: the exact failing message/body; exception type and/or status code; the first location where state diverges from expected; concrete offending keys/values (and counts when relevant); the origin/provenance of wrong data; why the pipeline allowed it.
After debugging:
execute_tool(command="xdebug_remove_breakpoints --breakpoints '[{\"owner\":\"agent\"}]'"), restore disabled user breakpoints to their baseline, and execute_tool(command="xdebug_control_session --action STOP") if the session is no longer needed.See reference/tools.md for the signatures and parameter-by-parameter notes of the Rider debugger tools and get_run_configurations / execute_run_configuration.
metadata.json (opens in a new tab)reference/tools.md (opens in a new tab)reference/tools/execute_run_configuration.md (opens in a new tab)reference/tools/get_run_configurations.md (opens in a new tab)reference/tools/xdebug_attach_to_process.md (opens in a new tab)reference/tools/xdebug_control_session.md (opens in a new tab)reference/tools/xdebug_evaluate_expression.md (opens in a new tab)reference/tools/xdebug_get_async_task_stack.md (opens in a new tab)reference/tools/xdebug_get_async_tasks.md (opens in a new tab)reference/tools/xdebug_get_debugger_status.md (opens in a new tab)reference/tools/xdebug_get_frame_values.md (opens in a new tab)reference/tools/xdebug_get_process_output.md (opens in a new tab)reference/tools/xdebug_get_stack.md (opens in a new tab)reference/tools/xdebug_get_threads.md (opens in a new tab)reference/tools/xdebug_get_value_by_path.md (opens in a new tab)reference/tools/xdebug_ignore_exception.md (opens in a new tab)reference/tools/xdebug_list_breakpoints.md (opens in a new tab)reference/tools/xdebug_remove_breakpoints.md (opens in a new tab)reference/tools/xdebug_run_to_line.md (opens in a new tab)reference/tools/xdebug_set_breakpoints.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
debugger, rider, breakpoints, runtime-analysis, dotnet-debugging
npx claudepluginhub jetbrains/rider-skills --plugin rider-skills6 skills in this plugin
/finding-testsLocates existing tests for a given C# class and method using the test coverage data supplied by IDE. Triggers ONLY for C# production code (`.cs` files in a Rider .NET solution) when generating new tests, adding test coverage, finding existing tests, or when the user mentions uncovered lines, test files, or test suites. Must be used before writing or editing C# test code when finding already existing tests is necessary. Do NOT invoke for non-C# languages — the underlying tool only understands C# symbols and will not return useful results./refactoring-codeUse for any refactoring in a solution open in Rider (.NET/C#, F#, VB, C++, Unity, Unreal Engine, XAML, Razor, GameDev and mixed-language projects) — rename a type, member or namespace (including fixing a typo in one), rename a property together with related parameters, change a method signature, move a type to another namespace, delete unused or obsolete types and members (dead-code cleanup, even whole files), extract an interface, base class or method, or reorganize namespaces. Use it even when the change looks like a one-file edit: the IDE tool applies it, and every reference, in one call. Read this SKILL.md in a command of its own (nothing chained after it) before the first `execute_tool` call: it holds the command syntax. Do not use for file-only moves, config keys, string literals, comment text, generated output, or logic changes with unchanged names/signatures./ue-code-authoringUse when writing or modifying Unreal Engine C++ — classes, actors, components, subsystems, interfaces, ability-system (GAS) code, module dependencies, reflected UPROPERTY/UFUNCTION API, native gameplay tags, and testable gameplay behavior — in a project open in JetBrains Rider. Source changes go through Read/Grep/Glob/Edit/Write; Rider supplies symbol search, code analysis, formatting, and builds through its MCP execute_tool. Do not use for Blueprint-only tasks or editor automation with no C++ authoring./ue-live-debuggingUse when debugging UE C++ crashes, runtime bugs, or unexpected behavior with Rider MCP available. Value over bash/grep: analyze_calls traces C++ call hierarchies (ReSharper backend); get_file_problems surfaces IDE-detected issues; get_symbol_info confirms API contracts; xdebug_set_breakpoints sets live breakpoints; ue_execute_python queries live PIE state. DO NOT TRIGGER for: pure build errors with no runtime component, net-new feature work, Blueprint-only work. When Rider MCP is unavailable, runs in reduced mode — Bash/Grep only, IDE diagnostics skipped./ue-test-authoringUse when writing or modifying Unreal Engine automated tests — Automation (IMPLEMENT_SIMPLE_AUTOMATION_TEST, DEFINE_SPEC), CQTest, Functional, Gauntlet, LowLevel/Catch2 — along with test modules and the Build.cs dependencies they need, in a project open in JetBrains Rider. Test source goes through Read/Grep/Glob/Edit/Write; Rider supplies symbol lookup for the API under test, registration and include diagnostics, formatting, and builds through its MCP tools. Do not use for Blueprint-only testing, or for diagnosing an existing test failure that needs no test code change.Other plugins' skills for the same job