rust-anything is an MIT-licensed command-line tool by erKam Yaman that ports a program to Rust, or only its slowest function, one piece at a time: it records what the original does, your coding agent writes the Rust, and a piece is switched on only when every recorded case matches (README). The repository was created on November 16, 2026, and version 4.1.0 reached crates.io and npm on November 24 (crates.io, npm). What follows is what the author reports, plus the commands from his docs.
Applies to: rust-anything 4.1.0, README and docs read on November 25, 2026. Last checked: November 25, 2026.
On this page
The loop the agent follows
The tool does not translate code. The README says your coding agent (Claude Code, Codex, Cursor, Gemini CLI or OpenCode) or you write the Rust, while rust-anything supplies where the time goes, what to port first, the bridge that keeps the original API, the recorded behavior to match and a gate that says when a port is done. The steps, from its How it works page:
| Step | Command | What the docs say it does |
|---|---|---|
| Profile | rust-anything profile <repo> -- node bench.mjs | Runs a real workload under the language’s profiler and lists hot functions and their callers |
| Plan | rust-anything analyze <repo> | Lists units, port order and risks with file:line |
| Bridge | rust-anything bridge <repo> <unit> | Creates the Rust crate, the bindings and port.rs stubs |
| Record | rust-anything record <crate> | Runs the original on generated edge cases and saves the results as cases.jsonl |
| Diff | rust-anything diff <crate> | Replays every recorded case against the Rust and lists mismatches |
| Gate | rust-anything gate <crate> | Runs fmt, clippy, tests and an unsafe audit, and checks behavior; done means this passes |
| Switch | rust-anything enable <crate> / disable <crate> | Turns a gated TS/JS, Python or PowerShell port on for every caller, and off again byte for byte |
Between record and diff the agent writes src/port.rs. The README’s own example for a TypeScript file:
rust-anything profile . -- node bench.mjs # what is hot, and who calls it
rust-anything bridge . src/fuzzy.ts --batch fuzzyScore:text
# write src/port.rs (or let your agent), then:
rust-anything record rust/fuzzy-rs && rust-anything build rust/fuzzy-rs
rust-anything diff rust/fuzzy-rs # every recorded case must match
rust-anything fuzz rust/fuzzy-rs --time 60 --keep # fresh inputs: what the recording missed
rust-anything bench rust/fuzzy-rs # faster? the verdict says
rust-anything gate rust/fuzzy-rs # done means this passes
Install it and register it with your agent
The quick start offers a prompt you paste into the agent, or two commands:
cargo install rust-anything # from crates.io
rust-anything setup # registers it with Claude Code, Codex, Cursor, Gemini CLI and OpenCode
Prebuilt binaries are attached to each GitHub release, and npm install -g rust-anything installs the same binary. According to the README, setup adds an MCP server to each agent it finds and installs a workflow skill where the agent reads skills:
| Agent | What rust-anything setup adds, per the README |
|---|---|
| Claude Code | MCP server in ~/.claude.json, skill in ~/.claude/skills/ |
| Codex | MCP server in ~/.codex/config.toml, skill in ~/.codex/skills/ |
| Cursor | MCP server in ~/.cursor/mcp.json |
| Gemini CLI | MCP server in ~/.gemini/settings.json |
| OpenCode | MCP server in ~/.config/opencode/opencode.json, skill in ~/.config/opencode/skills/ |
Before changing a file that exists, setup saves a copy beside it as <file>.rust-anything.bak; --no-backup skips the copy. It is safe to run again, and rust-anything setup --remove takes out only its own entries, leaving the saved copies in place (install docs).
The README also lists plugin routes. In Claude Code:
/plugin install rust-anything --marketplace erkamyaman/rust-anything
In Codex, from the agents marketplace in the repository:
codex plugin marketplace add erkamyaman/rust-anything
codex plugin add rust-anything@rust-anything
To add only the MCP server to one project, the install docs give this .mcp.json:
{ "mcpServers": { "rust-anything": { "command": "rust-anything", "args": ["mcp"] } } }
Warning
setupedits your agents’ global config files, and the server it registers runs commands on your machine. Anthropic’s MCP docs say to verify that you trust each server before connecting it, because servers that fetch external content can expose you to prompt injection (Claude Code MCP docs). Read the repository first, runsetupon a machine where the backup copies are acceptable, and see Claude Code MCP and Codex MCP for how each client scopes servers.
Warning
The README warns that
record,app record,diff,gateandapp replayrun your original code on many generated inputs, and code that writes files, talks to a database or calls the network does that once per case. It says to run them on a copy of the project, with a test database and no production credentials in the environment (README).
Port only the slow part
You do not have to rewrite the whole app. The README’s go command profiles a command you give it, picks the outermost function worth moving, records it and hands src/port.rs to an agent:
rust-anything go --agent claude -- python3 app.py
--agent takes claude, codex or any command that reads a prompt on stdin; without it, the tool writes TASK.md and stops. It switches the function on only when every recorded case matches and gate passes. Afterwards rust-anything report rust/dedupe-rs writes REPORT.md and card.svg for a pull request, and rust-anything disable rust/dedupe-rs goes back to the original (README).
The FAQ is plain that Rust is not always faster: a small function called once per item is often slower, because each call crosses a bridge, so profile looks for the loop around it and bench gives a verdict before you ship.
Numbers the author reports
These are the author’s own measurements on an Apple M4, taken from the README’s table. They have not been reproduced here.
| Project | Original | With rust-anything |
|---|---|---|
| Prettier 3.6.2, 2,360 JS/TS files from the command line | 128.6 s | 6.9 s |
| Prettier, 6,305 Markdown files | 352 s | 22.5 s |
| Fuse.js search over 50,000 strings, per query | 91.2 ms | 2.8 ms |
| json-server, memory at idle | 74 MB | 3.5 MB |
For Prettier the README says 15,861 of 17,224 recorded runs format fully in Rust and all 17,224 match Prettier byte for byte, since anything not ported falls back to Prettier. Against C, the author writes that the win is safety rather than speed (README, real-world ports).
What a recording does not prove
The How it works page lists its own limits. A passing run means the Rust matches every case that was recorded, nothing more:
- Inputs nobody recorded. The ceiling is the generated cases, the original’s test suite (
record --from-tests) and your own--inputs; the docs suggest adding production samples and bug reports. - Regexes. The
regexcrate has no lookaround or backreferences, and a pattern that compiles can still treat non-ASCII text differently from JavaScript, Python or Java. - Anything not in the output. Timing, memory and concurrency under load are not compared. Outgoing HTTP calls, email and database state are compared only when you record them, for example with
app record --effects http,smtp. - Other platforms. A recording proves behavior on the machine that ran it.
For whole apps, the whole-app docs describe a longer path: the agent asks decisions in rounds and writes them to rust/DECISIONS.md, tracks units in rust/MAP.md, and app lift produces a pure Rust app once replay passes with no fallback. For where Claude Code and Codex read skills from, see Claude Code skills and Codex skills; servers for other jobs are listed in the MCP directory.





