rust-anything
rust-anything is an MIT-licensed CLI, MCP server, and agent workflow for moving an existing application to Rust without treating a rewrite as a blind translation exercise. It records how the original TypeScript, JavaScript, Python, C, Go, Ruby, Java, or Kotlin code behaves, then compares the Rust port against those recordings before a component is accepted. The project can register itself with Claude Code, Codex, Cursor, Gemini CLI, and OpenCode through rust-anything setup.
It fits teams that already have a working application and want to move an expensive path, a library unit, a CLI, or eventually a whole server to Rust. It is not an AI code generator. Your coding agent or developer writes the Rust implementation; rust-anything provides profiling, a generated bridge, recorded cases, replay, and a gate for checking the result. Compare Claude Code for the coding-agent host, or Chrome DevTools MCP when the agent needs a live-browser debugging tool instead.
What it does
- Profile and plan: identify a workload or hot path before deciding what is worth porting.
- Record, build, and diff: generate cases against the original, build the Rust crate, and replay the cases against both implementations.
- Keep callers stable:
bridgecreates an integration path so a gradual Rust port can retain the original API shape. - Expose an agent interface: the CLI can install its MCP server and workflow skill for supported coding agents.
- Track a whole migration:
map,gate, and whole-app recording help show which parts are still original code or have stale recordings.
Practical workflow
- Work on a disposable copy of a project, a test database, and non-production credentials.
- Install with
cargo install rust-anything, then runrust-anything setupif you want the supported agent integrations. - Profile the project, choose one bounded hot path, create a bridge, and record behavior from real tests or chosen inputs.
- Implement the Rust unit, then run
diff,bench, andgatebefore widening the scope.
The software is free under MIT; the cost is the Rust toolchain, CI time, and any model usage from the coding agent you choose. The upstream v2.0 release documents case studies for Prettier, json-server, Fuse.js, and vercel/ms, but those results are project-maintainer measurements on particular workloads, not a promise for another codebase.
Important limitation
Recording runs the original program repeatedly. The upstream warning says generated inputs may write files, contact a database, or make network calls. Run it against an isolated copy with test services and no production secrets. Recorded behavior can only cover exercised paths, so a passing diff is evidence for the recorded cases, not proof that every production behavior was preserved.
FAQ
Does it automatically translate an app to Rust?
No. It helps a developer or coding agent choose, implement, and verify a port. The Rust code remains your responsibility.
Can it be used with Codex?
Yes. The upstream setup command lists Codex among the agents for which it can add an MCP server and workflow skill. Review any changes to local agent configuration before running setup.
What should I use instead?
Use a normal profiler and focused refactor when you do not need cross-language behavior replay. Use Claude Code when you first need an agent host rather than a Rust-migration verification layer.
Conclusion
rust-anything is most useful when a measured performance or deployment reason justifies incremental Rust adoption and behavior preservation matters. Start with one isolated component, retain the recordings in review, and treat its benchmark reports as a starting point for your own measurement.
Sources
- Websitehttps://github.com/erkamyaman/rust-anything
- rust-anything v2.0.0 release noteshttps://github.com/erkamyaman/rust-anything/releases/tag/v2.0.0
Comments
No comments yet. Be the first to comment!
Related Tools
Related Insights
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
Claudesidian: Transform Obsidian into an AI-Powered Second Brain
Discover Claudesidian, an open-source project that perfectly integrates Obsidian with Claude Code. Built-in PARA method, custom commands, and automated workflows for a complete idea-to-implementation solution.
What Locks Codex Is the Picker, Not the Models
You already pay for OpenCode Go, Grok, and Z.ai, but the Codex picker still shows mostly GPT. The community project codex-router does not teach another install ritual. It puts subscriptions you already bought back into the selector, keeps keys on the machine, and leaves native GPT alone.