Agent skill

Reproduction Trace Instrumenter

by ArabelaTso in ArabelaTso/Skills-4-SE

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

Apache-2.0Auto-check passedDevelopment

Install Reproduction Trace Instrumenter

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill reproduction-trace-instrumenter -a claude-code

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

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE reproduction-trace-instrumenter --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/reproduction-trace-instrumenter .claude/skills/reproduction-trace-instrumenter && 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
reproduction-trace-instrumenter
GitHub stars
253
Token cost
~2.4k tokens
SKILL.md length
743 words
Files
5 (incl. scripts, references, assets)
Skills in repo
170
Repo updated
First seen
Licence
Apache-2.0

At a glance

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

  • Works in 5 steps: Identify the Bug Context → Instrument the Code → Run the Instrumented Code → …
  • You need to reproduce a bug
  • SKILL.md covers Overview, Workflow, Configuration and Instrumentation Levels, plus 6 more sections
  • Runs Python scripts from its folder; calls python

What it does

Reproduction Trace Instrumenter is an agent skill from ArabelaTso/Skills-4-SE. Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures. Use this skill when you need to reproduce a bug, capture execution traces for debugging, instrument code to record program behavior, generate replay scripts for bug reproduction, diagnose hard-to-reproduce failures, or perform deterministic replay of program execution. Triggers when users ask to instrument code for tracing, capture execution traces, reproduce bugs…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts, reference files and assets (for example `assets/trace_config_template.json`, `references/instrumentation_techniques.md` and `scripts/python_instrumenter.py`).

It sits in Development, covering Debugging. 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

  • You need to reproduce a bug
  • Capture execution traces for debugging
  • Instrument code to record program behavior
  • Generate replay scripts for bug reproduction

Example prompts

  • “Use the reproduction-trace-instrumenter skill to instrument programs to capture execution traces specifically for reproducing reported bugs…”
  • “/reproduction-trace-instrumenter”

Requirements

  • Python 3

Workflow steps

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

  1. Identify the Bug Context
  2. Instrument the Code
  3. Run the Instrumented Code
  4. Analyze the Trace
  5. Generate Replay Script

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

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    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

Reproduction Trace Instrumenter loads about 2.4k tokens when it runs, and up to ~4.1k if it reads all its reference files. Until then it costs about 152 tokens; SKILL.md has 743 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

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

Download SKILL.mdSave it as .claude/skills/reproduction-trace-instrumenter/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
reproduction-trace-instrumenter
description
Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures. Use this skill when you need to reproduce a bug, capture execution traces for debugging, instrument code to record program behavior, generate replay scripts for bug reproduction, diagnose hard-to-reproduce failures, or perform deterministic replay of program execution. Triggers when users ask to instrument code for tracing, capture execution traces, reproduce bugs, generate replay scripts, or enable deterministic debugging.

Reproduction Trace Instrumenter

Overview

This skill instruments source code to capture detailed execution traces for bug reproduction. It records function calls, variable values, control flow, and program state, then generates replay scripts to deterministically reproduce the bug for diagnosis.

Workflow

1. Identify the Bug Context

Before instrumentation, understand:

  • What is the bug or failure being investigated?
  • Which code paths are likely involved?
  • What inputs trigger the bug?
  • Is the bug deterministic or intermittent?
2. Instrument the Code

Use the appropriate instrumenter for your language:

Python Instrumentation
bash
python scripts/python_instrumenter.py <source_file.py> -o <instrumented_file.py>

Options:

  • --no-functions: Disable function call tracing
  • --no-variables: Disable variable assignment tracing
  • --no-control-flow: Disable control flow tracing
  • --exclude <patterns>: Exclude functions matching patterns (e.g., __init__ test_*)

Example:

bash
# Full instrumentation
python scripts/python_instrumenter.py app.py -o app_instrumented.py

# Minimal instrumentation (functions only)
python scripts/python_instrumenter.py app.py -o app_instrumented.py --no-variables --no-control-flow

# Exclude test functions
python scripts/python_instrumenter.py app.py -o app_instrumented.py --exclude test_ __
3. Run the Instrumented Code

Execute the instrumented program with the inputs that trigger the bug:

bash
python app_instrumented.py

The execution trace will be automatically saved to trace.json when the program exits.

Trace Output:

  • trace.json: Complete execution trace with all recorded events
  • Console output: Summary of trace recording
4. Analyze the Trace

Generate a human-readable summary:

bash
python scripts/replay_generator.py trace.json --summary

This shows:

  • Total number of events
  • Event type distribution
  • Function call sequence
  • Maximum call depth
5. Generate Replay Script

Create a replay script to reproduce the bug:

bash
python scripts/replay_generator.py trace.json -o replay.py

Run the replay script:

bash
python replay.py

