rr-debug-race

rr-debug-race is a skill for Claude Code from karellen/karellen-rr-mcp. It costs 36 tokens per session (852 once invoked), scanned A, original, Apache-2.0.

A procedure for investigating data races and other concurrency bugs with rr. A data race occurs when threads access shared data at the same time in an unsafe order.

In plain words
What is it for?
Use it to record a failing program, inspect its threads, replay the same execution, and use reverse debugging and watchpoints to find the cause of a race or deadlock.
Why use it?
Concurrency bugs can disappear when you try to reproduce them again. rr records the thread order and replays it deterministically, so you can trace a corrupted value to the write that caused it.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the karellen-rr-mcp plugin — 4 skills, 1 agent, 3 hooks, 1 MCP server shipped together

Good fit Use it to record a failing program, inspect its threads, replay the same execution, and use reverse debugging and watchpoints to find the cause of a race or deadlock.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/karellen/karellen-rr-mcp/rr-debug-race
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add karellen/karellen-rr-mcp --skill rr-debug-race
Clone the repo
git clone --depth 1 https://github.com/karellen/karellen-rr-mcp

Made for: Claude Code.

Or install karellen-rr-mcp, the plugin that ships this one along with the rest of its 4 skills, 1 agent, 3 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rr-debug-race

README.md
[![agentmods](https://agentmods.dev/badge/skills/karellen/karellen-rr-mcp/rr-debug-race/github.svg)](https://agentmods.dev/skills/karellen/karellen-rr-mcp/rr-debug-race)
Your own site
<a href="https://agentmods.dev/skills/karellen/karellen-rr-mcp/rr-debug-race"><img src="https://agentmods.dev/badge/skills/karellen/karellen-rr-mcp/rr-debug-race/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rr-debug-race

Your own site · 80×15
<a href="https://agentmods.dev/skills/karellen/karellen-rr-mcp/rr-debug-race"><img src="https://agentmods.dev/badge/skills/karellen/karellen-rr-mcp/rr-debug-race.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 852 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.00852
Opus 5 $0.00018 $0.00426
Sonnet 5 $0.00007 $0.00170
Haiku 4.5 $0.00004 $0.00085

Measured 12d ago against content hash 68672d37c1f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

rr-debug-race scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rr-debug-race/SKILL.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Debug Data Race with rr

Use this skill when you suspect a data race, deadlock, or concurrency bug. rr records the exact thread interleaving that occurred, then replays it deterministically so you can inspect every thread's state at every point.

Why rr for Concurrency Bugs

  • Races are non-deterministic — they may not reproduce on re-run. rr captures the exact interleaving and replays it identically every time.
  • You can inspect all threads at any point in the execution.
  • Watchpoints + reverse execution let you trace a corrupted value back to the exact write from the racing thread.

Workflow

1. Record the Failure

Run the program under rr. If the race is intermittent, you may need multiple attempts:

rr_record(command=$ARGUMENTS, trace_dir="<project>/rr-trace-<random>")

For sanitizer-detected races, enable ThreadSanitizer to make the race more visible:

rr_record(command=["./program"], env={"TSAN_OPTIONS": "halt_on_error=1"}, trace_dir=...)

2. Start Replay

rr_ps(trace_dir="<trace>")
rr_replay_start(trace_dir="<trace>", pid=<pid>)

3. Survey the Threads

Before diving in, understand the thread landscape:

rr_continue()

At the crash or end point:

rr_thread_list()

Note which threads exist and their states. Switch between threads to see what each was doing:

rr_thread_select(<tid>)
rr_backtrace()
rr_locals()

4. Find the Contested Data

Identify the shared variable or memory that is being raced on. This might be obvious from the crash (e.g., corrupted pointer) or from sanitizer output.

Set a watchpoint on the contested data:

rr_watchpoint_set("shared_variable")

Or on a memory address:

rr_watchpoint_set("*(int*)0x7fff5678")

5. Trace All Accesses

Use continue (forward and reverse) to find every access to the contested data:

rr_continue()          # Find the next write
rr_backtrace()         # Who wrote it?
rr_thread_list()       # Which thread?

Save checkpoints at each access point:

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 139 lines · 36 tokens per session scan A 68672d37c1f9

Subscribe to this mod's changes

rr-debug-race is a skill published in the GitHub repository karellen/karellen-rr-mcp (3 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 36 tokens to every session and 852 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

x64dbg-mcp-server

You are controlling x64dbg through MCP tools.

duty1g/x64dbg-mcp-server · 0 tokens

agentsight-bugfix

A five-stage workflow for fixing bugs in AgentSight: understand the report, reproduce the problem, find its cause, make a small code change, and verify the result. AgentSight is a system that observes and analyses agent activity.

alibaba/anolisa · 67 tokens

debug-live

Guides root-cause investigations with debugging capabilities by setting breakpoints, starting a debug session, stepping through execution, inspecting variables, and tracing symptoms back to their origin. Prefer it for runtime bugs, failing tests, exceptions, crashes, hangs, wrong/null values, and unexpected output…

microsoft/DebugMCP · 84 tokens

use-siteation-debugbar

Inspect Magento requests through SiteationDebugBar's MCP server. Use when asked why a page is slow, what a request did, which queries or observers ran, or to explain an error on a Magento store running this module.

Siteation/magento2-debugbar · 51 tokens

gearsystem-debugging

Debug and trace Sega Master System, Game Gear, and SG-1000 games using the Gearsystem emulator MCP server. Provides workflows for Z80 CPU debugging, breakpoint management, VDP/PSG/YM2413 hardware inspection, disassembly analysis, execution tracing, and rewind/time-travel debugging. Use when the user wants to debug an…

drhelius/Gearsystem · 178 tokens

art-of-debugging

Systematic methodology and concrete tool recipes for debugging Unix, Python, and PyTorch programs - crashes, hangs, segfaults, wrong output, CUDA OOM, NaN/Inf, slowness, and multi-node/multi-GPU issues. Use when a program crashes, hangs, deadlocks, segfaults, runs out of memory (OOM), produces NaN/Inf or wrong…

stas00/the-art-of-debugging · 193 tokens