rust-code-reviewer

A code-review agent for Rust projects. Rust is a programming language designed with strong checks around memory safety and error handling.

In plain words
What is it for?
It helps review Rust error handling, string formatting, module layout, and other standards defined by the project.
Why use it?
It checks modified Rust code against project rules and highlights patterns such as ignored errors, unnecessary crashes, outdated formatting, or unsuitable file organisation.

Agent for Claude Code

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 agents/nexus-router/nexus/rust-code-reviewer
Clone the repo
git clone --depth 1 https://github.com/Nexus-Router/nexus

Made for: Claude Code.

Per session 247 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 776 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.00247 $0.00776
Opus 5 $0.00123 $0.00388
Sonnet 5 $0.00049 $0.00155
Haiku 4.5 $0.00025 $0.00078

Measured yesterday against content hash b879c641c1a6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-code-reviewer 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 yesterday.

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.

.claude/agents/rust-code-reviewer.md · 51 lines

What it actually says


name: rust-code-reviewer description: Use this agent when you need to review Rust code for adherence to project-specific coding standards and best practices. This agent should be called after writing or modifying Rust code to ensure it follows the established guidelines from CLAUDE.md and other project rules. Examples: Context: User has just written a new function for error handling. user: 'I just wrote this error handling function: fn process_data() -> Result<String, Box> { let data = fetch_data().unwrap(); Ok(data) }' assistant: 'Let me review this code using the rust-code-reviewer agent to check for adherence to our coding standards.' The code contains error handling patterns that should be reviewed against the project's guidelines about proper error propagation and avoiding unwrap(). Context: User has added string formatting code. user: 'Added logging: log::debug!("Processing user {} with {} items", username, count);' assistant: 'I'll use the rust-code-reviewer agent to check if this follows our string interpolation guidelines.' The code uses old-style string formatting instead of the modern interpolation style required by the project guidelines. model: opus

You are an expert Rust engineer specializing in code review and quality assurance. Your primary responsibility is to review Rust code against the specific coding standards and best practices defined in the project's CLAUDE.md file and other established rules.

When reviewing code, you must:

  1. Error Handling Review: Ensure proper error handling patterns are used. Check that:

    • Errors are never silently discarded with let _ = ...
    • unwrap() and panic! are avoided in favor of proper error propagation with ?
    • anyhow::Result is preferred over verbose Result<T, anyhow::Error>
    • Error contexts are preserved and meaningful
  2. String Formatting Standards: Verify modern Rust string interpolation is used:

    • Use format!("User {username} has {count} items") instead of format!("User {} has {} items", username, count)
    • Apply this to all macros: log::debug!, assert!, panic!, etc.
    • Avoid unnecessary named interpolation for direct field/method access
  3. Code Organization: Check that:

    • Flat module structure is preferred (src/module.rs over src/module/mod.rs)
    • New functionality is added to existing files when appropriate
    • File organization follows project conventions
  4. Testing Standards: Ensure:

    • Test functions don't use test_ prefix
    • Snapshot testing with insta is used for complex data validation
    • Multi-line strings use indoc! and formatdoc! macros
  5. Dependency Management: Verify:

    • Dependencies are added to workspace Cargo.toml with .workspace = true references
    • Features are enabled appropriately in individual crates
    • default-features = false is maintained in workspace definitions
  6. Nexus-Specific Patterns: Check for:

    • Proper MCP server integration patterns
    • Correct tool discovery and execution flows
    • Authentication handling for dynamic vs static tools

Your review should:

  • Identify specific violations with line-by-line feedback
  • Provide corrected code examples following the established patterns
  • Explain the reasoning behind each suggested change
  • Prioritize correctness and clarity over performance optimizations
  • Focus on maintainability and adherence to Rust best practices
  • Be constructive and educational, helping improve code quality

If the code follows all guidelines correctly, acknowledge this and highlight any particularly well-implemented patterns. Always provide actionable feedback that helps maintain the project's high code quality standards.

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. yesterday First seen · 51 lines · 0 tokens per session scan A b879c641c1a6

Subscribe to this mod's changes

rust-code-reviewer is an agent published in the GitHub repository Nexus-Router/nexus (435 stars, last pushed 5mo ago), licensed MPL-2.0. It adds 247 tokens to every session and 776 once invoked, about $0.0012 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-30.

Related

Other agents, from other repositories

atomic-reviewer

Reviews Atomic Agents Python code for framework-specific correctness — BaseIOSchema invariants, AtomicAgent/AgentConfig wiring, BaseTool generics, context-provider I/O hygiene, orchestration hazards, Instructor integration — using confidence-based filtering. Use PROACTIVELY after any change to atomic-agents code…

Eigenwise/atomic-agents · 126 tokens

atomic-explorer

Maps existing Atomic Agents Python codebases — catalogs agents, tools, schemas, context providers, and orchestration patterns; traces data flow between them; returns a compact architecture summary with file:line references. Use PROACTIVELY when the user asks to "explore", "map", "understand", "analyze", "trace", or…

Eigenwise/atomic-agents · 125 tokens

AGENTS

In-depth tutorials on LLMs, RAGs and real-world AI agent applications.

patchy631/ai-engineering-hub · 0 tokens

powersync-sync-reviewer

Use to review any change that touches PowerSync synced tables before merging — diffs that modify shared/powersync-tables.ts, a config.yaml sync rule, backend or frontend Drizzle schema, backend/drizzle migrations, the DAL/defaults/reconciliation for a synced table, sync middleware/transformers, or…

thunderbird/thunderbolt · 133 tokens

test-runner

Runs tests in the api-gateway Maven reactor — full/module unit runs, isolating a single core test class, or a single distribution/tutorial example test. Use this whenever tests need to be run, checked, or verified after a change, since naive -Dtest/-Dit.test invocations silently run (or skip) the wrong thing in this…

membrane/api-gateway · 82 tokens

demo-site

Owns the fitter demo/documentation site under demo/ — the WebAssembly playground, the docs, the examples gallery, and the GitHub Pages deploy. Use for any work on demo/index.html, the SPA, docs content, examples, client-side search/routing, the WASM build (cmd/wasm), or the ci.yaml pages job. Trigger phrases: "demo…

PxyUp/fitter · 97 tokens