rr-debug

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

A debugging workflow using rr, a Linux tool that records a program run so it can be replayed backward, together with gdb, a debugger. It is intended for crashes, test failures, and bugs whose causes are difficult to trace.

In plain words
What is it for?
Use it to record a failing command, inspect the correct process in multi-process runs, replay the failure, and trace its cause on Linux x86-64.
Why use it?
Working backward from the failure can reveal the earlier action that caused it, instead of relying only on forward logging or repeated guesses.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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 command, inspect the correct process in multi-process runs, replay the failure, and trace its cause on Linux x86-64.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/karellen/karellen-rr-mcp/rr-debug
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
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

README.md
[![agentmods](https://agentmods.dev/badge/skills/karellen/karellen-rr-mcp/rr-debug/github.svg)](https://agentmods.dev/skills/karellen/karellen-rr-mcp/rr-debug)
Your own site
<a href="https://agentmods.dev/skills/karellen/karellen-rr-mcp/rr-debug"><img src="https://agentmods.dev/badge/skills/karellen/karellen-rr-mcp/rr-debug/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/karellen/karellen-rr-mcp/rr-debug"><img src="https://agentmods.dev/badge/skills/karellen/karellen-rr-mcp/rr-debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 920 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.00031 $0.00920
Opus 5 $0.00015 $0.00460
Sonnet 5 $0.00006 $0.00184
Haiku 4.5 $0.00003 $0.00092

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

Security

Grade A, and why

rr-debug 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 10d 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/SKILL.md · 103 lines

How it starts

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

rr Reverse Debugging Workflow

Use this skill when the user wants to debug a crash, segfault, test failure, or any bug where the cause isn't obvious from reading the code.

Prerequisites

  • rr and gdb must be installed and on PATH
  • Linux x86-64 only
  • perf_event_paranoid must be <= 1: sysctl kernel.perf_event_paranoid
  • The program should be compiled with debug symbols (-g, preferably -O0 or -Og)

Workflow

1. Record the Failure

Generate a random trace directory name under the project directory to keep traces local and avoid cluttering ~/.local/share/rr/:

rr_record(command=["./failing_test"], trace_dir="<project>/rr-trace-<random>")

Pass working_directory if the command needs to run from a specific directory. Pass env for additional environment variables (e.g., {"MALLOC_CHECK_": "3"}).

2. Identify the Right Process (Multi-Process Traces)

If the recorded command spawns child processes (test harnesses, build systems, etc.), the default replay targets the root process, which is usually NOT what you want.

rr_ps(trace_dir="<trace>")

Look for the actual program binary in the command column. Use exit codes to identify the crashing process: negative codes indicate signals (-11 = SIGSEGV, -6 = SIGABRT).

3. Start Replay

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

Always pass pid for multi-process recordings.

4. Navigate to the Bug

  • For crashes/signals: rr_continue() stops automatically at the signal
  • For logic bugs: set breakpoints first with rr_breakpoint_set(), then rr_continue()
  • For assertion failures: rr_breakpoint_set("abort") or rr_breakpoint_set("__assert_fail"), then rr_continue()

5. Examine State

  • rr_backtrace() to see the call stack
  • rr_locals() to see local variables
  • rr_evaluate("expr") to evaluate expressions
  • rr_select_frame(N) to inspect caller frames without stepping
  • rr_source_lines() to see source code at the current position

Read the full file on GitHub · 103 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. 10d ago First seen · 103 lines · 31 tokens per session scan A 863230887186

Subscribe to this mod's changes

rr-debug is a skill published in the GitHub repository karellen/karellen-rr-mcp (3 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 31 tokens to every session and 920 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

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

generation-timeline

NixOS generation-aware debugging and time-travel. Correlate system state changes with application failures. Query "what changed and when.".

bolivian-peru/os-moda · 32 tokens