Last updated: 11/23/2026Last verified: 2026-11-23

rust-anything

rust-anything Overview: Port an App to Rust One Piece at a Time

0
0

CLI that ports an app to Rust one piece at a time and proves each piece: it records what the original does, your coding agent writes the Rust, and every recorded case must match before the port is switched on. Ships an MCP server and a workflow skill for Claude Code, Codex, Cursor, Gemini CLI and OpenCode.

Free

What is rust-anything?

rust-anything is a free, MIT-licensed command-line tool that moves an existing app to Rust one piece at a time. It profiles a real run, generates the Rust crate and the bridge, records what the original does on generated edge cases plus your own inputs, and replays every recorded case against the Rust port before that piece is switched on. It does not translate code: your coding agent (Claude Code, Codex, Cursor, Gemini CLI or OpenCode) or you write the Rust. Distribution and docs live on GitHub, npm and crates.io (both registries at 3.3.0; release v3.3.0 published 2026-11-22); there is no standalone product site, and the repo's homepage field points at the npm package page.

Key Features

  • Recording and replay: record saves what the original returned or threw for generated edge cases and your own inputs, diff replays each case the way the original caller saw it, and the port is only enabled when every recorded case matches.
  • Hot-function mode: rust-anything go --agent claude -- python3 app.py profiles the run, picks the outermost function worth moving, records its cases and hands src/port.rs to the agent (claude, codex, or any command that reads a prompt from stdin); without --agent it writes TASK.md and stops.
  • Full pipeline in one CLI: profile, analyze, bridge, record, diff, fuzz, bench, shadow and gate, then enable or disable; disable removes the lines enable added and restores the file byte for byte.
  • Whole-app mode for servers and CLIs: analyze --whole-app, app record, app front-door, app wire and app lift, so it is not limited to single functions.
  • Languages from the README table: TypeScript/JavaScript, Python, C, Go, Ruby, Java and Kotlin for unit ports, with PHP and C# handled as unit ports through FFI and P/Invoke.
  • Agent integration: rust-anything setup registers the MCP server (rust-anything mcp) and a workflow skill with Claude Code, Codex, Cursor, Gemini CLI and OpenCode, and leaves a .rust-anything.bak backup before it edits files.
  • Runtime prerequisites documented in docs/install.md: Node 22.6+ for TypeScript/JavaScript, Node 24+ for profile, Python 3.9+, Go 1.21+, Ruby 3+, JDK 17+, and the wasm32-unknown-unknown target plus wasm-bindgen-cli for wasm bridges.

Best For

Developers who want to move a performance-sensitive function or two to Rust without rewriting the whole application at once.Teams that want a Rust port checked against recordings of what the original actually did, not just a code review.Maintainers of existing TypeScript/JavaScript, Python, Go, Ruby or Java code who can install another language runtime alongside the Rust toolchain.Developers already working in Claude Code, Codex, Cursor, Gemini CLI or OpenCode who want a structured record-diff-gate workflow instead of ad-hoc prompting.Server and CLI maintainers who need the whole-app path (analyze --whole-app, app front-door, app lift) in addition to single-function ports.

Pricing

Free and open source under the MIT license (LICENSE, Copyright 2026 Erkam Yaman). There is no pricing page and no paid tier: the README only offers GitHub Sponsors, and the repo's pricingUrl points at the MIT LICENSE. Distribution is on npm and crates.io at 3.3.0. Separate costs can come from the coding agent you point it at, which bills its own model provider; the repo does not price that.

Pros & Cons

Pros

  • Proves a port against recorded behaviour instead of trusting generated code: replay compares stdout, stderr, the exit code, written files and HTTP responses, and app record can also capture outgoing HTTP, SMTP and database state when asked.
  • You can start with one hot function before committing to a wider rewrite.
  • Both generated edge cases and your own inputs go into the recording.
  • enable and disable are reversible: disable restores the file byte for byte.
  • One setup command registers the MCP server and workflow skill for five coding agents.
  • MIT licensed with no paid tier; the README quotes benchmarks the author measured on an Apple M4 (Prettier 3.6.2 128.6 s to 6.9 s, json-server idle memory 74 MB to 3.5 MB, Fuse.js search over 50,000 strings 91.2 ms to 2.8 ms, two runs each). These are author-run numbers and this listing did not reproduce them.

