rust-anything Explained: Rewrite Your App in Rust and Prove It Behaves the Same
rust-anything rewrites your whole app in Rust, one piece at a time, and proves the Rust version behaves exactly like the original before anything ships. It records the original on generated edge cases, replays every case against the Rust, and only switches over when all cases match and the gate passes.

Key facts
- Project: rust-anything — “Rewrite your whole app in Rust, one piece at a time, checked against the original’s recorded behavior at every step.”
- Tagline: “Rewrite your app in Rust, and prove it still behaves the same.”
- Stars: 9,388 stars and 769 forks on GitHub, with 524 commits behind the project.
- Licence: MIT. Ports and generated code in your repo are yours.
- Created: 2026-11-16, with 19 releases, 19 tags, and
mainas the default branch. - Momentum: +7,924 stars in the week of 16-22 Nov (GhTrends weekly, #7); Trendshift #2 repository of the day, #1 Rust repo of day and week.
- Maker: Made in Türkiye by Erkam Yaman, sponsored by CodeRabbit. Independent project, not affiliated with or endorsed by the Rust Project or Rust Foundation. “Rust” is a trademark of the Rust Foundation.
- Docs: rust-anything.com
What is rust-anything and how does it work?
rust-anything rewrites your app in Rust one piece at a time while checking every step against the original’s recorded behaviour. Instead of a risky big-bang rewrite, you move one function, library or server at a time, and the Rust only takes over when it matches the original on every recorded case.
The workflow has four stages: Record, Port, Check and Lift. First, record runs the original on generated edge cases, semantic traps and your own inputs, and saves what it returns or throws. Next, bridge generates the Rust crate and wrapper so callers keep the original API while you, or your agent, write the Rust. Then diff replays every recorded case against the Rust, and nothing ships until all match and gate passes. Finally, app lift makes it a pure Rust app when replay passes with no fallback and every unit passes the gate — and the original is never touched.
That proof-first loop is what makes the project interesting to readers of the KongoTech homepage. Here, the recording is the proof: if a case differs, the Rust does not ship and the original keeps running.
Does rust-anything translate your code for you?
No, rust-anything does not translate code at all — your coding agent, such as Claude Code, Codex, Cursor or OpenCode, or you yourself, writes the Rust. The tool supplies everything around the writing: where time goes, what to port first and in which order, the bridge, the exact behaviour to match, safe shipping, and the gate.
That division of labour matters. An agent can write plausible Rust quickly, but plausible is not correct. The recorded cases define correct — return values, thrown errors and side effects — and diff replays them, reporting any mismatch.
Side effects are recorded too, with app record --effects. A rewrite that prints the same output but sends an email twice fails replay; in one documented example, 0 of 2 cases passed.
The honest limit: rust-anything can only catch what the recording covers. Generated edge cases, semantic traps and your own inputs make the net wide, and fuzzing widens it further, but an unrecorded input is an unchecked input. The gate is strong, not magical.
How do you port only the slow part of an app?
You run one command and rust-anything profiles the app, picks the outermost function worth moving, records it, and hands the Rust file to your agent:
rust-anything go --agent claude -- python3 app.py
That command profiles the run, picks the function where time actually goes, batches calls where the profile says batching helps, and records the original on generated inputs plus the calls your own run makes. It then hands src/port.rs to the agent — claude, codex, or any stdin-prompt command. Without --agent, it writes a TASK.md file and stops.
The care matters because calling Rust once per small function is usually slower than a JIT; the crossing cost dominates. rust-anything finds the loop worth moving, so the port is faster by design.
Afterwards, rust-anything report rust/dedupe-rs writes a REPORT.md and a card.svg summarising the port, and rust-anything disable rust/dedupe-rs switches back to the original byte for byte. The switch only happens when every case matches and the gate passes.

How fast are the real measured ports?
The measured ports are fast, and every number was taken on an Apple M4 with outputs compared before timing. Prettier 3.6.2 formatting 2,360 JS/TS files went from 128.6 seconds to 6.9 seconds (19x). Formatting 6,305 Markdown files went from 352 seconds to 22.5 seconds (15.6x). A 59-file demo went from 3.63 seconds to 0.20 seconds.
Coverage is reported just as openly. The Prettier port runs 15,861 of 17,224 recorded runs fully in Rust across 10 languages, and all 17,224 match byte for byte; the rest falls back to Prettier itself.
The json-server port is the clearest whole-app example: the entire Node server became one 5.3 MB Rust binary. Idle memory fell from 74 MB to 3.5 MB, start-to-first-response fell from 79-85 ms to 8-10 ms, and 514 of 514 recorded HTTP cases match. Fuse.js search over 50,000 strings went from 91.2 ms to 2.8 ms per query (32x).
Against C, the win is safety rather than speed, and the project says so. The ffmpeg libavutil port matches all 226,447 recorded calls at about C speed: of 42 benchmarks, 18 are even, 8 faster, and 16 slower by 3-40%.
Which ready-made ports can you install today?
Two ports are packaged for direct use: eslint-rs and prettier-rs. Install the ESLint port with:
npm install -g eslint-rs
It carries ESLint 10.15.0 with 90 ported rules in Rust; the other 202 core rules, plugins and parsers are handed to ESLint itself. It matches on all 10,585 recorded runs. Prebuilt binaries cover macOS arm64 and x64 plus Linux x64 and arm64 with glibc. On Windows and elsewhere it runs ESLint itself with the same output and no speedup.
The Prettier port is packaged as prettier-rs (Prettier 3.6.2, replays 17,224 of 17,224, 7.9% handed to Prettier, not on npm). You can make such packages from any CLI front door with rust-anything package.
This pattern sits alongside AG-UI and Stitch Skills for Google Stitch.
How do you install rust-anything and run your first port?
The fastest route is to ask your coding agent to install it: “Install rust-anything: run cargo install rust-anything, then rust-anything setup. Tell me when to restart you.” Setup registers it with Claude Code, Codex, Cursor, Gemini CLI and OpenCode, adds an MCP server and a skill, is safe to rerun, backs up files as <file>.rust-anything.bak, and can be undone with --remove.
To install it yourself, run cargo install rust-anything (crates.io), then rust-anything setup. Prebuilt binaries for macOS, Linux and Windows are on GitHub releases, and JavaScript projects can use npm install -g rust-anything. There is also a Claude Code plugin (/plugin install rust-anything --marketplace erkamyaman/rust-anything) and a Codex route: codex plugin marketplace add erkamyaman/rust-anything, then codex plugin add rust-anything@rust-anything.
The manual steps: profile with rust-anything profile . -- node bench.mjs, bridge with rust-anything bridge . src/fuzzy.ts --batch fuzzyScore:text, then rust-anything record rust/fuzzy-rs && rust-anything build rust/fuzzy-rs. Compare with rust-anything diff, widen coverage with rust-anything fuzz --time 60 --keep, measure with rust-anything bench, and finish with rust-anything gate. It is built on napi-rs, PyO3 and wasm-bindgen.
One warning: record and app record run your original code on many generated inputs, and app record runs every case twice. Code that writes files, talks to a database or calls the network does that once per case. Run recordings on a copy, with a test database and no production credentials.

Which languages does rust-anything support?
It supports TypeScript and JavaScript (napi-rs, wasm-bindgen), Python (PyO3 abi3), C (extern “C” header, ctypes, one fork per case), Go (typed cgo), Ruby (magnus), Java (typed JNI), Kotlin (Java bridge, kotlinc), PHP (JSON dispatcher over ext-ffi), PowerShell (P/Invoke, PowerShell 7.4+) and C# (P/Invoke, dotnet build, including ASP.NET servers).
Batch classes with --batch are available for every language except C, PHP, C# and PowerShell. The language is auto-detected (go.mod, pom.xml, build.gradle, .csproj/.sln, pyproject.toml, Gemfile, composer.json, package.json), and --lang overrides it.
PHP also supports whole apps through app record, replay and the front door, using php -S. An Android profile builds a JNI .so for arm64-v8a, armeabi-v7a and x86_64 (API minimum 26, needs NDK and an adb device) for logic units only — UI and lifecycle stay in Kotlin.
One caveat is measured, not guessed. In PHP, C# and PowerShell, each call crosses as JSON (about 1 µs PHP, 1-3 µs C#, about 0.1 ms PowerShell for a few scalars on an M4), so small functions can be slower in Rust. The bench command decides, case by case.
For teams comparing open tools, What Is Univer covers a similar spirit in the office-document world.
What should you watch out for before you start?
The project is young — created on 2026-11-16, with 19 releases and 19 tags already. Pin a version for any port you need to reproduce later.
Remember the coverage limit: the recording only proves what it covers. Add your own inputs, use the fuzz step to widen the net, and keep the original’s tests running too.
Finally, start small. Port the one hot function the profiler points at, watch it match every recorded case, read the report, and only then consider lifting a whole app to pure Rust.

Frequently asked questions
What is rust-anything?
rust-anything is an open-source tool that rewrites your app in Rust one piece at a time, checked against the original’s recorded behaviour at every step. It works on CLIs, HTTP servers and libraries in TypeScript, Python, C, Go, Ruby and Java.
Does rust-anything translate my code to Rust automatically?
No. Your coding agent — Claude Code, Codex, Cursor, OpenCode and others — or you write the Rust. rust-anything supplies where time goes, what to port first and in which order, the bridge, the exact behaviour to match, safe shipping and the gate.
How fast is a rust-anything port in practice?
On an Apple M4, with outputs compared before timing, Prettier 3.6.2 formatted 2,360 JS/TS files in 6.9 seconds instead of 128.6 seconds (19x), and Fuse.js search over 50,000 strings went from 91.2 ms to 2.8 ms per query (32x).
How do I install rust-anything?
Run cargo install rust-anything, then rust-anything setup, which registers it with Claude Code, Codex, Cursor, Gemini CLI and OpenCode. Prebuilt binaries for macOS, Linux and Windows are on GitHub releases, and JavaScript projects can use npm install -g rust-anything.
Is rust-anything safe to run on my codebase?
Yes by design: the original is never touched, the Rust only switches on when every recorded case matches and the gate passes, and rust-anything disable returns to the original byte for byte. Run record on a copy with a test database and no production credentials.