replay-incident

replay-incident is a command for Claude Code from omermaksutii/RugProof. It costs 24 tokens per session (729 once invoked), scanned A, original, MIT.

A command for replaying a real blockchain exploit transaction on a local copy of the blockchain state. It explains the attacker’s actions by walking through the transaction’s calls and state changes.

In plain words
What is it for?
Investigating historical exploits, comparing replayed and live results, and creating educational explanations of blockchain attacks.
Why use it?
It lets developers study a past hack in a controlled environment without changing the live blockchain. It also makes the technical cause easier to follow step by step.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the rugproof plugin — 35 commands, 23 agents shipped together

Good fit Investigating historical exploits, comparing replayed and live results, and creating educational explanations of blockchain attacks.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/omermaksutii/rugproof/replay-incident
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.

Clone the repo
git clone --depth 1 https://github.com/omermaksutii/RugProof

Made for: Claude Code.

Or install rugproof, the plugin that ships this one along with the rest of its 35 commands, 23 agents.

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 replay-incident

README.md
[![agentmods](https://agentmods.dev/badge/commands/omermaksutii/rugproof/replay-incident/github.svg)](https://agentmods.dev/commands/omermaksutii/rugproof/replay-incident)
Your own site
<a href="https://agentmods.dev/commands/omermaksutii/rugproof/replay-incident"><img src="https://agentmods.dev/badge/commands/omermaksutii/rugproof/replay-incident/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 replay-incident

Your own site · 80×15
<a href="https://agentmods.dev/commands/omermaksutii/rugproof/replay-incident"><img src="https://agentmods.dev/badge/commands/omermaksutii/rugproof/replay-incident.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 729 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.00024 $0.00729
Opus 5 $0.00012 $0.00365
Sonnet 5 $0.00005 $0.00146
Haiku 4.5 $0.00002 $0.00073

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

Security

Grade A, and why

replay-incident 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.

commands/replay-incident.md · 91 lines

How it starts

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

/replay-incident — replay a historical hack

Pulls a real exploit tx from chain, replays it on a fork, and walks through what happened.

Great teaching tool. Also great content — every replay can become a tweet or blog post.

Procedure

Step 1 — Fetch the tx

mcp__block-explorer__get_tx(chain=<chain>, hash=<hash>)
mcp__block-explorer__get_trace(chain=<chain>, hash=<hash>)

Pull the calldata, value, from/to, internal calls, state diff, gas, and block.

Step 2 — Fork just before the tx

mcp__anvil__fork(chain=<chain>, block=<tx_block - 1>)

This gives us the pre-attack state.

Step 3 — Identify the protocol and contracts touched

Pull the verified source of every contract in the trace.

Step 4 — Replay

mcp__anvil__send_raw_tx(<original-tx>)

Capture the actual state changes; compare to the live chain post-tx data — should match.

Step 5 — Annotate the trace

Walk through each internal call:

Block 18,234,567 — Curve Finance exploit (2023-07-30)

  External call: 0xattacker → 0xfraxusdc_pool.remove_liquidity_one_coin(...)
    │
    ├─ Internal: pool transfers $1M USDC to attacker
    │   Then calls pool.balanceOf(attacker) for reward accounting...
    │     │
    │     └─ READ-ONLY REENTRANCY: pool state is mid-update during this read
    │
    └─ attacker contract uses the stale read to mint reward shares
        based on the larger-than-real balance

Step 6 — Vuln-class mapping

Map the incident to the [[skills]] taxonomy:

Root cause:  read-only reentrancy (skills/reentrancy)
Amplifier:   reward accounting based on token.balanceOf during mid-update
Lesson:      for any oracle/getter call from a reentrant contract, add
             ReentrancyGuard or rely on a settled-state snapshot.

Step 7 — Output

The full walkthrough + a "what to learn" section + (if --card flag) a PNG card for sharing.

Notable replayable incidents to demo

  • 2022-04-17: Beanstalk governance flash-loan ($182M)
  • 2022-08-01: Nomad bridge replay attack ($190M)
  • 2023-07-30: Curve / Vyper compiler reentrancy ($73M)
  • 2023-11-22: KyberSwap concentrated liquidity precision ($55M)
  • 2024-03-13: Munchables blacklist-able EOA admin ($63M)

Read the full file on GitHub · 91 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 · 91 lines · 24 tokens per session scan A 661b809422dd

Subscribe to this mod's changes

replay-incident is a command published in the GitHub repository omermaksutii/RugProof (9 stars, last pushed 1mo ago), licensed MIT. It adds 24 tokens to every session and 729 once invoked, about $0.0001 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.