Starts Nov 23Live Cohort 3 of Vibe Coding & AI Agents: 3 weeks, 9 live hands-on sessionsCohort 3 (Nov 23) →
ReleaseCode / SDK · ActionableHabr AI→ original

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
rust-anything teaches AI agents to rewrite apps in Rust module by module
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Supports CLI tools, HTTP servers and libraries in Node.js, Python, Go, Ruby, Java
Key metric #2Before editing a file, setup saves a copy next to it: <file>.rust-anything.bak
Key metric #3The authors claim rewritten solutions run up to 20 times faster in selected tests

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.

Story

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.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

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.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…