debug

A command for diagnosing problems in ACTP, a payment and escrow transaction system used by AGIRAILS. It examines transaction details or error messages, explains likely causes, and suggests fixes.

In plain words
What is it for?
Use it for stuck transactions, SDK errors, failed payments, connection problems, invalid state changes, expired deadlines, authorization errors, paused contracts, or missing escrow links.
Why use it?
It turns common payment failures into specific checks, such as whether funds, permissions, deadlines, or transaction states are correct. This is more useful than treating every failed transaction as the same problem.

Command

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/agirails/claude-plugin/debug
Clone the repo
git clone --depth 1 https://github.com/agirails/claude-plugin
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,702 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00012 $0.01702
Opus 5 $0.00006 $0.00851
Sonnet 5 $0.00002 $0.00340
Haiku 4.5 $0.00001 $0.00170

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

Security

Grade A, and why

debug 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 yesterday.

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/debug.md · 232 lines

How it starts

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

/agirails:debug

Diagnose and fix common ACTP integration issues.

What This Command Does

  1. Identify issue type (transaction error, SDK error, network error)
  2. Run diagnostic checks
  3. Explain root cause
  4. Provide actionable fix

Step-by-Step Instructions

Step 1: Identify Issue Type

If transaction ID provided:

  • Fetch transaction details
  • Check state validity
  • Verify escrow balance

If error message provided:

  • Parse error type
  • Match against known patterns

If neither:

"What issue are you experiencing?"
Options:
  [Transaction stuck]
  [SDK error]
  [Payment failed]
  [Connection issues]
  [Other - describe]

Step 2: Common Error Patterns

Error Cause Fix
INSUFFICIENT_BALANCE Not enough USDC Mint test USDC (mock) or add funds
INVALID_STATE_TRANSITION Wrong state for action Check current state with /agirails:status
DEADLINE_PASSED Transaction expired Create new transaction with longer deadline
NOT_AUTHORIZED Wrong caller Use correct address (requester vs provider)
CONTRACT_PAUSED Emergency pause active Wait for unpause
ESCROW_NOT_LINKED No funds locked Call linkEscrow() first

Step 3: Diagnostic Commands

Check SDK Connection:

// Test connection
const client = await ACTPClient.create({
  mode: 'mock',
});
console.log('Mode:', client.getMode());
console.log('Address:', client.getAddress());
console.log('Info:', client.info);

Check Transaction State:

const tx = await client.standard.getTransaction('0x...');
console.log('State:', tx.state);
console.log('Requester:', tx.requester);
console.log('Provider:', tx.provider);
console.log('Amount:', tx.amount);
console.log('Deadline:', new Date(tx.deadline * 1000));
console.log('Is expired:', tx.deadline < Date.now() / 1000);

Check Balances:

const balance = await client.getBalance(client.getAddress());
const escrowBalance = await client.standard.getEscrowBalance('0x...');
console.log('USDC Balance (wei):', balance);
console.log('Locked in Escrow:', escrowBalance);

Read the full file on GitHub · 232 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. yesterday First seen · 232 lines · 12 tokens per session scan A 7ab034cfd475

Subscribe to this mod's changes

debug is a command published in the GitHub repository agirails/claude-plugin (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 12 tokens to every session and 1,702 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.