The replay script executes the same sequence of operations, allowing you to:

  • Reproduce the bug consistently
  • Add breakpoints at specific steps
  • Modify values to test hypotheses
  • Understand the execution flow

Configuration

Use the trace configuration template to customize instrumentation:

bash
cp assets/trace_config_template.json trace_config.json
# Edit trace_config.json as needed

Key Configuration Options:

Instrumentation Level:

  • trace_functions: Record function entry/exit
  • trace_variables: Record variable assignments
  • trace_control_flow: Record if/else, loops
  • trace_exceptions: Record exception handling

Filtering:

  • exclude_patterns: Function name patterns to skip
  • exclude_modules: Modules to skip entirely
  • max_string_length: Truncate long strings
  • max_call_depth: Limit trace depth

Performance:

  • buffer_size: Events to buffer before writing
  • async_write: Write traces asynchronously
  • max_trace_size_mb: Maximum trace file size

Instrumentation Levels

Choose the appropriate level based on your needs:

Minimal (Functions Only)
bash
python scripts/python_instrumenter.py app.py -o app_inst.py --no-variables --no-control-flow
  • Overhead: 5-15%
  • Use when: You need to understand call sequence only
  • Trace size: Small
Standard (Functions + Variables)
bash
python scripts/python_instrumenter.py app.py -o app_inst.py --no-control-flow
  • Overhead: 20-50%
  • Use when: You need to track state changes
  • Trace size: Medium
Full (Everything)
bash
python scripts/python_instrumenter.py app.py -o app_inst.py
  • Overhead: 50-200%
  • Use when: You need complete execution details
  • Trace size: Large

Common Use Cases

Use Case 1: Intermittent Bug Reproduction
User: "I have a bug that only happens sometimes. Help me capture what's happening."
→ Instrument with full tracing
→ Run multiple times until bug occurs
→ Analyze the trace from the failing run
→ Generate replay script to reproduce consistently
Use Case 2: Understanding Complex Control Flow
User: "I don't understand why this function returns the wrong value."
→ Instrument with functions + variables
→ Run with problematic input
→ Review trace to see variable values at each step
→ Identify where the logic goes wrong
Use Case 3: Debugging Production Issues
User: "Users report a crash but I can't reproduce it locally."
→ Instrument production code (minimal level for performance)
→ Deploy and wait for crash
→ Retrieve trace.json from crashed instance
→ Generate replay script to reproduce locally
Use Case 4: Regression Testing
User: "I fixed a bug. How do I ensure it doesn't come back?"
→ Capture trace of the bug before fix
→ Generate replay script
→ Use replay script as regression test
→ Run after each code change

Trace Format

Traces are stored in JSON format with the following structure:

json
{
  "traces": [
    {
      "seq": 1,
      "timestamp": "2024-01-15T10:30:45.123",
      "type": "function_entry",
      "depth": 0,
      "data": {
        "function": "calculate_total",
        "arguments": {"price": 100, "tax_rate": 0.08}
      }
    },
    {
      "seq": 2,
      "timestamp": "2024-01-15T10:30:45.125",
      "type": "variable_assignment",
      "depth": 1,
      "data": {
        "variable": "tax",
        "value": 8.0,
        "type": "float"
      }
    }
  ],
  "metadata": {
    "total_events": 2,
    "max_depth": 1
  }
}

Best Practices

  1. Start Minimal: Begin with function-level tracing, add detail as needed

  2. Focus on Bug Area: Use --exclude to skip irrelevant code paths

  3. Test Instrumentation: Verify instrumented code behaves the same as original

  4. Manage Trace Size: Use filtering to keep traces manageable

  5. Validate Replay: Ensure replay script reproduces the bug consistently

  6. Clean Up: Remove instrumentation before committing code

Show full SKILL.md (291 more words)Show less

Limitations

  1. Observer Effect: Instrumentation may change timing and behavior

    • Minimize by using lower instrumentation levels
    • Be aware of race conditions in concurrent code
  2. Performance Overhead: Instrumented code runs slower

    • Use sampling or selective instrumentation for performance-critical code
  3. Trace Size: Full traces can be very large

    • Apply filtering and size limits
    • Focus on specific code regions
  4. Non-Determinism: Some bugs involve external factors

    • Record external inputs (network, file system, time)
    • Use deterministic mode in configuration
  5. Language Support: Currently supports Python only

    • See references/instrumentation_techniques.md for other languages

Advanced Topics

Custom Instrumentation

Modify scripts/python_instrumenter.py to add custom tracing:

  • Trace specific function arguments
  • Record custom metrics
  • Add conditional breakpoints
  • Integrate with logging frameworks
Multi-Process Tracing

For programs with multiple processes:

  • Instrument each process separately
  • Use process ID in trace filenames
  • Merge traces for analysis
Distributed System Tracing

