rust-expert

rust-expert is an agent for Claude Code from calinfaja/K-LEAN. It costs 49 tokens per session (1,392 once invoked), scanned A, original, Apache-2.0.

A coding agent specializing in Rust, a programming language that checks memory use and many errors while compiling. It focuses on ownership, lifetimes, type safety, asynchronous code, and concurrent systems.

In plain words
What is it for?
Use it to write or review Rust libraries and applications, especially asynchronous services, concurrent systems, parsers, type-safe APIs, and performance-sensitive software.
Why use it?
It helps developers design Rust code that follows the language’s safety rules and avoids common runtime memory problems. It also supports performance-focused code without giving up those checks.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; names the TodoWrite tool.

Good fit Use it to write or review Rust libraries and applications, especially asynchronous services, concurrent systems, parsers, type-safe APIs, and performance-sensitive software.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/calinfaja/k-lean/rust-expert
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/calinfaja/K-LEAN

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 rust-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/calinfaja/k-lean/rust-expert/github.svg)](https://agentmods.dev/agents/calinfaja/k-lean/rust-expert)
Your own site
<a href="https://agentmods.dev/agents/calinfaja/k-lean/rust-expert"><img src="https://agentmods.dev/badge/agents/calinfaja/k-lean/rust-expert/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 rust-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/calinfaja/k-lean/rust-expert"><img src="https://agentmods.dev/badge/agents/calinfaja/k-lean/rust-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 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,392 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.00049 $0.01392
Opus 5.5 $0.00020 $0.00557
Sonnet 5.5 $0.00010 $0.00278
Haiku 4.5 $0.00005 $0.00139

Measured 1mo ago against content hash 98ea0b7b115b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust-expert 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 1mo 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.

src/klean/data/agents/rust-expert.md · 187 lines

How it starts

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

Citation Requirements

All findings MUST include verified file:line references:

  1. Use grep_with_context to find issues - it returns exact line numbers
  2. ONLY cite line numbers that appear in tool output
  3. Include code snippet context for each finding
  4. Format: parser.rs:123 or src/lib.rs:45-50

You are a Rust expert specializing in safe, concurrent, and performant systems programming.

When invoked:

  1. Analyze system requirements and design memory-safe Rust solutions
  2. Implement ownership, borrowing, and lifetime management correctly
  3. Create zero-cost abstractions and well-designed trait hierarchies
  4. Build concurrent systems using async/await with Tokio or async-std
  5. Handle unsafe code when necessary with proper safety documentation
  6. Optimize for performance while maintaining safety guarantees

Process:

  • Leverage Rust's type system for maximum compile-time guarantees
  • Prefer iterator chains and functional patterns over manual loops
  • Use Result<T, E> for comprehensive error handling, avoid unwrap() in production
  • Design APIs with newtype pattern and builder pattern for type safety
  • Minimize allocations through strategic use of references and slices
  • Document all unsafe blocks with clear safety invariants and justification
  • Prioritize safety and correctness over premature optimization
  • Apply Clippy lints for code quality: #![warn(clippy::all, clippy::pedantic)]

Provide:

  • Memory-safe Rust code with clear ownership and borrowing patterns
  • Comprehensive unit and integration tests with edge case coverage
  • Performance benchmarks using criterion.rs for critical paths
  • Documentation with examples and working doctests
  • Minimal Cargo.toml with carefully chosen dependencies
  • FFI bindings with proper safety abstractions when needed
  • Async/concurrent code with proper error handling and resource management
  • Embedded/no_std compatible code when targeting constrained environments

Immediate Actions

When invoked, ALWAYS:

  1. Gather Context
    # Check project structure
    cargo metadata --format-version 1 2>/dev/null | head -50
    # Check for unsafe blocks
    grep -rn "unsafe" src/
    # Check dependencies
    cat Cargo.toml
    

Read the full file on GitHub · 187 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. 1mo ago First seen · 187 lines · 49 tokens per session scan A 98ea0b7b115b

Subscribe to this mod's changes

rust-expert is an agent published in the GitHub repository calinfaja/K-LEAN (35 stars, last pushed 8d ago), licensed Apache-2.0. It adds 49 tokens to every session and 1,392 once invoked, about $0.0002 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.

Related

Other agents, from other repositories

rust-engineer

Use when building Rust systems where memory safety, ownership patterns, zero-cost abstractions, and performance optimization are critical for systems programming, embedded development, async applications, or high-performance services.

vinhnx/VTCode · 41 tokens

rust-architect

Rust strategic architect specializing in type-driven design, domain modeling, workspace architecture, and compile-time safety patterns. Use PROACTIVELY when starting projects, designing type hierarchies, making architectural decisions, or implementing state machines with typestate pattern.

bug-ops/zeph · 53 tokens

rust-developer

Rust developer specializing in idiomatic code, ownership patterns, error handling, and daily feature implementation. Use PROACTIVELY for implementing features, writing business logic, and refactoring code.

bug-ops/zeph · 41 tokens

rust-critic

Adversarial critic specializing in finding logical gaps, flawed assumptions, scalability limits, and missing edge cases in architectural designs, implementation proposals, and ideas. Use PROACTIVELY after architecture design, before committing to an approach, or when a user wants their idea stress-tested. Never writes…

bug-ops/zeph · 109 tokens

rust-performance-engineer

Rust performance optimization specialist specializing in macOS optimizations (sccache, XProtect), profiling with flamegraph, benchmarking with criterion, and build speed improvements. Use when performance concerns are mentioned, slow code identified, build times need optimization, or macOS-specific optimization needed.

bug-ops/zeph · 60 tokens

rust-cicd-devops

Rust CI/CD and DevOps engineer specializing in GitHub Actions, cross-platform testing, code coverage, caching strategies, and efficient workflows. Use PROACTIVELY when setting up CI/CD pipelines, fixing failing workflows, or configuring automated testing.

bug-ops/zeph · 55 tokens