audit-diff

A command that compares two Rugproof security-audit reports for the same smart contract, a program that runs on a blockchain. It reports new, fixed, and ongoing findings and whether the security grade changed.

In plain words
What is it for?
Use it for before-and-after checks, release reviews, and CI gates that block new High or Critical findings.
Why use it?
It shows whether a fix solved a reported issue or introduced a regression, meaning a new problem caused by the change.

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/omermaksutii/rugproof/audit-diff
Clone the repo
git clone --depth 1 https://github.com/omermaksutii/RugProof
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 581 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.00028 $0.00581
Opus 5 $0.00014 $0.00291
Sonnet 5 $0.00006 $0.00116
Haiku 4.5 $0.00003 $0.00058

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

Security

Grade A, and why

audit-diff 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 2d 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/audit-diff.md · 64 lines

What it actually says

/audit-diff — regression diff between two audits

Did your fix actually resolve the finding? Did it introduce a new one? Run two audits and diff the JSON reports. Unlike /diff-audit (which compares your code against a canonical reference), this compares two Rugproof reports of the same contract over time — perfect for CI gates and "before/after a fix".

Procedure

Step 1 — Produce two reports

Each side is a Rugproof report JSON (the schemas/finding.schema.json shape, i.e. what /report --format json and parse-slither / parse-mythril emit):

git stash && /audit src/Vault.sol   # → save as before.json
git stash pop && /audit src/Vault.sol   # → save as after.json

Step 2 — Diff

node "${CLAUDE_PLUGIN_ROOT}/scripts/dist/diff-reports.js" \
  --old before.json --new after.json

The engine keys findings by id, so it tracks each finding across runs: added (in new only), fixed (in old only), persisting (both), per-severity countsDelta, and the gradeChange. It exits non-zero when a new High or Critical appears (regressed: true) so it doubles as a CI gate.

Step 3 — Output

Audit diff: before.json → after.json

  3 new, 2 fixed, 1 persisting · grade F → C · ✓ improved

  Fixed:
    ✓ [Critical] REENT-001  reentrancy in withdraw()
    ✓ [Medium]   GAS-010    unbounded loop
  New:
    + [High]     ACCESS-003 missing onlyOwner on setOracle()
  Persisting:
    • [High]     ORACLE-002 spot oracle still in use

  Counts Δ: critical -1, high +0, medium -1

Notes

  • Use it in CI after /audit-changes: a non-zero exit means the PR introduced a new high/critical relative to the base branch's report.
  • --out delta.json writes the structured diff for further processing.
  • For comparing code against an upstream library instead, use /diff-audit.
  • Confirm a fixed finding is genuinely resolved (and not just relocated to a new id) with /verify-finding.
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. 2d ago First seen · 64 lines · 28 tokens per session scan A 51ebb2f5bbab

Subscribe to this mod's changes

audit-diff is a command published in the GitHub repository omermaksutii/RugProof (9 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 581 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.