Cons

  • It does not rewrite the code itself: it profiles, records and generates the bridge, and your coding agent or you write the Rust.
  • A pass only proves what was recorded: inputs nobody recorded, an original that changed afterwards, regex lookaround and backreferences, float-to-text formatting, and behaviour outside stdout, stderr, exit code, written files and HTTP are outside the default check.
  • You need a Rust toolchain plus the runtime of the language you are porting (Node 22.6+ for TS, Node 24+ for profile, Python 3.9+, Go 1.21+, Ruby 3+, JDK 17+), and wasm bridges also need the wasm32 target and wasm-bindgen-cli.
  • Rust is not always faster: the FAQ says a small function called once per item is often slower in Rust because each call crosses a bridge, while V8, the JVM and Go run such functions in nanoseconds; battle-tested C that touches hardware registers, relies on its compiler's type sizes or memory layout, or uses inline assembly is marked keep in C, because a recording on your machine proves nothing about the target and stable driver or firmware code gains little from a rewrite.
  • No standalone product site and no hosted service; the Windows path is only exercised against the MSVC target in CI. This listing was verified from the README, docs and LICENSE only, and nothing was installed or run.

Alternatives

Claude Code

Documented as a supported integration: rust-anything setup registers its MCP server and workflow skill with Claude Code, and the agent writes the Rust this CLI records, diffs and gates. It complements the migration workflow rather than replacing it.

OpenAI Codex

Also documented as a supported integration, and the MCP server plus skill ship as a Codex plugin (codex plugin marketplace add erkamyaman/rust-anything). It is the coding agent in the loop, not a substitute for the recording and gating steps.

Cursor

Listed among the agents rust-anything setup configures. It can write the port.rs implementation, while the recording, replay and enable/disable decisions stay with rust-anything.

Gemini CLI

Listed among the agents that rust-anything setup registers the MCP server and workflow skill with, so it can be the agent writing the Rust for a recorded port.

OpenCode

Documented as a supported integration, configured under mcp.servers in opencode.json. Like the others it writes the Rust rather than performing the record-diff-gate steps.

FAQ

Details

Platform

macOSWindowsLinux

Features

  • Records what the original CLI, server or library does on generated edge cases and your own inputs, then replays every case against the Rust port before it is enabled
  • Profiles a slow run and ports only the hot function (rust-anything go --agent claude -- python3 app.py), handing port.rs to the agent or writing TASK.md when no agent is given
  • Pipeline of profile, analyze, bridge, record, diff, fuzz, bench, shadow and gate, with enable/disable that turns a gated TS/JS or Python port on for every caller and off again byte for byte
  • Source languages it records and ports: TypeScript/JavaScript, Python, C, Go, Ruby, Java and Kotlin, with PHP and C# handled for unit ports through FFI and P/Invoke
  • Whole-app mode (analyze --whole-app, app record, app front-door, app wire, app lift) for servers and CLIs, not just single functions
  • Ships an MCP server (rust-anything mcp) and a workflow skill that rust-anything setup registers with Claude Code, Codex, Cursor, Gemini CLI and OpenCode

Languages

en

Known limitations

  • It does not rewrite the code itself: it profiles, records and generates the bridge, and your coding agent (or you) writes the Rust; the README states this plainly
  • A pass only proves the Rust matches what was recorded: inputs nobody recorded, an original that changed afterwards, regex lookaround and backreferences, float-to-text formatting, and behaviour outside stdout, stderr, exit codes, written files and HTTP are outside the check
  • Needs a Rust toolchain plus the runtime of the language being ported (Node 22.6+ for TS, Node 24+ for profile, Python 3.9+, Go 1.21+, Ruby 3+, JDK 17+); wasm bridges also need the wasm32 target and wasm-bindgen-cli
  • There is no standalone product website: distribution and docs live on GitHub, crates.io and npm, and the Windows path is only exercised against the MSVC target in CI
  • Rust is not always faster: the FAQ says a small function called once per item is often slower in Rust because each call crosses a bridge, while V8, the JVM and Go run such functions in nanoseconds; battle-tested C that touches hardware registers, relies on its compiler type sizes or memory layout, or uses inline assembly is marked keep in C, since stable driver or firmware code gains little from a rewrite
  • The repo went from creation on 2026-11-16 to 8.5k stars in a week; the listing was verified from the README, docs and LICENSE only, and nothing was installed or run

Rate This Tool

Related Tools