test-rust

test-rust is a command for Claude Code from solanabr/solana-ai-kit. It costs 22 tokens per session (1,085 once invoked), scanned C, original, MIT.

A command for running tests in Rust projects, including Solana programs and backend services. Solana is a blockchain platform, and these tests check whether its programs work correctly.

In plain words
What is it for?
Use it to test standard Rust code, backend services, and Solana programs built with Anchor, Pinocchio, or native Solana tools.
Why use it?
It gives developers a repeatable way to test different kinds of Rust projects instead of choosing and running each test setup manually.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to test standard Rust code, backend services, and Solana programs built with Anchor, Pinocchio, or native Solana tools.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/test-rust/github.svg)](https://agentmods.dev/commands/solanabr/solana-ai-kit/test-rust)
Your own site
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/test-rust"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/test-rust/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 test-rust

Your own site · 80×15
<a href="https://agentmods.dev/commands/solanabr/solana-ai-kit/test-rust"><img src="https://agentmods.dev/badge/commands/solanabr/solana-ai-kit/test-rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 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,085 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00022 $0.01085
Opus 5.5 $0.00009 $0.00434
Sonnet 5.5 $0.00004 $0.00217
Haiku 4.5 $0.00002 $0.00109

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

Security

Grade C, and why

test-rust scanned grade C with 2 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- Surfpool, for mainnet-fork state and cheatcodes: `NO_DNA=1 surfpool start` and point tests at `http://127.0.0.1:8899`, or embed `surfpool-sdk` so each suite owns its surfnet. Install with `curl -sL https://run.surfpool

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Surfpool, for mainnet-fork state and cheatcodes: `NO_DNA=1 surfpool start` and point tests at `http://127.0.0.1:8899`, or embed `surfpool-sdk` so each suite owns its surfnet. Install with `curl -sL https://run.surfpool
Origin

Copies of this mod

2 near-identical copies found in the catalogue:

  • test-rust — 94% identical, 414 lines differ
  • test-rust — 94% identical, 414 lines differ
.claude/commands/test-rust.md · 32 lines

How it starts

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

Run the project's Rust test suites and report each failure with its cause. $ARGUMENTS narrows the run (a package, test name, or filter passed to cargo test); empty means everything.

Harness setup and patterns: testing.md. Surfpool flags and cheatcodes: surfpool/overview.md.

Steps

  1. Rebuild the program before running program tests: NO_DNA=1 anchor build or cargo build-sbf. LiteSVM and Mollusk load target/deploy/<name>.so (the Anchor LiteSVM template include_bytes!s it at compile time), so cargo test alone tests whatever binary was built last. NO_DNA=1 turns off Anchor and Surfpool prompts and TUIs for agent runs.
  2. Run the suite that fits:
    • Anchor 1.x: anchor init scaffolds Rust LiteSVM tests in programs/<name>/tests/ with [scripts] test = "cargo test". NO_DNA=1 anchor test builds, starts Surfpool, deploys, runs that script, and streams program logs to .anchor/program-logs/. In-process suites need no validator: anchor test --skip-local-validator --skip-deploy (newer anchor init writes skip_local_validator = true for you), or cargo test -p <name> after step 1.
    • Native or Pinocchio: cargo test-sbf builds the program and sets SBF_OUT_DIR, where Mollusk::new(&id, "<name>") finds <name>.so (it also searches tests/fixtures and the cwd).
    • Mollusk, for single-instruction and CU tests: Check::compute_units(n) expects exactly n, so assert a ceiling on result.compute_units_consumed yourself. MolluskComputeUnitBencher (run through cargo bench) writes compute_units.md with deltas.
    • Surfpool, for mainnet-fork state and cheatcodes: NO_DNA=1 surfpool start and point tests at http://127.0.0.1:8899, or embed surfpool-sdk so each suite owns its surfnet. Install with curl -sL https://run.surfpool.run/ | bash; the surfpool crate on crates.io is an unrelated package.
    • Fuzzing: Trident (trident init once, then trident fuzz run fuzz_0), or anchor fuzz (Crucible) on Anchor 1.2+. Give runs minutes to hours and assert invariants such as value conservation, not only "no panic".
    • Rust backends: cargo test --workspace; add -- --test-threads=1 when tests share a database, and set DATABASE_URL for #[sqlx::test].
  3. Rerun only the failures: cargo test <name> -- --exact --nocapture.

Read the full file on GitHub · 32 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 · -372 lines · +12 tokens per session scan A → C 6e5b58e7dff6
  2. 26d ago Changed 5813bc3f77ca
  3. 1mo ago First seen · 404 lines · 10 tokens per session scan A 3930d45f8cfe

Subscribe to this mod's changes

test-rust is a command published in the GitHub repository solanabr/solana-ai-kit (104 stars, last pushed 26d ago), licensed MIT. It adds 22 tokens to every session and 1,085 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.