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.
- Nov 18, 2026Answer.AI Opens SolveIt to Everyone: Code, Notes and AI in One Dialog After a 3,000-User Beta
- Nov 18, 2026One Chinese Comma Switched DeepSeek to Chinese in 94% of Responses
- Nov 18, 2026Hugging Face routes LLM requests through OpenRouter, cutting capacity errors by 46%
- Nov 18, 2026Willison Releases Three External Sandboxes So Agent-Run Code Stays Off Your Laptop
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.
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.