Agent skill

Replay Oriented Instrumentation

by ArabelaTso in ArabelaTso/Skills-4-SE

Instruments programs to record execution information for deterministic replay debugging.

Apache-2.0Auto-check passedDevelopment

Install Replay Oriented Instrumentation

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill replay-oriented-instrumentation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE replay-oriented-instrumentation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/replay-oriented-instrumentation .claude/skills/replay-oriented-instrumentation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
replay-oriented-instrumentation
GitHub stars
253
Token cost
~2.5k tokens
SKILL.md length
594 words
Files
4 (incl. references)
Skills in repo
170
Repo updated
First seen
Licence
Apache-2.0

At a glance

Instruments programs to record execution information for deterministic replay debugging.

  • Works in 6 steps: Identify Non-Determinism Sources → Choose Recording Granularity → Implement Recording Infrastructure → …
  • Debugging hard-to-reproduce bugs (race conditions
  • SKILL.md covers Core Concept, Workflow, Quick Start by Language and Common Scenarios, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Replay Oriented Instrumentation is an agent skill from ArabelaTso/Skills-4-SE. Instruments programs to record execution information for deterministic replay debugging. Use when debugging hard-to-reproduce bugs (race conditions, timing issues, intermittent failures, heisenbugs), reproducing production failures, or analyzing complex execution sequences. Records non-deterministic events (I/O, threading, randomness, time) to enable exact replay of program executions. Supports Python, JavaScript, Java, and C/C++ with both custom instrumentation and existing replay tools.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/non-determinism.md`, `references/python-replay.md` and `references/replay-tools.md`).

It sits in Development, covering Async programming, Debugging and Failing and flaky tests. It works with C++, Java, JavaScript and Python. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Debugging hard-to-reproduce bugs (race conditions
  • Intermittent failures
  • Reproducing production failures
  • Analyzing complex execution sequences

Example prompts

  • “Use the replay-oriented-instrumentation skill to instrument programs to record execution information for deterministic replay debugging”
  • “/replay-oriented-instrumentation”

Requirements

  • Python 3
  • Node.js

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Identify Non-Determinism Sources
  2. Choose Recording Granularity
  3. Implement Recording Infrastructure
  4. Record Execution
  5. Replay Execution
  6. Debug with Replay

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python, bash, javascript, java and c).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Replay Oriented Instrumentation loads about 2.5k tokens when it runs, and up to ~6.4k if it reads all its reference files. Until then it costs about 131 tokens; SKILL.md has 594 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~131
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 594 words, ~2,450 tokens.

Download SKILL.mdSave it as .claude/skills/replay-oriented-instrumentation/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
replay-oriented-instrumentation
description
Instruments programs to record execution information for deterministic replay debugging. Use when debugging hard-to-reproduce bugs (race conditions, timing issues, intermittent failures, heisenbugs), reproducing production failures, or analyzing complex execution sequences. Records non-deterministic events (I/O, threading, randomness, time) to enable exact replay of program executions. Supports Python, JavaScript, Java, and C/C++ with both custom instrumentation and existing replay tools.

Replay-Oriented Instrumentation

Instrument programs to capture execution information that enables deterministic replay, making it possible to reproduce and debug failures that are difficult to reproduce normally.

Core Concept

Deterministic replay works by:

  1. Recording: Capture all non-deterministic inputs during execution
  2. Replaying: Re-execute the program using recorded inputs to reproduce exact behavior
  3. Debugging: Use replay to analyze failures with time-travel debugging

Workflow

1. Identify Non-Determinism Sources

Analyze the program to find sources of non-determinism. See references/non-determinism.md for comprehensive coverage.

Common sources:

  • I/O operations: File reads, network requests, user input
  • Time: System clock, timestamps, timeouts
  • Randomness: Random number generation, hash functions
  • Threading: Thread scheduling, race conditions, lock ordering
  • System state: Process IDs, memory addresses, environment variables
2. Choose Recording Granularity

Select appropriate recording level based on needs:

Function-level (recommended starting point):

  • Record function calls and return values
  • Low overhead
  • Good for most debugging scenarios
  • Example: Record all I/O function calls

Event-based (balanced approach):

  • Record specific non-deterministic events
  • Moderate overhead
  • Captures essential non-determinism
  • Example: Record syscalls, thread events, random values

Instruction-level (comprehensive):

  • Record every instruction execution
  • High overhead, large logs
  • Complete determinism
  • Use only when necessary
3. Implement Recording Infrastructure

Choose between custom instrumentation or existing tools:

Custom instrumentation (flexible):

  • Wrap non-deterministic functions
  • Log inputs and outputs
  • Control what gets recorded
  • See language-specific guides below

Existing tools (easier):

4. Record Execution

Run the program in recording mode:

  • Execute the failing scenario
  • Capture all non-deterministic events
  • Save recording log
  • Verify recording completed successfully
5. Replay Execution

Reproduce the execution from the log:

  • Load recorded events
  • Replace non-deterministic operations with logged values
  • Verify replay matches original execution
  • Use debugger during replay for analysis
6. Debug with Replay

Leverage replay for debugging:

  • Set breakpoints without affecting timing
  • Use time-travel debugging (reverse execution)
  • Inspect state at any point in execution
  • Reproduce failure consistently

Quick Start by Language

Python

For custom instrumentation, see references/python-replay.md.

Basic example:

python
import json
import time
import random

class ReplayRecorder:
    def __init__(self, mode='record'):
        self.mode = mode
        self.log = []
        self.index = 0

    def record_call(self, func_name, result):
        if self.mode == 'record':
            self.log.append({'func': func_name, 'result': result})
        else:
            entry = self.log[self.index]
            self.index += 1
            return entry['result']

recorder = ReplayRecorder(mode='record')

def get_time():
    if recorder.mode == 'record':
        result = time.time()
        recorder.record_call('time', result)
        return result
    else:
        return recorder.record_call('time', None)

# Record mode
result = get_time()
with open('replay.log', 'w') as f:
    json.dump(recorder.log, f)

# Replay mode
recorder = ReplayRecorder(mode='replay')
with open('replay.log', 'r') as f:
    recorder.log = json.load(f)
result = get_time()  # Returns same value

Using RR (system-level):

bash
rr record python script.py
rr replay
JavaScript/Node.js

Recording HTTP requests with Nock:

javascript
const nock = require('nock');

// Record mode
nock.recorder.rec();
// ... make requests ...
const fixtures = nock.recorder.play();

// Replay mode
nock('http://api.example.com')
  .get('/data')
  .reply(200, { data: 'recorded response' });
Java

Using AspectJ for recording:

java
@Aspect
public class ReplayAspect {
    private List<Event> events = new ArrayList<>();

    @Around("execution(* java.io..*(..))")
    public Object recordIO(ProceedingJoinPoint pjp) throws Throwable {
        Object result = pjp.proceed();
        events.add(new Event(pjp.getSignature(), pjp.getArgs(), result));
        return result;
    }
}
C/C++

Using RR (recommended):

bash
# Record
rr record ./program arg1 arg2

# Replay with GDB
rr replay -d gdb

# In GDB, use reverse execution
(gdb) reverse-continue
(gdb) reverse-step

Custom instrumentation with macros:

c
#define RECORD_CALL(func, ...) \
    ({ \
        auto result = func(__VA_ARGS__); \
        log_event(#func, result); \
        result; \
    })

// Usage
int fd = RECORD_CALL(open, "file.txt", O_RDONLY);

Common Scenarios

Show full SKILL.md (248 more words)Show less
Scenario 1: Race Condition Debugging

Problem: Test fails intermittently due to race condition

Solution:

  1. Record thread scheduling events
  2. Capture lock acquisition order
  3. Replay with same thread interleaving
  4. Use debugger to inspect race condition

Implementation:

python
import threading

class ThreadRecorder:
    def __init__(self):
        self.events = []

    def record_lock(self, lock_id, acquired):
        self.events.append({
            'type': 'lock',
            'lock_id': lock_id,
            'acquired': acquired,
            'thread': threading.current_thread().ident
        })

recorder = ThreadRecorder()

class RecordingLock:
    def __init__(self, lock_id):
        self.lock = threading.Lock()
        self.lock_id = lock_id

    def acquire(self):
        result = self.lock.acquire()
        recorder.record_lock(self.lock_id, True)
        return result

    def release(self):
        recorder.record_lock(self.lock_id, False)
        self.lock.release()
Scenario 2: Network Request Failure

Problem: API call fails in production, can't reproduce locally

Solution:

  1. Record network requests and responses
  2. Replay with recorded responses
  3. Debug with exact production data

Implementation (JavaScript):

javascript
const nock = require('nock');
const fs = require('fs');

// Record mode (run in production)
nock.recorder.rec({ output_objects: true });
// ... application runs ...
const recordings = nock.recorder.play();
fs.writeFileSync('recordings.json', JSON.stringify(recordings));

// Replay mode (run locally)
const recordings = JSON.parse(fs.readFileSync('recordings.json'));
nock.define(recordings);
// ... application runs with recorded responses ...
Scenario 3: Time-Dependent Bug

Problem: Bug only occurs at specific times or after certain duration

Solution:

  1. Record all time-related calls
  2. Replay with recorded timestamps
  3. Debug without waiting for real time

Implementation:

python
import time

class TimeRecorder:
    def __init__(self, mode='record'):
        self.mode = mode
        self.times = []
        self.index = 0

    def time(self):
        if self.mode == 'record':
            t = time.time()
            self.times.append(t)
            return t
        else:
            t = self.times[self.index]
            self.index += 1
            return t

recorder = TimeRecorder(mode='record')
time.time = recorder.time

Recording Strategies

Minimize Overhead
  • Record only non-deterministic operations
  • Use binary log formats
  • Buffer log writes
  • Compress logs
  • Sample when appropriate
Ensure Completeness
  • Identify all non-determinism sources
  • Test replay matches recording
  • Verify edge cases
  • Handle errors during recording
Optimize Log Size
  • Use efficient encoding
  • Deduplicate repeated values
  • Compress similar events
  • Prune unnecessary data

Replay Verification

Always verify replay matches recording:

python
def verify_replay(original_output, replay_output):
    if original_output != replay_output:
        print("REPLAY MISMATCH!")
        print(f"Original: {original_output}")
        print(f"Replay: {replay_output}")
        return False
    return True

References

Tips

  • Start simple: Begin with function-level recording
  • Test replay early: Verify replay works before extensive recording
  • Use existing tools: Leverage RR, Nock, etc. when possible
  • Record minimally: Only capture what's needed for replay
  • Version logs: Include version info for compatibility
  • Document sources: Know what non-determinism exists in your code
  • Automate verification: Check replay matches recording automatically

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/replay-oriented-instrumentation of ArabelaTso/Skills-4-SE.

  • SKILL.md
  • references/non-determinism.md
  • references/python-replay.md
  • references/replay-tools.md

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Replay Oriented Instrumentation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Replay Oriented Instrumentation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Replay Oriented Instrumentation this skillArabelaTso/Skills-4-SE253—~2.5kAutomated safety check: PassApache-2.0
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT
Fory Performance Optimizationapache/fory4.6k—~2.2kAutomated safety check: PassApache-2.0
MCP Debuggerdebugmcp/mcp-debugger173—~4.1kAutomated safety check: PassMIT
SlintMoosync/Moosync259—~2.4kAutomated safety check: PassGPL-3.0
Code Audit3stoneBrother/code-audit8921 repos~2.7kAutomated safety check: PassNone

Similar skills

  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Run profile-driven bottleneck optimization across Apache Fory implementations (Java, C++, Python/Cython, Go, Rust, Swift, C, JavaScript/TypeScript, Dart, Kotlin, Scala).

    4.6k GitHub stars~2.2k tokensUpdated today
    MobileAuto-check passed
  • MCP Debugger

    debugmcp/mcp-debugger

    A skill your agent uses when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack…

    173 GitHub stars~4.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Slint

    Moosync/Moosync

    Expert guidance for building, debugging, and working with Slint GUI applications.

    259 GitHub stars~2.4k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Code Audit

    3stoneBrother/code-audit

    Professional code security audit skill covering 55+ vulnerability types.

    892 GitHub starsUsed in 1 repo~2.7k tokens
    SecurityAuto-check passed
  • CodeQL Security Scan

    trailofbits/skills

    Official

    Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.

    7.5k GitHub stars~4.6k tokensUpdated today
    SecurityAuto-check: notes

More from ArabelaTso/Skills-4-SE

All 170 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Replay Oriented Instrumentation

What does Replay Oriented Instrumentation do?

Instruments programs to record execution information for deterministic replay debugging. Replay Oriented Instrumentation is an agent skill from ArabelaTso/Skills-4-SE. Instruments programs to record execution information for deterministic replay debugging.

When should I use Replay Oriented Instrumentation?

Replay Oriented Instrumentation fits situations like: debugging hard-to-reproduce bugs (race conditions; intermittent failures; reproducing production failures; analyzing complex execution sequences.

How do I install Replay Oriented Instrumentation in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill replay-oriented-instrumentation -a claude-code`. Or copy the skill folder (skills/replay-oriented-instrumentation in ArabelaTso/Skills-4-SE) into .claude/skills/replay-oriented-instrumentation in your project. Claude Code loads it when a task matches its description.

How do I install Replay Oriented Instrumentation in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill replay-oriented-instrumentation -a codex`. Or copy the skill folder (skills/replay-oriented-instrumentation in ArabelaTso/Skills-4-SE) into .agents/skills/replay-oriented-instrumentation in your project. Codex loads it when a task matches its description.

Can I use Replay Oriented Instrumentation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill replay-oriented-instrumentation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/replay-oriented-instrumentation, .gemini/skills/replay-oriented-instrumentation, .github/skills/replay-oriented-instrumentation and .opencode/skills/replay-oriented-instrumentation in your project.

What does Replay Oriented Instrumentation need to run?

SKILL.md names no scripts, command-line tools or credentials: Replay Oriented Instrumentation is instructions for the agent only. Our summary lists: Python 3; Node.js.

Does Replay Oriented Instrumentation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Replay Oriented Instrumentation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Replay Oriented Instrumentation use?

Replay Oriented Instrumentation is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Replay Oriented Instrumentation use?

About 2.5k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4k tokens, read only when the agent opens those files.

What are the alternatives to Replay Oriented Instrumentation?

Skills that share tags, products or a category with Replay Oriented Instrumentation: Dbg (theodo-group/debug-that, 158 stars), Fory Performance Optimization (apache/fory, 4.6k stars), MCP Debugger (debugmcp/mcp-debugger, 173 stars) and Slint (Moosync/Moosync, 259 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Replay Oriented Instrumentation?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 170 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.