For distributed systems:

  • Add correlation IDs to trace events
  • Synchronize timestamps across nodes
  • Use distributed tracing tools (Jaeger, Zipkin)

Resources

scripts/python_instrumenter.py

AST-based Python code instrumenter that:

  • Parses Python source code
  • Inserts tracing calls at key points
  • Generates instrumented code with embedded trace runtime
  • Supports configurable instrumentation levels
scripts/replay_generator.py

Trace replay script generator that:

  • Reads execution traces from JSON
  • Generates executable Python replay scripts
  • Provides trace summaries and statistics
  • Enables deterministic bug reproduction
references/instrumentation_techniques.md

Comprehensive guide covering:

  • Instrumentation approaches (source, bytecode, dynamic)
  • What to trace and how to filter
  • Trace reduction strategies
  • Deterministic replay techniques
  • Language-specific considerations
  • Performance optimization
  • Best practices and common pitfalls

Read this reference when you need deeper understanding of instrumentation theory, want to implement instrumenters for other languages, or need to optimize trace performance.

assets/trace_config_template.json

Configuration template for customizing:

  • Instrumentation levels
  • Filtering rules
  • Performance settings
  • Replay options

Copy and modify this template to create custom trace configurations for specific use cases.

© 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 4 other files (scripts, references, assets) in skills/reproduction-trace-instrumenter of ArabelaTso/Skills-4-SE.

  • SKILL.md
  • assets/trace_config_template.json
  • references/instrumentation_techniques.md
  • scripts/python_instrumenter.py
  • scripts/replay_generator.py

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Reproduction Trace Instrumenter 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.

Reproduction Trace Instrumenter compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Reproduction Trace Instrumenter this skillArabelaTso/Skills-4-SE253—~2.4kAutomated safety check: PassApache-2.0
Trellis Session Insightmindfold-ai/Trellis15k4 repos~1.7kAutomated safety check: PassAGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Debugging Executionsn8n-io/n8n207k—~2.6kAutomated safety check: PassCustom licence
Aoti Debugpytorch/pytorch104k1 repos~1.7kAutomated safety check: PassCustom licence
Herdr Throwaway Reproductionherdrdev/herdr43k—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Trellis Session Insight

    mindfold-ai/Trellis

    Reach into past AI conversation history through the trellis mem CLI.

    15k GitHub starsUsed in 4 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Official

    Debug failed or wrong-output workflow executions using executions tools.

    207k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Aoti Debug

    pytorch/pytorch

    Debug AOTInductor (AOTI) errors and crashes. An agent skill from pytorch/pytorch.

    104k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • Runs a disposable, uniquely named Herdr session inside an existing one so runtime, pane, terminal or API bugs can be reproduced without touching the main session.

    43k GitHub stars~2.4k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Systematic Debugging

    ultralisp/ultralisp

    A skill your agent uses when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    258 GitHub starsUsed in 52 repos~2.4k tokens
    DevelopmentAuto-check passed

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
  • 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
  • Taint Instrumentation Assistant

    ArabelaTso/Skills-4-SE

    Instruments code to track the flow of untrusted or sensitive data at runtime, enabling detection of injection vulnerabilities, data leaks, and privilege violations.

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

Categories

Questions about Reproduction Trace Instrumenter

What does Reproduction Trace Instrumenter do?

Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures. Reproduction Trace Instrumenter is an agent skill from ArabelaTso/Skills-4-SE. Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

When should I use Reproduction Trace Instrumenter?

Reproduction Trace Instrumenter fits situations like: you need to reproduce a bug; capture execution traces for debugging; instrument code to record program behavior; generate replay scripts for bug reproduction.

How do I install Reproduction Trace Instrumenter in Claude Code?

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

How do I install Reproduction Trace Instrumenter in Codex?

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

Can I use Reproduction Trace Instrumenter 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 reproduction-trace-instrumenter -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/reproduction-trace-instrumenter, .gemini/skills/reproduction-trace-instrumenter, .github/skills/reproduction-trace-instrumenter and .opencode/skills/reproduction-trace-instrumenter in your project.

What does Reproduction Trace Instrumenter need to run?

Going by SKILL.md and its folder, Reproduction Trace Instrumenter needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Reproduction Trace Instrumenter 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 Reproduction Trace Instrumenter 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Reproduction Trace Instrumenter use?

Reproduction Trace Instrumenter 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 Reproduction Trace Instrumenter use?

About 2.4k tokens (SKILL.md is roughly 9.4k 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 1.7k tokens, read only when the agent opens those files.

What are the alternatives to Reproduction Trace Instrumenter?

Skills that share tags, products or a category with Reproduction Trace Instrumenter: Trellis Session Insight (mindfold-ai/Trellis, 15k stars), Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars), Debugging Executions (n8n-io/n8n, 207k stars) and Aoti Debug (pytorch/pytorch, 104k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Reproduction Trace Instrumenter?

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.