solana-vault-standard: Command for Claude Code

.claude/commands/diff-review.md

diff-review is a command for Claude Code from solanabr/solana-vault-standard. It costs 12 tokens per session (1,943 once invoked), scanned A, a copy of diff-review, MIT.

A review command that checks the changes between two Git branches for security problems and code-quality issues specific to Solana, a blockchain platform.

In plain words
What is it for?
Use it to review a branch diff, identify Solana security risks and anti-patterns, and organize the results by issue type.
Why use it?
It helps catch unsafe account handling and other Solana mistakes before the changes are merged. Findings include affected lines, severity, and suggested fixes.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is solanabr/solana-vault-standard's own configuration. It tells Claude Code how to work on solana-vault-standard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything solana-vault-standard configures →

Reuse

Borrowing it

Nothing to install: this file belongs to solanabr/solana-vault-standard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/solanabr/solana-vault-standard/main/.claude/commands/diff-review.md
Clone the repo
git clone --depth 1 https://github.com/solanabr/solana-vault-standard

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-vault-standard/diff-review.svg)](https://agentmods.dev/commands/solanabr/solana-vault-standard/diff-review)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-vault-standard/diff-review"><img src="https://agentmods.dev/badge/commands/solanabr/solana-vault-standard/diff-review.svg" alt="Measured on agentmods" height="20"></a>
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,943 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 100% copy Near-identical to another mod 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.00012 $0.01943
Opus 5 $0.00006 $0.00971
Sonnet 5 $0.00002 $0.00389
Haiku 4.5 $0.00001 $0.00194

Measured 7d ago against content hash 52af70f93344, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 7d 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

This is a copy

100% identical to diff-review — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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

How it starts

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

You are reviewing the current branch diff for Solana-specific security issues, code quality problems, and anti-patterns. Output categorized findings with line references and fix suggestions.

Step 1: Get the Diff

# Determine base branch
BASE_BRANCH="main"
if ! git rev-parse --verify "$BASE_BRANCH" >/dev/null 2>&1; then
    BASE_BRANCH="master"
fi

echo "Reviewing diff: $BASE_BRANCH...HEAD"
echo "Branch: $(git branch --show-current)"
echo ""

# Get the full diff
git diff "$BASE_BRANCH"...HEAD

echo ""
echo "Changed files:"
git diff --name-only "$BASE_BRANCH"...HEAD

echo ""
echo "Diff stats:"
git diff --stat "$BASE_BRANCH"...HEAD

Step 2: Check for Critical Issues

Scan the diff for each category. Report with file path, line number, and severity.

Account Validation

echo "=== Account Validation Check ==="

# Find Anchor account structs in changed files
CHANGED_RS=$(git diff --name-only "$BASE_BRANCH"...HEAD | grep '\.rs$')

if [ -n "$CHANGED_RS" ]; then
    echo "Checking Rust files for account validation..."

    # Missing owner checks in native programs
    for f in $CHANGED_RS; do
        [ -f "$f" ] || continue
        grep -n "AccountInfo" "$f" | head -20
    done

    # Check for accounts missing constraints in Anchor
    for f in $CHANGED_RS; do
        [ -f "$f" ] || continue
        # Accounts without any constraint attribute
        grep -n "pub.*Account<" "$f" | grep -v "#\[account" | head -20
    done
fi

Arithmetic Safety

echo ""
echo "=== Arithmetic Safety Check ==="

if [ -n "$CHANGED_RS" ]; then
    for f in $CHANGED_RS; do
        [ -f "$f" ] || continue
        # Unchecked arithmetic operators on likely numeric operations
        grep -n -E '\b\w+\s*[+\-\*]\s*\w+' "$f" | grep -v "checked_" | grep -v "//" | grep -v "test" | head -20
    done
fi

Read the full file on GitHub · 248 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. 7d 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-vault-standard (23 stars, last pushed 5mo ago), licensed MIT. It adds 12 tokens to every session and 1,943 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to diff-review, differing in 0 lines, and is treated as a copy.

Related

Other commands, from other repositories

diff-review

AI-powered diff review for Solana-specific issues and code quality.

solanabr/solana-ai-kit · 12 tokens

auditor:re-audit

Fix-review / re-audit. Takes a prior audit report + the current tree and classifies every prior finding FIXED / PARTIALLY-FIXED / STILL-OPEN / REGRESSED / ACKNOWLEDGED / DISPUTED (re-running Rule 5b on the fix, citing the remediation commit/PR hash), audits the changed surface for NEW findings via the diff-audit path…

solanabr/auditor-skill · 114 tokens

auditor:audit-assist

Flow B — AI-assisted iterative audit with a human in the loop. Same lifecycle as audit-cycle, but pauses at checkpoints to surface confirmed findings, the next-focus plan, and targeted questions only the human can answer (business context, trust model, severity calls). The human steers; the agent re-synthesizes toward…

solanabr/auditor-skill · 76 tokens

auditor:intake

Interactive engagement intake (alias /scope). Walks QUESTIONS.md and persists the answers to audit /intake.md — the durable intake artifact both audit-cycle and audit-assist read, instead of answers living only in conversation state. Captures scope + commit pin, languages/frameworks, protocol class, compliance…

solanabr/auditor-skill · 100 tokens

auditor:diff-audit

PR / commit-scoped differential audit — audits only changed functions (plus 1-hop callers), flags removed security checks, and prioritizes by risk × blast radius.

solanabr/auditor-skill · 40 tokens

auditor:economic-sim

Quantify a candidate economic finding — compute attack cost vs extractable value and, when possible, reproduce deposit→manipulate→withdraw against a Surfpool mainnet-fork for a real P/L figure.

solanabr/auditor-skill · 49 tokens