From karellen-rr-mcp
Debug a failing test using rr. Records the test suite, identifies the failing subprocess, and reverse-debugs just that process to find the root cause.
How this skill is triggered — by the user, by Claude, or both
Slash command
/karellen-rr-mcp:rr-debug-testThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when a test fails (crash, assertion, wrong result) and you need to find
Use this skill when a test fails (crash, assertion, wrong result) and you need to find the root cause. This is especially useful for test harnesses that spawn subprocesses, where the failing test runs in a child process.
Record the entire test command. rr captures all subprocesses automatically:
rr_record(command=$ARGUMENTS, trace_dir="<project>/rr-trace-<random>")
For build-system test runners:
rr_record(command=["make", "test"], trace_dir=...)
rr_record(command=["ctest", "--test-dir", "build"], trace_dir=...)
rr_record(command=["pytest", "tests/"], trace_dir=...)
Test harnesses (CTest, pytest, make, shell scripts) spawn child processes. The root process is the harness, NOT the test. You must identify the correct subprocess:
rr_ps(trace_dir="<trace>")
How to identify the right process:
rr_replay_start(trace_dir="<trace>", pid=<failing-pid>)
Always pass pid for test recordings. Without it, rr replays the harness process
which lacks test debug symbols and is not where the bug occurred.
rr_continue() — stops at signal automaticallyrr_breakpoint_set("__assert_fail") or rr_breakpoint_set("abort"),
then rr_continue()rr_breakpoint_set("testing::internal::AssertHelper") for gtest, or set a breakpoint
on the test function itselfrr_breakpoint_set("test_function_name"), then rr_continue() and
step through the test logicrr_backtrace()
rr_locals()
Work backwards from the failure:
rr_next(reverse=True) to step backwardsrr_watchpoint_set("variable") + rr_continue(reverse=True) to find where a value
was corruptedrr_select_frame(N) to inspect caller framesrr_replay_stop()
rr_rm(trace_dir="<trace>")
rr_record(command=["./test_binary", "--gtest_filter=TestSuite.FailingTest"])rr_evaluate("expr") to check test expectations at the point of failure.npx claudepluginhub karellen/claude-plugins --plugin karellen-rr-mcpGuides systematic investigation of test failures using dual-hypothesis approach (test wrong vs. implementation bug) and step-by-step protocol. Use for diagnosing test errors or establishing test failure mindset.
Diagnoses errors, test failures, and unexpected behavior by capturing error messages, isolating failure locations, and guiding root cause analysis.
Guides systematic root-cause debugging when tests fail, builds break, or unexpected errors occur. Provides a structured triage checklist to preserve evidence, localize, and fix issues instead of guessing.