Agent skill

State Snapshot Instrumenter

by ArabelaTso in 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.

Apache-2.0Auto-check passedDevelopment

Install State Snapshot Instrumenter

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

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

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

At a glance

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

  • Works in 3 steps: Instrumentation → Snapshot Analysis → Runtime Control
  • You need to debug complex issues
  • SKILL.md covers Overview, Quick Start, Instrumentation Modes and Core Operations, plus 5 more sections
  • Runs Python and Java scripts from its folder; calls python, javac and java

What it does

State Snapshot Instrumenter is an agent skill from 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. Use when you need to debug complex issues, reproduce test cases, prepare traces for formal verification, or analyze program execution. Supports manual instrumentation points, automatic function/method instrumentation, and conditional triggers. Outputs structured JSON snapshots for debugging, replay, and verification workflows.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 18 other files, including scripts, reference files and assets (for example `assets/example_python.py`, `assets/snapshot_schema.json` and `references/instrumentation_guide.md`).

It sits in Development, covering Test generation and Debugging. It works with C++, Java 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

  • You need to debug complex issues
  • Reproduce test cases
  • Prepare traces for formal verification
  • Analyze program execution

Example prompts

  • “/state-snapshot-instrumenter”

Requirements

  • Python 3

Workflow steps

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

  1. Instrumentation
  2. Snapshot Analysis
  3. Runtime Control

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 8 files in scripts/ (Python and Java), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • javac
    • java

    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

State Snapshot Instrumenter loads about 2.2k tokens when it runs, and up to ~7.3k if it reads all its reference files. Until then it costs about 125 tokens; SKILL.md has 423 words of instructions outside code blocks.

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

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). 423 words, ~2,219 tokens.

