rust-anything will not let an agent call a Rust rewrite done until it matches a recording
A tool for porting apps to Rust one piece at a time. It records what the original does, then replays every case against the Rust before the next piece moves.
“Rewrite it in Rust” is an easy thing to ask a coding agent and a hard thing to check. rust-anything, by Erkam Yaman, is built around the checking. It does not translate any code. It records how the original program behaves, and it refuses to pass a Rust replacement that behaves differently.
How it works
The README lays out four steps.
Record: the original runs on generated edge cases, tricky inputs, and inputs you supply. Its outputs and exceptions are saved.
Port: a bridge command generates a Rust crate plus a wrapper, so existing callers keep using the original API. The Rust itself is written by a person or an agent.
Check: diff replays every recorded case against the Rust version. A piece ships only when all cases match and a gate command passes.
Lift: once replay passes with no fallback to the original and every unit has cleared the gate, app lift produces a pure Rust app. The original is left untouched.
The useful part is the middle state. Because each ported piece sits behind a wrapper, anything not yet ported falls back to the original code, and the app keeps working while it is half Rust. A profile command looks for hot loops, since the README says plainly that calling Rust once per small function is often slower than a JIT. A setup command registers an MCP server and a skill with Claude Code, Codex, Cursor, Gemini CLI, and OpenCode.
It handles CLIs, HTTP servers, and libraries in TypeScript/JavaScript, Python, C, Go, Ruby, and Java.
The numbers, and what they cover
These are the author’s figures, measured on an Apple M4 with two runs each.
| Project | Original | With rust-anything |
|---|---|---|
| Prettier, 2,360 JS/TS files | 128.6 s | 6.9 s |
| Prettier, 6,305 Markdown files | 352 s | 22.5 s |
| json-server, memory at idle | 74 MB | 3.5 MB |
| Fuse.js, 50,000 strings, per query | 91.2 ms | 2.8 ms |
The headline is 17,224 recorded Prettier runs with zero mismatches. Read the next line of the README too: 15,837 of those are formatted entirely in Rust, and the rest match because they fall back to Prettier itself. The json-server port is the complete one, with 514 of 514 recorded HTTP cases matching on a pure Rust binary.
The README states the limit: the tool can only catch behavior the recording covers. A matching replay is evidence about the cases you recorded, not a proof about the ones you did not.
There is also a warning worth repeating. Recording, diffing, gating, and replaying all run the code again. Code that writes files, touches a database, or calls the network will do so once per case. The README says to run these only on a copy, with a test database and no production credentials.
Try it yourself
The repo is MIT licensed and was created on November 16. It already shows 256 commits and about 4,400 stars. Install with cargo install rust-anything or npm install -g rust-anything, or take a prebuilt binary for macOS, Linux, or Windows. PHP and C# bridges are listed as coming next.
We have not run it or reproduced the benchmarks. This is based on the README and the commit history.