Independent AI intelligence Two editions daily · ET
Fervor AI

Analysis · November 19, 2026 · repo

rust-anythingclaude-codecodexai-skillsmcp

rust-anything Checks Whether Your AI Agent's Rust Rewrite Actually Works

A new open-source tool turns "rewrite it in Rust" into a checked, step-by-step job for Claude Code or Codex. Its most useful feature is the warning about what it can't check.

Coding agents will happily rewrite your app in another language. That was never the hard part.

The hard part is knowing the rewrite does the same thing. An agent can produce a Rust version of your Node service in an afternoon, and it will compile, and the happy-path test will pass. Then a user sends a name with a Turkish dotless "ı", or a float that formats as 1e21, and the new version answers differently from the old one. Nobody notices until production does.

rust-anything is built around that problem. It sat at #3 on Trendshift's daily GitHub board when checked at about 3:15 PM ET on November 19, the same day it tagged v2.0.2. It's MIT-licensed and had about 5,000 stars on its GitHub page that day.

Its idea is simple enough to say in one line: before anyone writes Rust, record what the original program actually does, then refuse to move on until the Rust matches the recording.

That makes the recording the spec. And it means the most important question about any port isn't "did the agent write good Rust?" It's "what did we forget to record?"

What it is, in plain terms

rust-anything is a command-line tool plus an MCP server (a small program that gives an AI agent new tools to call) and a workflow skill for your coding agent. It ports apps and libraries written in TypeScript or JavaScript, Python, C, Go, Ruby or Java into Rust, one piece at a time. PHP and C# are supported for whole-app recording and replay today, with unit porting listed as "coming next."

One thing to be clear on: it doesn't translate code itself. The README says it directly: "rust-anything does not translate code: your coding agent (Claude Code, Codex, Cursor, OpenCode, ...) or you write the Rust." What the tool supplies is everything around the writing. It finds where the time goes, decides what to port first, records behavior, and checks each piece.

Picture a translator working on a contract. A good editor doesn't rewrite the translation. They hold the original next to it and check every clause. rust-anything is the editor, and the agent is the translator.

How the check works

The how-it-works doc lays out the pipeline as a row of commands. The ones that matter:

  • record runs the original code on lots of generated inputs (edge cases such as non-ASCII text, emoji, -0 and NaN) and on "semantic traps" (inputs known to trip up ports, like tricky Unicode and float formatting), then saves what it returns or throws.
  • bridge generates a Rust crate and a wrapper, so the rest of your code keeps calling the same API it always did.
  • diff replays every recorded case against the Rust version. Every case must match.
  • shadow runs both versions side by side, returns the original's answer, and reports mismatches, which is how you can try the Rust in a real workload without trusting it yet.
  • gate is the finish line: formatting, clippy with warnings as errors, tests, an unsafe audit, nothing left unported, and more.

For whole apps, there's a "front door": a Rust entry point that answers each request in Rust where a piece is ported and falls back to the original where it isn't. The docs note that a half-done port "still answers every case, through the original where Rust is missing, so it can ship at every step." When replay passes with no fallback and every unit passes gate, app lift removes the original and leaves a pure Rust app. Until then it refuses and tells you what's blocking it.

The headline result is Prettier, the popular code formatter. The README reports a Rust port that formats 2,360 JavaScript and TypeScript files in 6.9 seconds against Prettier's 128.6, which it rounds to 19x faster. Read the fine print, though. Those are the author's own measurements on an Apple M4, two runs each. And only 15,837 of the 17,224 recorded runs format fully in Rust. All 17,224 match Prettier byte for byte because the unported parts fall back to Prettier itself.

That fine print isn't a gotcha. It's the tool being honest about the point of this article.

The insight: a pass means "matches the recording," nothing more

The doc has a section titled "What it can't catch", and it opens with this: "Passing means the Rust matches every case that was recorded, nothing more."

Most testing tools leave that sentence out. It's the most useful one in the repo.

The list that follows reads like a map of where rewrites actually break:

  • Inputs nobody recorded. Generated cases, the original's tests and your own inputs "are the ceiling." The doc adds that "the user input that breaks prod is rarely one a generator thinks of."
  • Regular expressions. Rust's regex crate has no lookaround or backreferences, and even patterns that compile can treat non-ASCII text differently from JavaScript, Python or Java. A port can pass every recorded case and still differ on a Turkish dotless "ı" or a zero-width joiner.
  • Floats. Number-to-text formatting differs between languages (1e21, -0, digit counts).
  • Anything not in the output. Timing, memory and behavior under load aren't compared at all.
  • Side effects you didn't record. Outgoing HTTP calls, email and database writes are compared only if you record them.

