debug-user-tx

debug-user-tx is a command for Claude Code from solanabr/solana-ai-kit. It costs 23 tokens per session (4,606 once invoked), scanned A, original, MIT.

A command for reproducing a user-reported failed Solana transaction against a local copy of blockchain state. It maps the on-chain error to the Rust or interface definition that produced it.

In plain words
What is it for?
Use it with a transaction signature or instruction data to replay failures, inspect accounts and errors, identify Anchor or other program constraints, and suggest a fix.
Why use it?
It connects an opaque transaction failure to the exact source-code location responsible, making diagnosis more concrete.

Command for Claude Code

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.

agentmods
npx agentmods add commands/solanabr/solana-ai-kit/debug-user-tx
Clone the repo
git clone --depth 1 https://github.com/solanabr/solana-ai-kit

Made for: Claude Code.

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 debug-user-tx

README.md
[![agentmods](https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/debug-user-tx.svg)](https://agentmods.dev/commands/solanabr/solana-ai-kit/debug-user-tx)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/debug-user-tx"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/debug-user-tx.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,606 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00023 $0.04606
Opus 5 $0.00012 $0.02303
Sonnet 5 $0.00005 $0.00921
Haiku 4.5 $0.00002 $0.00461

Measured 4d ago against content hash 7ce7d0431893, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-user-tx scanned grade A with 1 finding 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST "$RPC" \
.claude/commands/debug-user-tx.md · 381 lines

How it starts

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

You are debugging a transaction that a user reports as failing. You have the project's source code locally; the goal is to reproduce the failure against forked cluster state, then map the on-chain error back to the exact line of Rust / IDL that produced it and suggest a fix.

Inputs

Collect from the user (at least one of signature or instruction is required):

Input Required Notes
signature preferred On-chain tx signature. Fastest path — fetch + replay.
wallet optional User's pubkey. Auto-extracted from tx if signature given.
instruction fallback Raw ix JSON when the tx never landed (serialized tx / accounts + data).
cluster optional mainnet / devnet. Default: infer from Anchor.toml or .env.
rpc optional Override RPC endpoint. Default: cluster default or project .env.
program optional Program ID. Auto-detected from workspace.

If the user only pasted an error message, ask for the signature before proceeding — it's the difference between 30 seconds and guessing.

Step 1: Detect Project Layout

echo "Detecting project..."

FRAMEWORK="unknown"
if [ -f "Anchor.toml" ]; then
    FRAMEWORK="anchor"
    echo "Anchor project detected"
elif [ -f "Cargo.toml" ] && grep -q "pinocchio" Cargo.toml 2>/dev/null; then
    FRAMEWORK="pinocchio"
    echo "Pinocchio project detected"
elif [ -f "Cargo.toml" ] && grep -q "solana-program" Cargo.toml 2>/dev/null; then
    FRAMEWORK="native"
    echo "Native Solana program detected"
else
    echo "No Solana program workspace detected. Debug will proceed RPC-only (no source mapping)."
fi

# Infer cluster
CLUSTER="${CLUSTER:-mainnet}"
if [ -f "Anchor.toml" ]; then
    DETECTED=$(grep -m1 'cluster' Anchor.toml | sed 's/.*= *//' | tr -d '"')
    [ -n "$DETECTED" ] && CLUSTER="$DETECTED"
fi
echo "Cluster: $CLUSTER"

# Collect program IDs + IDLs
ls target/idl/*.json 2>/dev/null || echo "No IDLs found at target/idl/ — run 'anchor build' for best results"

Read the full file on GitHub · 381 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. 4d ago First seen · 381 lines · 23 tokens per session scan A 7ce7d0431893

Subscribe to this mod's changes

debug-user-tx is a command published in the GitHub repository solanabr/solana-ai-kit (98 stars, last pushed 14d ago), licensed MIT. It adds 23 tokens to every session and 4,606 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.