trace-tx
Fetches the full execution trace for an EVM transaction via debug_traceTransaction. The trace reveals the complete call tree: every internal CALL/DELEGATECALL/CREATE, gas consumed at each step, input/output data, and any revert reasons.
Usage
~/.claude/skills/trace-tx/scripts/trace_tx.sh [-o <output_file>] <TX_HASH> <RPC_URL> [TRACER] [onlyTopCall]
- Use the RPC URL the user supplied.
- Or if
ALCHEMY_API_KEYis set, construct the Alchemy URL:https://<chain-slug>.g.alchemy.com/v2/$ALCHEMY_API_KEYand use it as the RPC URL. Common slugs: "Ethereum"/"ETH" →eth-mainnet, "Arbitrum"/"Arb" →arb-mainnet, "Base" →base-mainnet, "Optimism"/"OP" →opt-mainnet, "Polygon"/"MATIC" →polygon-mainnet, "BSC"/"BNB Chain" →bnb-mainnet, "Sepolia" →eth-sepolia. Find full slug list inreferences/rpc_urls.mdonly when necessary. - If neither is available, find an RPC URL that supports
debug_traceTransactionfor the specific tx. - Default tracer:
callTracer(nested call tree — best for most tasks). Also supportsprestateTracerand raw opcode trace.
Workflow
Use -o to write the trace to a file — traces can be megabytes:
~/.claude/skills/trace-tx/scripts/trace_tx.sh -o trace_0xabc123.json 0xabc... https://your-rpc-url
Tell the user the path to the saved file.
Reference
- Full RPC URL list:
references/rpc_urls.md