diff-review

diff-review is a command for Claude Code from solanabr/solana-ai-kit. It costs 16 tokens per session (766 once invoked), scanned A, original, MIT.

A command that reviews the changes between your current Git branch and the main or master branch for Solana-specific problems and code-quality issues. Solana is a blockchain platform where programs manage accounts and transactions.

In plain words
What is it for?
Use it to inspect changed files, check account validation and other Solana security categories, and receive findings with severity, line references, and suggested fixes.
Why use it?
It helps catch security mistakes and problematic patterns in changed code before those changes are merged.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions CLAUDE.md.

Good fit Use it to inspect changed files, check account validation and other Solana security categories, and receive findings with severity, line references, and suggested fixes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/solanabr/solana-ai-kit/diff-review
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.

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 diff-review

README.md
[![agentmods](https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/diff-review/github.svg)](https://agentmods.dev/commands/solanabr/solana-ai-kit/diff-review)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/diff-review"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/diff-review/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diff-review

Your own site · 80×15
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/diff-review"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/diff-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 766 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00016 $0.00766
Opus 5.5 $0.00006 $0.00306
Sonnet 5.5 $0.00003 $0.00153
Haiku 4.5 $0.00002 $0.00077

Measured 25d ago against content hash a5fa70680be7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diff-review 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 25d 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/commands/diff-review.md · 35 lines

How it starts

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

Review this branch's changes against the base branch ($ARGUMENTS, default main, else master) and report findings by severity, each with file:line and a concrete fix. Vulnerability classes: security.md; scanning workflow: solana-vulnerability-scanner.

Steps

  1. Diff: git diff <base>...HEAD, plus git diff HEAD for uncommitted work, and --stat for scope. Read the whole file when a hunk lacks context (account structs, handlers).
  2. Solana checks on the changed code:
    • New or changed accounts carry owner, signer and PDA constraints; each UncheckedAccount has a /// CHECK: the code enforces.
    • Math on amounts is checked, with no narrowing as; no unwrap()/expect() in program code.
    • PDAs reuse the stored bump (bump = acct.bump); handlers do not call find_program_address.
    • CPIs validate the target program and .reload() accounts they mutate.
    • Token code uses transfer_checked with token_interface and handles Token-2022 transfer hooks and fees where the mint may be Token-2022.
    • Pre-1.0 Anchor habits: @coral-xyz/anchor imports (now @anchor-lang/core), CpiContext::new given an AccountInfo, plain transfer, hardcoded 8 + in space.
    • Clients keep amounts as bigint/BN, mix web3.js 1.x and @solana/kit types only through an interop layer (kit-web3-interop.md), and regenerate the IDL client when the program interface changed (/generate-idl-client).
    • No hardcoded addresses or RPC URLs outside constants or config; no API keys in client code.
    • CU waste: msg! with formatting on hot paths; needless .clone() or Vec copies of account data.
    • Changed instructions have tests, including their failure paths.
  3. AI slop: comments that restate the code; over-commented files; try/catch that only rethrows or swallows; defensive checks duplicating Anchor constraints; verbose errors leaking internals; dead helpers or copies of existing utilities; stubs and TODOs presented as finished; docs describing behavior the code does not have.
  4. Capture learnings: when a Critical or Warning finding repeats a mistake already seen in this repo, or the user confirms a convention, append one line under ## Project Learnings in CLAUDE.md. Skip one-off findings.

Read the full file on GitHub · 35 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. 25d ago Changed · -213 lines · +4 tokens per session a5fa70680be7
  2. 26d ago Changed 12e85a06577a
  3. 1mo ago First seen · 248 lines · 12 tokens per session scan A 52af70f93344

Subscribe to this mod's changes

diff-review is a command published in the GitHub repository solanabr/solana-ai-kit (104 stars, last pushed 26d ago), licensed MIT. It adds 16 tokens to every session and 766 once invoked, about $0.0001 per session on Opus 5.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-30.