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.
npx claudepluginhub karellen/claude-plugins --plugin karellen-rr-mcpThis skill uses the workspace's default tool permissions.
Use this skill when a test fails (crash, assertion, wrong result) and you need to find
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Builds scalable data pipelines, modern data warehouses, and real-time streaming architectures using Spark, dbt, Airflow, Kafka, and cloud platforms like Snowflake, BigQuery.
Builds production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. For data pipelines, workflow orchestration, and batch job scheduling.
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.