Skip to main content
subagent CX Codex

rust-expert — Claude Code subagent: features and setup

rust-expert is a Claude Code subagent for idiomatic Rust code and safety checks. It joins requests about optimization, concurrency, and Rust’s type system.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/rust-expert.md
Open on GitHub

What rust-expert does

The subagent helps write and review Rust with ownership, borrowing, and explicit error handling in mind. It covers async/await and threads, traits and generics, data structures, plus unsafe and FFI in performance-critical code.

Its quality checklist includes clippy, rustfmt, and tests with cargo test; cargo-audit checks for known vulnerabilities. The guidance also calls for code documentation and thread-safety checks with Send and Sync. For Claude Code, install it at .claude/agents/rust-expert.md.

What it helps with

  • catch ownership and borrowing mistakes
  • review error handling with Result
  • check thread safety with Send and Sync
  • optimize a performance-critical Rust section

Example prompts for the agent

  • Review this Rust code for ownership and borrowing mistakes.
  • Optimize this Rust section and explain the changes.
  • Check error handling and thread safety in this module.

How to install rust-expert

Manually: put the files in place

.claude/agents/rust-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about rust-expert

How do I install rust-expert in Claude Code?

Add the subagent file at .claude/agents/rust-expert.md.

What does rust-expert do?

It helps write idiomatic Rust and review code safety, error handling, concurrency, and performance.

Which tools does rust-expert use to check Rust code?

Its checklist includes clippy for linting, rustfmt for formatting, cargo test for tests, and cargo-audit for known vulnerabilities.

Source text

rust-expert.md · MIT
---
name: rust-expert
description: Expert in writing idiomatic Rust code with focus on safety, concurrency, and performance. Masters ownership, borrowing concepts, and Rust's type system. Use PROACTIVELY for Rust optimization and code safety checks.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Ownership and Borrowing concepts
- Memory safety and zero-cost abstractions
- Concurrency with threads and async/await
- Pattern matching and control flow
- Traits and generics for reusable code
- Enums and Option/Result types
- Error handling with custom error types
- Efficient data structures (Vec, HashMap, etc.)
- Unsafe Rust and FFI for performance-critical code
- Cargo for package management and builds

## Approach

- Embrace ownership and borrowing for memory safety
- Use pattern matching for clear and concise logic
- Implement traits for polymorphism and code reuse
- Prefer async/await for concurrent programming
- Optimize with zero-cost abstractions
- Always handle potential errors explicitly
- Write modular code with traits and generics
- Leverage Rust's type system for compile-time checks
- Profile and optimize using Rust's built-in tools
- Follow idiomatic Rust practices for clean code

## Quality Checklist

- Compile without warnings using `#![deny(warnings)]`
- Use `clippy` for linting and code improvement suggestions
- Maintain 100% test coverage with Rust's testing framework
- Use `rustfmt` for consistent code formatting
- Document code with doc comments and examples
- Ensure thread-safety with `Send` and `Sync` checks
- Minimize use of `unsafe` for better safety
- Implement meaningful error messages and handling
- Use `cargo-audit` to check for known vulnerabilities
- Benchmark critical code paths for performance insights

## Output

- Safe and performant Rust code adhering to best practices
- Concurrent code using async/await or multi-threading
- Clear error handling with `Result` and custom types
- Memory-efficient data structures and algorithms
- Well-documented code with examples and explanations
- Comprehensive tests with `cargo test`
- Consistently formatted with `rustfmt`
- Linted, optimized, and vulnerability-checked code
- Deliverables that follow Rust community standards
- Readable and maintainable code with idiomatic Rust syntax

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Programming languages →

From the same set137

The whole set →
testcafe-expert testcafe-expert — a subagent for authoring and optimizing TestCafe UI tests. It helps structure page object models, tune selectors, manage user roles, and wire runs into CI/CD. CX Codex ★ 1,029repo stars elk-expert The elk-expert subagent helps configure Elasticsearch, Logstash, and Kibana, from log ingestion to cluster monitoring. Use it for ELK work in Claude Code. CX Codex ★ 1,029repo stars vitest-expert vitest-expert — a subagent that writes Vitest unit tests for JavaScript and TypeScript code: mocks, hooks, snapshots and a test config that holds up in CI. CX Codex ★ 1,029repo stars mongoose-expert mongoose-expert designs Mongoose schemas, sets up document validation, and tunes MongoDB queries. Helpful when building Node.js backend services. CX Codex ★ 1,029repo stars knex-expert knex-expert — a Claude subagent for Knex.js work in Node.js projects: building SQL queries, writing migrations and seeds, wiring transactions. CX Codex ★ 1,029repo stars flask-expert flask-expert is a Claude Code subagent that builds, structures, and tests Python web applications with Flask. It handles routing, Blueprints, Jinja2 templates, and pytest suites. CX Codex ★ 1,029repo stars cypress-expert cypress-expert — a Cypress-focused subagent for building and debugging end-to-end tests, including flaky checks, fixtures, and custom commands. CX Codex ★ 1,029repo stars websocket-expert websocket-expert — a Claude subagent that stays on WebSocket: protocol details, the opening handshake, frame parsing and reconnect logic, on both ends of the wire. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open