Your agent writes bad Rust, this catches it.
Rust Doctor scans your Cargo workspace with 62 curated rules and finds issues across security, correctness, reliability, performance, maintainability, and dependencies. It ends on a score out of 100 and the three rules worth fixing first.
Works on any Cargo workspace - a single binary crate, a library, a virtual workspace with dozens of members, you name it.
Everything runs locally: no network, no upload, no telemetry. Inspect trusted local workspaces only, since Cargo runs the build scripts and procedural macros of whatever it compiles. Limits →
Install
1. Quick start
Run this at your workspace root to get an audit.
2. Install for agents
Once you have an audit, install the skill so your coding agent fixes what it found. The skill teaches it which finding to repair first, how the score is capped, and what to look for in a file the scan already flagged.
This writes .claude/skills/rust-doctor/ for Claude Code, from the binary rather than the network, and never over an existing skill.
For a one-off handoff instead, the report sends the findings straight to an agent, with the rules, their spans, and the scan scope already written into the prompt.
Works with Claude Code, Codex, and Cursor, and copies the same context to your clipboard for any other agent.
3. Run in CI
Rust Doctor reviews every pull request and reports only the issues your change introduced, not your existing backlog. Set it up from the report menu:
This writes .github/workflows/rust-doctor.yml, pinned to the version that wrote it, and never overwrites an existing file. The gate exits non-zero only when a diagnostic reaches the blocking level, which you change anytime with --blocking.
4. Configure rules
You can configure which rules to run and how to run them in rust-doctor.toml, or from the command line.
Privacy
The CLI reports nothing to anyone. No network call, no upload, no telemetry, no crash reporting, and nothing to opt out of. The binary carries no HTTP client and no analytics dependency.
A --json report stays inside your workspace and carries only:
- Diagnostics: rule id, category, severity before and after policy, and a workspace-relative path with its span
- Score: the number, its dimensions, the gate verdict, and the rules withheld from the ranking
- Errors: which pass failed and why, when one did
No absolute path, no environment variable, no user data.
Contributing
License
MIT OR Apache-2.0, at your option. See LICENSE-MIT and LICENSE-APACHE.