← Academy erkamyaman /rust-anything11,308MIT or Apache-2.0Rust

rust-anything

Move the slow part of your app to Rust without breaking it

A free tool records what your code does, lets your coding agent port the slow part to Rust, and switches the port on only when every recorded case matches. In its own test, Prettier went from 128.6 to 6.9 seconds with byte-identical output.

Rewriting code for speed is easy to start and hard to trust. The new version runs faster, and then a user finds the one case it handles differently. rust-anything, by Erkam Yaman, works the other way round. It first records what your original code does, then lets your coding agent port one slow piece to Rust, replays every recorded case against the port and turns the port on only when all of them match.

Prettier on 2,360 files, before
128.6 s
after, byte-identical output
6.9 s
Fuse.js cases, all matching
3,414
stars on GitHub
10K+
erkamyaman /rust-anythingPublicRewrite your app in Rust, piece by piece, checked against the original at every step
Language
Rust
Stars
11,308 on 29 Nov 2026
License
MIT or Apache-2.0
Best for
Node.js, TypeScript and Python apps with a slow hot path; Go, Ruby, Java and C also work
Needs
Node.js or Rust's cargo, a Rust toolchain, a coding agent such as Claude Code
Open on GitHub ↗

How it works

Profile

  1. 01Real run: it times a real command of your app and picks the slow function

→ the piece to port

Record

  1. 02Original: what it returns, throws and changes, case by case

→ the cases

Port

  1. 03Agent: Claude Code writes the Rust version of that one piece

→ a port

Check

  1. 04Diff and gate: every case replayed
  2. 05copied answers, deleted tests and unsafe code refused

→ pass or fail

Enable

  1. 06Switch: callers get the Rust version with no import changes

→ on, or back off

The checking step is the point. A port could "pass" by answering the recorded cases from a table, deleting a failing test or editing the recording. The gate command looks for each of those and fails the port when it finds one.

Where the numbers come from

The figures are rust-anything's own measured results. Prettier ran 128.6 seconds on 2,360 files before and 6.9 seconds after, with byte-identical output. Fuse.js matched on all 3,414 recorded cases and searched 50,000 strings in 2.8 ms instead of 91.2 ms. Its documentation is also clear that the gain comes from batches: a tiny function called once can be slower in Rust, because every call crosses a bridge.


(01)Install

npm install -g rust-anything   # or: cargo install rust-anything
rust-anything setup

setup adds it to Claude Code, Codex, Cursor, Gemini CLI and OpenCode.

(02)Hand it to your agent

Paste this into Claude Code, with your app's slow command in place of the brackets. It is the README's own prompt:

Install Rust Anything with npm i -g rust-anything, then run rust-anything setup. Run rust-anything go -- <slow command of this app> and finish the port until rust-anything gate passes.

(03)Check it, or undo it

rust-anything diff <crate>     # replay every recorded case against the port
rust-anything gate <crate>     # fail ports that cheat or skip tests
rust-anything disable <crate>  # put your original files back, byte for byte

Before you start

How you know it is done

  • Work on a copy with a test database. Recording runs your real code, side effects included.
  • Faster is not guaranteed for every function. Small functions called one at a time can get slower.
  • Node.js, TypeScript, Python, C, Go, Ruby and Java are supported; PHP, C# and Kotlin are in preview.
  • The ported code in your repository is yours.
Stars
11,308 on 29 Nov 2026
License
MIT or Apache-2.0
Install
npm install -g rust-anything, then rust-anything setup
Start
rust-anything go --

Common questions

Got any questions left?

Is it free?

Yes. It is open source under MIT or Apache-2.0, your choice.

Do I need to know Rust?

Your agent writes the Rust. Knowing a little helps you read the port before you ship it.

Will my app break?

The port only switches on when every recorded case matches, and disable puts the original back. Cases you never recorded are not checked, so record the real ways your app is used.

Does it rewrite the whole app?

It starts with the slow part. A separate command can turn a whole server into one Rust binary, which it shows on json-server.

Who made it?

Erkam Yaman, an independent developer. It is not an official Rust project.

Build systems that run your brand__

info@hybrdstudio.com
Share article X LinkedIn

Discover more