Download SKILL.mdSave it as .claude/skills/state-snapshot-instrumenter/SKILL.md (or your agent's skills folder). This skill also uses 15 other files; get the full folder from GitHub.
name
state-snapshot-instrumenter
description
Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks. Use when you need to debug complex issues, reproduce test cases, prepare traces for formal verification, or analyze program execution. Supports manual instrumentation points, automatic function/method instrumentation, and conditional triggers. Outputs structured JSON snapshots for debugging, replay, and verification workflows.

State Snapshot Instrumenter

Overview

This skill instruments programs to capture snapshots of key program states at runtime. Snapshots include variable values, memory state, call stacks, and execution context, saved in structured JSON format for analysis, debugging, reproduction, and verification.

Quick Start

Basic Workflow
  1. Add snapshot markers to your code (manual mode) or use automatic instrumentation
  2. Run the instrumenter to generate instrumented code
  3. Execute the instrumented program to capture snapshots
  4. Analyze snapshots to understand program behavior
Example: Python
bash
# 1. Add markers to your code
# def my_function(x):
#     __SNAPSHOT__("my_function:start")
#     result = x * 2
#     __SNAPSHOT__("my_function:end")
#     return result

# 2. Instrument the code
python scripts/instrument_python.py my_program.py --mode manual

# 3. Run instrumented program
python my_program_instrumented.py
# Snapshots saved to snapshots.json

# 4. Analyze snapshots
python scripts/analyze_snapshots.py snapshots.json --list
Example: C/C++
bash
# 1. Add markers to your code
# int main() {
#     __SNAPSHOT__("main:start");
#     int x = 10;
#     __SNAPSHOT__("main:end");
#     return 0;
# }

# 2. Instrument the code
python scripts/instrument_c.py program.c --mode manual

# 3. Compile with runtime
gcc program_instrumented.c scripts/snapshot_runtime.c -o program -rdynamic

# 4. Run and analyze
./program
python scripts/analyze_snapshots.py snapshots.json --list
Example: Java
bash
# 1. Add markers to your code
# public static void main(String[] args) {
#     __SNAPSHOT__("main:start");
#     int x = 10;
#     __SNAPSHOT__("main:end");
# }

# 2. Instrument the code
python scripts/instrument_java.py Program.java --mode manual

# 3. Compile and run
cp scripts/SnapshotRuntime.java snapshot/
javac snapshot/SnapshotRuntime.java
javac Program_instrumented.java
java Program_instrumented

# 4. Analyze
python scripts/analyze_snapshots.py snapshots.json --list

Instrumentation Modes

Add explicit __SNAPSHOT__("location") markers at specific points in your code.

Python:

python
def process_data(items):
    __SNAPSHOT__("process_data:entry")

    result = []
    for item in items:
        __SNAPSHOT__("loop_iteration")
        result.append(item * 2)

    __SNAPSHOT__("process_data:exit")
    return result

C/C++:

c
int calculate(int x, int y) {
    __SNAPSHOT__("calculate:entry");

    int result = x + y;

    __SNAPSHOT__("calculate:exit");
    return result;
}

Java:

java
public int calculate(int x, int y) {
    __SNAPSHOT__("calculate:entry");

    int result = x + y;

    __SNAPSHOT__("calculate:exit");
    return result;
}

Instrument:

bash
python scripts/instrument_python.py file.py --mode manual
python scripts/instrument_c.py file.c --mode manual
python scripts/instrument_java.py file.java --mode manual
Automatic Mode (Comprehensive Coverage)

Automatically instrument all function/method entry and exit points.

bash
python scripts/instrument_python.py file.py --mode auto
python scripts/instrument_c.py file.c --mode auto
python scripts/instrument_java.py file.java --mode auto

This captures state at every function boundary without manual markers.

Core Operations

1. Instrumentation

Python:

bash
# Manual mode
python scripts/instrument_python.py input.py --mode manual -o output.py

# Automatic mode
python scripts/instrument_python.py input.py --mode auto -o output.py

# In-place modification
python scripts/instrument_python.py input.py --mode manual --inplace

C/C++:

bash
# Instrument
python scripts/instrument_c.py input.c --mode manual -o output.c

# Compile with runtime
gcc output.c scripts/snapshot_runtime.c -o program -rdynamic

# Run with custom output file
SNAPSHOT_OUTPUT=my_snapshots.json ./program

Java:

bash
# Instrument
python scripts/instrument_java.py Input.java --mode manual -o Output.java

# Setup runtime
cp scripts/SnapshotRuntime.java snapshot/
javac snapshot/SnapshotRuntime.java

# Compile and run
javac Output.java
SNAPSHOT_OUTPUT=my_snapshots.json java Output
2. Snapshot Analysis

List all snapshots:

bash
python scripts/analyze_snapshots.py snapshots.json --list

Show detailed snapshot:

bash
python scripts/analyze_snapshots.py snapshots.json --show 5

View execution timeline:

bash
python scripts/analyze_snapshots.py snapshots.json --timeline

Track variable changes:

bash
python scripts/analyze_snapshots.py snapshots.json --track-var "user_id"

Compare two snapshots:

bash
python scripts/analyze_snapshots.py snapshots.json --compare 10 20

Filter snapshots:

bash
# By location
python scripts/analyze_snapshots.py snapshots.json --filter-location "main"

# By type
python scripts/analyze_snapshots.py snapshots.json --filter-type "function_entry"
3. Runtime Control

Python:

python
import snapshot_runtime

# Disable snapshots temporarily
snapshot_runtime.disable()
# ... performance-critical code ...
snapshot_runtime.enable()

# Set custom output file
snapshot_runtime.set_output_file("custom.json")

# Manually save snapshots
snapshot_runtime.save_snapshots()

C/C++:

c
#include "snapshot_runtime.h"

snapshot_disable();
// ... performance-critical code ...
snapshot_enable();

snapshot_finalize();  // Manually save

Java:

java
import snapshot.SnapshotRuntime;

SnapshotRuntime.disable();
// ... performance-critical code ...
SnapshotRuntime.enable();

SnapshotRuntime.setOutputFile("custom.json");
SnapshotRuntime.saveSnapshots();

Use Cases

Bug Debugging

Capture comprehensive state to understand complex bugs:

  1. Instrument with automatic mode for full coverage
  2. Run to reproduce the bug
  3. Analyze snapshots to identify failure point
  4. Track variable changes to understand root cause

See references/use_cases.md for detailed debugging workflows.

Test Case Reproduction

Extract exact inputs and state to reproduce failures:

  1. Instrument with manual snapshots at key points
  2. Capture failing execution
  3. Extract input dependencies from snapshots
  4. Reconstruct minimal test case

See references/use_cases.md for reproduction workflows.

Show full SKILL.md (176 more words)Show less
Formal Verification

Generate execution traces for verification tools:

  1. Instrument function boundaries
  2. Collect execution traces
  3. Extract invariants and contracts
  4. Feed to verification tools

See references/use_cases.md for verification workflows.

Reference Documentation

  • references/instrumentation_guide.md - Comprehensive guide on instrumenting programs, including language-specific instructions, best practices, and troubleshooting
  • references/snapshot_format.md - Complete specification of the JSON snapshot format, including language-specific variations and serialization rules
  • references/use_cases.md - Detailed workflows for debugging, reproduction, verification, performance analysis, and concurrency debugging

Example Programs

Example instrumented programs are provided in assets/:

  • example_python.py - Python example with manual snapshots
  • example_c.c - C example with manual snapshots
  • example_java.java - Java example with manual snapshots

Output Format

All snapshots are saved in unified JSON format:

json
{
  "format_version": "1.0",
  "language": "python",
  "total_snapshots": 5,
  "snapshots": [
    {
      "snapshot_id": 1,
      "timestamp": "2026-02-17T19:30:45",
      "location": "main:start",
      "type": "manual",
      "call_stack": [...],
      "local_variables": {...}
    }
  ]
}

See assets/snapshot_schema.json for the complete JSON schema.

Tips

  • Use manual mode for targeted debugging to minimize overhead
  • Use automatic mode for comprehensive execution understanding
  • Disable snapshots in performance-critical sections
  • Use descriptive location names (e.g., "function:entry", "after_operation")
  • Set custom output files with SNAPSHOT_OUTPUT environment variable
  • Analyze snapshots incrementally as you debug
  • Compare snapshots to identify when state becomes incorrect
  • Track key variables through execution to understand data flow

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

  • SKILL.md
  • assets/example_c.c
  • assets/example_java.java
  • assets/example_python.py
  • assets/snapshot_schema.json
  • references/instrumentation_guide.md
  • references/snapshot_format.md
  • references/use_cases.md
  • scripts/SnapshotRuntime.java
  • scripts/analyze_snapshots.py
  • scripts/instrument_c.py
  • scripts/instrument_java.py
  • scripts/instrument_python.py
  • scripts/snapshot_runtime.c
  • scripts/snapshot_runtime.h
  • scripts/snapshot_runtime.py

Open the folder on GitHubat commit 4f38503

Compare with similar skills

State Snapshot 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.

State Snapshot Instrumenter compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
State Snapshot Instrumenter this skillArabelaTso/Skills-4-SE253—~2.2kAutomated safety check: PassApache-2.0
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT
OpenROAD Bug FixerThe-OpenROAD-Project/OpenROAD3.2k—~784Automated safety check: PassBSD-3-Clause
Git History Bug Auditben-manes/caffeine18k—~3.3kAutomated safety check: PassApache-2.0
MCP Debuggerdebugmcp/mcp-debugger174—~4.2kAutomated safety check: PassMIT
Ue Live DebuggingJasonMa0012/MooaToon750—~2.9kAutomated safety check: NotesCustom licence

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 yesterday
    DevelopmentAuto-check passed
  • OpenROAD Bug Fixer

    The-OpenROAD-Project/OpenROAD

    Fixes an OpenROAD bug from a GitHub issue or error code: finds the root cause, implements the fix, adds a regression test and prepares a signed-off commit.

    3.2k GitHub stars~784 tokensUpdated today
    DevelopmentAuto-check passed
  • Git History Bug Audit

    ben-manes/caffeine

    Audits a module by walking its git history commit by commit, tracking unresolved issues forward, and reporting the ones that survive to HEAD as findings.

    18k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-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…

    174 GitHub stars~4.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Ue Live Debugging

    JasonMa0012/MooaToon

    A skill your agent uses when debugging UE C++ crashes, runtime bugs, or unexpected behavior with Rider MCP available.

    750 GitHub stars~2.9k tokensUpdated 23 days ago
    DevelopmentAuto-check: notes
  • Code Solving

    HoangTheQuyen/think-better

    Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates.

    122 GitHub stars~3.7k tokensUpdated 2 days ago
    Testing & QAAuto-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
  • 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
  • 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

Works with

Questions about State Snapshot Instrumenter

What does State Snapshot Instrumenter do?

Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks. State Snapshot Instrumenter is an agent skill from 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.

When should I use State Snapshot Instrumenter?

State Snapshot Instrumenter fits situations like: you need to debug complex issues; reproduce test cases; prepare traces for formal verification; analyze program execution.

How do I install State Snapshot Instrumenter in Claude Code?

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

How do I install State Snapshot Instrumenter in Codex?

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

Can I use State Snapshot 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 state-snapshot-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/state-snapshot-instrumenter, .gemini/skills/state-snapshot-instrumenter, .github/skills/state-snapshot-instrumenter and .opencode/skills/state-snapshot-instrumenter in your project.

What does State Snapshot Instrumenter need to run?

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

Does State Snapshot 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 State Snapshot 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 State Snapshot Instrumenter use?

State Snapshot 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 State Snapshot Instrumenter use?

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

What are the alternatives to State Snapshot Instrumenter?

Skills that share tags, products or a category with State Snapshot Instrumenter: Dbg (theodo-group/debug-that, 158 stars), OpenROAD Bug Fixer (The-OpenROAD-Project/OpenROAD, 3.2k stars), Git History Bug Audit (ben-manes/caffeine, 18k stars) and MCP Debugger (debugmcp/mcp-debugger, 174 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains State Snapshot 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.