Put those together and the shift is clear. With an agent writing the code, writing code is cheap. Deciding what "the same behavior" means is the expensive part, and it's yours. The recording is where that decision lives.

Put this into practice

Start on a copy. The README has a warning box for a reason: record runs your original code on many generated inputs, app record runs every case twice, and "code that writes files, talks to a database or calls the network does that once per case." Use a test database and keep production credentials out of the environment.

1. Install and register it with your agent.

cargo install rust-anything
rust-anything setup

setup adds the MCP server and installs the workflow skill for Claude Code, Codex, Cursor, Gemini CLI and OpenCode, wherever it finds them. In Claude Code you can install it as a plugin instead: /plugin install rust-anything --marketplace erkamyaman/rust-anything. For Node projects, npm install -g rust-anything installs the same binary.

2. Find the hot path before porting anything.

rust-anything profile . -- node bench.mjs

The README is blunt that calling Rust once per small function is often slower than a JIT (the engine that makes JavaScript fast). The win usually comes from moving one loop. Port that first.

3. Widen the recording before the agent writes a line. This is the step people will skip, and it's the one that matters. Feed it real inputs with --inputs (production samples, bug-report payloads, real files), and pull in your existing test suite with record --from-tests. Every input you add raises the ceiling on what a pass actually proves.

4. Record side effects for anything that talks to the world. The whole-apps doc shows how:

rust-anything app record . --effects http,smtp --effect-env WEBHOOK_URL=http-url \
  --db-reset "sh scripts/reset-db.sh" --db-dump "sqlite3 app.db .dump" -- python3 app.py

This runs a local HTTP sink (a fake server that just records whatever it receives) and a local mail server, then records every request and email per case, and dumps the database after each one. The README shows why it matters: a rewrite that prints the same output but mails twice fails replay at 0 of 2 cases. Same answer on screen, different behavior in the world, and now you'd catch it.

5. Let the agent write, then hold the line at gate. Ask your agent to port the first unit, then run:

rust-anything diff rust/<crate>     # every recorded case must match
rust-anything bench rust/<crate>    # is it actually faster?
rust-anything gate rust/<crate>     # done means this passes

When a case fails, resist the urge to let the agent "fix" the recording. The recording is the original program's behavior. The Rust is what has to change.

Honest limitations

It only knows what you recorded. That's the whole thesis, and the README says so on its front page. If your users send inputs your recording doesn't cover, a passing port proves nothing about them.

The speed numbers are the author's own. The Prettier, Fuse.js and json-server figures come from one machine (an Apple M4) and two runs each. They're a good sign, not a promise for your code.

Load behavior isn't compared. A Rust port can match every recorded output and still behave differently under concurrency or memory pressure. You need your own load tests for that.

Changing the original means re-recording. record saves a fingerprint of the original's files. If the original changes, diff warns and gate fails until you record again. That's correct behavior, but on a codebase that still ships features, expect to re-record often.

Recording isn't free. Every generated case runs your real code, and app record runs each case twice to spot values that change between runs (times, IDs). With database reset and dump turned on, cases run one at a time. Big apps take a while.

Some languages are half supported. PHP and C# can be recorded, replayed and put behind a Rust front door today, but porting their individual units is still listed as "coming next."

HTTPS traffic needs extra wiring. The HTTP sink can't read HTTPS sent through its proxy. It records only CONNECT host:443 (the opening of an encrypted connection) and refuses it, so point the app's HTTPS settings at the sink with --effect-env or those calls go unrecorded.

Wildcards weaken the proof. When the original gives different values across its two runs (times, IDs), record turns them into wildcards, and a varying number of lines becomes a ... that matches anything. Read every one it lists. A hash-order or concurrency difference is exactly what can change for real in a port.

Before you ask an agent to rewrite anything

rust-anything is a smart answer to the question every agent-driven rewrite raises: how do you know it worked? Its answer is to stop trusting the code and start trusting a recording.

So spend your effort where it counts. Before you let Claude Code or Codex write a single line of Rust, spend an hour on the recording. Add the ugly production inputs, the old bug reports, the test suite, and the emails and webhooks the app sends. Then let the agent go.

The port will only ever be as good as what you thought to record.

Sources: erkamyaman/rust-anything README at v2.0.2; How it works, including "What it can't catch"; Whole apps, side effects; Real-world benchmarks; LICENSE (MIT). Reviewed version: v2.0.2, November 19, 2026. Star count from the GitHub page that day; Trendshift rank read at about 15:15 ET.