rust-anything teaches AI agents to rewrite apps in Rust module by module
Rewriting a working app in Rust is scary: it's easy to break something that has run fine for years. The open-source rust-anything project records your app's behavior. An AI agent (Claude Code, Codex) then rewrites one module at a time in Rust, and the tools check the result against the recording. Migration proceeds in small, verifiable steps instead of one risky leap.
AI-processed from Habr AI; edited by Hamidun News
Almost every team has a service that "should be rewritten in Rust": it's slow, it eats memory, or people simply want reliability without a garbage collector. But rewrites usually get postponed, because nobody wants to break what works. A new open-source project on GitHub, rust-anything, targets exactly that fear: it makes an AI agent rewrite an app in parts and verify each part.
How it works
The idea is simple if you think of renovating an apartment. Before you knock down any walls, you photograph how everything stands and works today. Then you redo one room and compare it with the photo. Only after that do you move on to the next.
The same logic applies here. First, rust-anything records the behavior of your current app. Then the Rust code is written by an AI agent, such as Claude Code or Codex, or by you. Each rewritten module is checked against the recording, and only then does the project move on. This continues until the whole app is pure Rust. The authors describe it as rewriting "module by module."
The project works with CLI tools, HTTP servers and libraries. The description lists these source languages: Node.js (TypeScript and JavaScript), Python, C, Go, Ruby and Java. According to the publication, PHP and C# are still in preview, meaning support there is still rough.
What protects you along the way
The agent works inside your repository, so a safety net matters. According to the authors, before changing an existing file, the setup command saves a backup copy next to it, in a file with the .rust-anything.bak suffix. If you don't want the installer to change anything on its own, you can perform the steps manually.
The real value here lies in the discipline of the process, not in the AI itself. The model can still write incorrect code, but checking against recorded behavior catches discrepancies before they pile up. For migrations, that matters more than elegant code: an error in one module shows up immediately, not three weeks later in production.
What about performance, and where's the catch?
The authors claim that in selected tests, solutions rewritten in Rust ran up to 20 times faster. Read that number with caution. It is the maximum across chosen tests, and the creators measured it themselves. Your actual gain depends on where your bottleneck is. If a service waits on database responses, changing the language will do almost nothing. If it computes, parses or crunches data in memory, the effect can be noticeable.
There are also limitations to keep in mind, even though the announcement does not state them explicitly:
- Verification is only as good as the behavior recording is complete. What isn't recorded isn't checked.
- Some languages are in preview, so serious codebases need trial runs.
- You still need to read the code the agent writes. Matching the recording guarantees neither idiomatic Rust nor the absence of
unsafe.
What to do in practice
If you have a small utility or an internal HTTP service in Python, Go or Node.js, it makes a convenient testing ground. Take the most heavily loaded module, run the migration on a copy of the repository, and compare speed and memory use before and after. If the gain is real, keep rewriting. If not, you lose a day, not a quarter.
For product managers and founders, the takeaway is broader. Tooling around AI agents is shifting from "write me code" to "make the change and prove that nothing broke." Harnesses like this, with behavior checks and rollback, make risky large-scale edits realistic for small teams. That approach, not any particular language, is worth adopting, even if you don't plan to move to Rust.
- Dec 2, 2026Ai2 Releases MolmoWeb2 Web Agents: 27B Model Solves 75.3% of Tasks
- Dec 2, 202650 AI Models Beat 62 Teams at 'Zakovat': 48.3% Correct Answers vs 39.8%
- Dec 2, 2026Claude Fable 5.2 ran 1,000 agents for eight days and built an operating system
- Dec 2, 2026Amazon Releases Ergo Open Weights for Coding: 1.1 Trillion Parameters and 2,200 Tokens per Second
Key Questions Answered
What about performance, and where's the catch?
The authors claim that in selected tests, solutions rewritten in Rust ran up to 20 times faster. Read that number with caution. It is the maximum across chosen tests, and the creators measured it themselves. Your actual gain depends on where your bottleneck is. If a service waits on database responses, changing the language will do almost nothing. If it computes, parses or crunches data in memory, the effect can be noticeable.
How it works?
The idea is simple if you think of renovating an apartment. Before you knock down any walls, you photograph how everything stands and works today. Then you redo one room and compare it with the photo. Only after that do you move on to the next. The same logic applies here. First, rust-anything records the behavior of your current app. Then the Rust code is written by an AI agent, such as Claude Code or Codex, or by you. Each rewritten module is checked against the recording, and only then does the project move on.
What protects you along the way?
The agent works inside your repository, so a safety net matters. According to the authors, before changing an existing file, the setup command saves a backup copy next to it, in a file with the .rust-anything.bak suffix. If you don't want the installer to change anything on its own, you can perform the steps manually. The real value here lies in the discipline of the process, not in the AI itself.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
