/truent:truent-irfrom truent
On-chain incident response for EVM/Solana/Move/Soroban exploits. Scopes damage, fuzzes deployed bytecode with revm to identify the exact broken invariant, and separates verified root cause from speculation.
Ships in truent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Work out what actually happened, with the engine rather than with a theory.
Post-mortems get written under time pressure by people who have been awake for twenty hours, and the failure mode is always the same: a plausible mechanism gets written down, repeated, and becomes the official story — and the real bug is still live. Truent can execute the deployed bytecode. So the rule here is that the stated root cause must be one the engine reproduced, and anything else is labelled as hypothesis until it is.
$SKILL_DIR = the directory containing this SKILL.md.
VERIFIED — reproduced against real bytecode, with the call sequence.REASONED — a hypothesis. Never written into the root-cause section.If the exploit is ongoing, containment beats analysis. Say so once, in one line, and ask which the user wants first — do not silently start a forensic pipeline while funds are leaving. Containment options to surface, in the order they are usually available:
Then continue. Analysis with the bleeding stopped is a better analysis.
Inputs needed: at least one exploit transaction hash and an RPC endpoint. If the user has neither, the earliest anomalous block and the affected contract address will do.
Bash: pull the transaction and its trace.
cast tx <tx-hash> --rpc-url <rpc>
cast receipt <tx-hash> --rpc-url <rpc>
cast run --trace-printer <tx-hash> --rpc-url <rpc> 2>&1 | head -200
From the trace, record: entry point called, contracts touched in order,
external calls made back into the protocol, and where value moved.Bash: establish the blast radius.
# Balance of the affected contract before and after
cast balance <contract> --block <block-1> --rpc-url <rpc>
cast balance <contract> --block <block> --rpc-url <rpc>
# Token balances, per affected token
cast call <token> "balanceOf(address)(uint256)" <contract> --block <block-1> --rpc-url <rpc>
cast call <token> "balanceOf(address)(uint256)" <contract> --block <block> --rpc-url <rpc>
Bash: is the transaction the first, or the tenth? Scope the window.
cast logs --address <contract> --from-block <block-500> --to-block latest --rpc-url <rpc> | head -100
Preserve evidence now, before anything is patched or redeployed: save the
raw trace, the receipts, and the affected block numbers to incident/. An RPC
provider can prune, and a fork endpoint can go away.
This is the step that separates this skill from a careful read of the trace.
truent fuzz --dynamic --address <contract> --rpc-url <rpc> --iterations 2000 --seed 1
Truent deploys the fetched bytecode into an in-memory EVM, drives adversarial call sequences, and checks auto-detected invariants — conservation, monotonicity, access control, reentrancy — after every call. When one breaks, it shrinks the violation to the shortest sequence that triggers it.
VERIFIED. Compare it against the Phase 1 trace — if the shapes match, the
root cause is established, not argued.--iterations, vary --seed (2, 3), and pin the fork to the exact
pre-exploit block so the state matches:
truent fuzz --dynamic --address <contract> --rpc-url <rpc> --iterations 20000 --seed 2
If it still does not reproduce, the mechanism likely depends on state or
actors outside this contract — a manipulated oracle, a flash-loan-sized
balance, a second protocol. Say that; it is itself a finding about where to
look next.Also run the static pass over the deployed source, if verified:
truent scan <source> --chain <chain> --format json
A detector that already flagged this exact invariant before the exploit is the most important line in the eventual post-mortem, and the most uncomfortable — report it plainly either way.
Every exploit is an invariant that was assumed and never enforced. Write it as a property, not a narrative:
totalSupplymust equal the sum of allbalanceOf— broken becauseredeem()burned shares after transferring the underlying, so a reentrantdeposit()priced against a pool that had already paid out.
Then map it:
truent taxonomy --id <CWE or SWC from the reproducing detector>
so the post-mortem carries CWE, SWC, OWASP SC and DASP identifiers. Insurers, exchanges and downstream integrators triage by those, not by prose.
Turn the reproduced violation into a check that fails if the bug returns.
Write the invariant into the project's .sinv set and confirm it fails against
the vulnerable code and passes against the fix:
truent check <patched-src> --chain <chain> --fail-on medium
A fix that is not accompanied by a failing-then-passing check is a fix nobody can prove.
Write incident/post-mortem.md:
INCIDENT — <protocol> — <date>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Status <contained | ongoing | funds recovered>
Loss <amount, per asset, with the blocks it was measured between>
First tx <hash> @ block <n>
Last tx <hash> @ block <n>
Root cause [VERIFIED — reproduced by truent fuzz, seed <n>]
Broken invariant: <the property, stated as a property>
Minimal reproduction:
1. <call>
2. <call>
3. <call> ← invariant violated here
Taxonomy: CWE-xxx · <name> | SWC-xxx | SCxx | DASP-x
Timeline
<block/time> <what happened, from the trace — not from memory>
What did not cause it
<hypotheses considered and ruled out, and how they were ruled out>
Detection gap
<was this detectable before? did a detector flag it and get dismissed?>
Remediation
<the fix, and the regression invariant that now guards it>
Open questions [REASONED]
<everything not reproduced. Explicitly not part of the root cause.>
The What did not cause it and Open questions sections are mandatory and must be non-empty in any real incident. A post-mortem with no ruled-out hypotheses is a post-mortem that stopped at the first plausible story.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub emmyhack/truent --plugin truent6 skills in this plugin
/truent-auditEngine-first smart-contract security audit across EVM, Solana, Move and Soroban. Truent's compiled engine runs first (static detectors on every chain, a real revm invariant fuzzer on the EVM) and is the ground truth; twelve LLM attacker lenses then hunt the residual, and every property they state is pushed back through the engine. Findings carry one of three evidence tiers, never blurred: VERIFIED-PROVEN (the engine executed it), VERIFIED-STATIC (a compiled detector matched real code), REASONED (a model proposed it, nothing executed it). Modes - default (full repo) or a specific filename. Loop mode runs several passes in one scan, each pass told what the earlier ones found, and ends in one combined report; it remembers findings between scans in a ledger. Triggers on 'truent audit', 'audit', 'audit this contract', 'check this contract', 'security review', 'check for vulnerabilities', 'review for security', 'solidity auditor', 'run the auditor', 'run the auditor in loop mode', 'loop mode', 'run 3 passes'./truent-depsSupply-chain security review of a smart-contract project's dependencies and CI. Finds forked/drifted libraries, unpinned submodules and package versions, and CI workflows that leak deploy keys — then runs Truent's engine over the dependency code that is actually compiled into your contracts, because a patched modifier in a vendored OpenZeppelin is your bug, not upstream's. Multi-chain: Foundry/Hardhat (EVM), Anchor (Solana), Move, Soroban. Triggers on 'truent deps', 'dependency audit', 'supply chain review', 'check my dependencies', 'are my libs safe', 'audit CI workflows'./truent-fuzzStateful invariant fuzzing for smart contracts on EVM, Solana, Move and Soroban. Default path runs Truent's native revm-backed fuzzer — auto-detected invariants, user-written .invar properties, adversarial call sequences, and minimal-PoC shrinking in one binary, no external toolchain. On demand it generates a full fizz-grade Echidna/Medusa suite (setup, handlers, ghost/snapshot properties, coverage loop, campaigns, Foundry repros, report, convert/sync sub-commands) as a strict superset, never lock-in, plus Solana fuzz plans and Move Prover / Soroban test harnesses. Triggers on 'truent fuzz', 'fuzz this', 'fizz', 'invariant fuzzing', 'stateful fuzzing', 'generate fuzz suite', 'build fuzz harness', 'build a fuzz harness', 'fuzzing harness', 'property testing', 'invariant suite'./truent-keysKey custody and deploy-safety review for a smart-contract project. Finds plaintext private keys in source, scripts, history and CI; then runs Truent's engine over the on-chain side of the same question — single-EOA admins, multisig thresholds too low to matter, unprotected initializers and upgrade paths — because a well-guarded key on a contract anyone can re-initialize protects nothing. Multi-chain: EVM, Solana, Move, Soroban. Triggers on 'truent keys', 'key hygiene', 'deploy safety', 'check my private keys', 'is my deploy script safe', 'admin key review', 'who can upgrade this'./truent-reconPre-audit reconnaissance for a smart-contract codebase, engine-verified. Produces a recon/ folder (recon.md readiness report with threat model, entry-point map, full invariant map, architecture diagram, git-history risk mining, test and doc gaps, verdict) and, unlike a report-only recon, feeds the synthesized invariants into Truent's compiled engine so checkable items come back already checked and the engine's own findings, STRIDE model and exposure chains are part of the map. Multi-chain: EVM, Solana, Move (Aptos, Sui), Soroban. Triggers on 'truent recon', 'recon', 'x-ray', 'pre-audit', 'pre-audit report', 'audit readiness', 'readiness report', 'prep this protocol', 'protocol prep', 'summarize this protocol', 'map this codebase', 'where should I audit'.