ClaudeMap

rust-anything

Rewrite your whole app in Rust, one piece at a time, with a coding agent — rust-anything records what your TypeScript/JavaScript, Python, C, Go, Ruby or Java app does today, then gates every Rust port against that recording before it moves on

SDKs & Toolingrustcode migrationclaude codecodexmcpbenchmarkbehavioral testing

rust-anything is a CLI plus MCP server that supplies what a coding agent cannot guess reliably when porting to Rust: where the time goes (profile), what to port first and in which order, a bridge so the rest of the code calls the Rust with its API unchanged, the exact behavior the port must match (record — the README banner counts 38,251 recorded cases replayed with 0 mismatches), and a gate that only passes when the recorded cases match. Your coding agent — Claude Code, Codex, Cursor or Gemini CLI — writes the Rust; rust-anything does not translate code itself. rust-anything setup registers the MCP server with each agent it finds (Claude Code: MCP server in ~/.claude.json plus a workflow skill in ~/.claude/skills/; Codex: ~/.codex/config.toml plus skill; Cursor: ~/.cursor/mcp.json; Gemini CLI: ~/.gemini/settings.json; any other MCP client can add rust-anything mcp as a stdio server by hand), saves a copy of every file it changes as <file>.rust-anything.bak, is safe to run again, and --remove undoes it. Distribution: cargo install rust-anything from crates.io, npm install -g rust-anything for JavaScript projects, or prebuilt binaries for macOS, Linux and Windows attached to each GitHub release; in Claude Code it also installs as a plugin (MCP server + skill, with the CLI still required on PATH). The README's own benchmark table claims up to 20x on a real workload (x18n's sidebar search over 50,000 keys: 10 ms down to 0.5 ms), with a benchmark in demo/ for every number that first checks results are identical.

What it does

  • profile finds the hot loop worth moving — the README warns that calling Rust once per small function is usually slower than a JIT
  • record captures what your app does today and runs the original twice to separate real behavior from run noise (changed values become wildcards, reordered lines compare in any order)
  • bridge --batch generates the Rust crate and a bridge so the rest of the code calls it with its API unchanged
  • gate replays every recorded case against the port and only passes when they match — the demo GIF shows 2000/2000 recorded cases passing before a benchmark
  • Works-with table: Claude Code (MCP in ~/.claude.json + skill in ~/.claude/skills/), Codex, Cursor, Gemini CLI, or any MCP client via rust-anything mcp over stdio
  • Install flexibility: cargo crate, npm package for JS projects, prebuilt release binaries for macOS/Linux/Windows, or the Claude Code plugin marketplace

When to use it

Use when a codebase in TypeScript/JavaScript, Python, C, Go, Ruby or Java has a slow hot path or needs to end up in Rust, and you want an agent-driven migration that has to prove equivalence step by step instead of trusting the rewrite — or when you only want the slow part fast and prefer to port one hot path at a time.

Getting started

Paste into Claude Code, Codex, Cursor or Gemini CLI and let your agent install it:

Install rust-anything: run `cargo install rust-anything`, then `rust-anything setup`.
Tell me when to restart you.

Or yourself:

cargo install rust-anything   # from crates.io
rust-anything setup           # registers it with Claude Code, Codex, Cursor and Gemini CLI

No Rust toolchain yet? Prebuilt binaries for macOS, Linux and Windows are attached to each GitHub release, and for JavaScript projects npm install -g rust-anything installs the same binary. In Claude Code you can also install it as a plugin (the MCP server and the skill; the CLI above must be on your PATH):

/plugin install rust-anything --marketplace erkamyaman/rust-anything

Things to know

It can only catch what the recording covers, and the README spells out the edges: inputs nobody recorded are the ceiling (add production samples and real bug-report inputs — the user input that breaks prod is rarely one a generator thinks of); the regex crate has no lookaround or backreferences and treats some shorthand classes (word, digit, boundary) and case-insensitive matching on non-ASCII text differently from JS, Python or Java (record plants regex traps — the Kelvin sign, long s, Arabic-Indic digits, line separators, final sigma — into every file that uses regexes, but fuzz your real patterns too); and run-to-run variance is handled by wildcards and order-insensitive comparison, so a port must still produce exactly those lines. Behavior parity is proven only for recorded behavior — design intent (why the code does something) is not transferred — and the README positions rust-anything as an independent project not affiliated with the Rust Project. MIT. 1,042 stars as of writing (2026-11-18).

Repository

erkamyaman/rust-anything

Charted

Related on the map

  • The open Agent Skills standard — SKILL.md folders any agent can load, governed by the Agentic AI Foundation since 2026-10-22.

    • official
    • spec
    • agent-skills
    • standard
  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation