---
title: "rust-anything checks AI Rust rewrites against recorded app behavior"
id: "story-116"
canonical_url: "https://emergent.fm/stories/116"
markdown_url: "https://emergent.fm/stories/116/article.md"
published_at: "2026-11-23T04:16:33.825Z"
modified_at: "2026-11-23T05:08:00.856Z"
source_at: "2026-11-16T12:10:36.000Z"
topic: "coding_agents"
trust_label: "Reported"
publisher: "Emergent.FM"
---

# rust-anything checks AI Rust rewrites against recorded app behavior

> Release 3.3.0 adds PHP and C# unit bridges in preview under the MIT license.

## Key points

- Release 3.3.0 of rust-anything adds unit bridges for PHP through ext-ffi and C# through P/Invoke, according to the changelog.
- The go command profiles a workload, hands the top portable function to a coding agent, and enables the Rust port only when it matches and is not slower, the changelog reports.
- The tool requires Rust 1.97 under the MIT license and registers its MCP server with Claude Code, Codex, Cursor, Gemini CLI, and OpenCode, the documentation states.

Release 3.3.0 of rust-anything, dated 2026-11-22 in the changelog, extends the behavior-checked Rust migration tool to PHP and C# units. The changelog states that PHP top-level functions cross into Rust through ext-ffi, a foreign function interface that lets PHP call compiled libraries. Public static C# methods cross through P/Invoke, the platform invoke mechanism for calling native code, using a generated JSON dispatcher.

## Workflow records behavior before an agent writes Rust

Builders point rust-anything at an existing Node.js, Python, C, Go, Ruby, Java, or Kotlin codebase, according to the README. The record command runs the original code on generated edge cases and user inputs, saving return values and thrown errors. The bridge command then generates a Rust crate and wrapper so callers keep the original API, while a coding agent or developer writes src/port.rs. Finally, diff replays every recorded case against the Rust port, and gate checks that all cases match before app lift produces a pure Rust app.

## Single-command profiling targets slow loops and checks speed

For targeted speedups, the go command now takes the repository root as its first argument in release 3.3.0, according to the changelog. It profiles a slow workload, isolates the outermost portable function, and passes TASK.md to an agent such as claude or codex. After building and gating the port, go runs bench and enables the Rust code only when it is not slower than the original. The report command also generates report/REPORT.md and report/card.svg for pull requests.

## Setup requires Rust 1.97 and registers local MCP servers

The Cargo manifest specifies Rust 1.97 and the MIT license, while prebuilt binaries for macOS, Linux, and Windows are available on GitHub releases and npm. Running rust-anything setup registers the tool's Model Context Protocol (MCP) server, a standard interface for connecting tools to AI agents, with Claude Code, Codex, Cursor, Gemini CLI, and OpenCode. Because record and app record execute the original code many times, the README warns builders to run them on a project copy with a test database and no production credentials.

## Preview bridges carry JSON overhead and language limits

Both new bridges have stated limits in the 3.3.0 changelog. Neither PHP nor C# units support shadow mode or --batch, and features such as PHP classes, C# generics, and async methods stay in the original language. In the maintainers' real-code runs, JSON bridge overhead made PEAR XML_Util 1.4.5 run at a 0.09x geometric mean in PHP 8.5.12 across 1,838 recorded cases. Google.Protobuf 3.29.0's CodedOutputStream.ComputeSize.cs ran 0.03x as fast in C# across 2,941 cases.

## Try it

1. Install the CLI with `cargo install rust-anything` or `npm install -g rust-anything`.
2. Register the MCP server and skill with your coding agent by running `rust-anything setup`.
3. Profile a slow workload and hand the top hot function to an agent with `rust-anything go --agent claude -- python3 app.py`.
4. Generate a pull request summary with `rust-anything report rust/dedupe-rs`, or revert to the original with `rust-anything disable rust/dedupe-rs`.

## Sources

- [erkamyaman/rust-anything](<https://github.com/erkamyaman/rust-anything>) (github.com/erkamyaman, documentation)
- [README.md](<https://github.com/erkamyaman/rust-anything/blob/main/README.md>) (github.com/erkamyaman, documentation)
- [Rust anything Cargo.toml](<https://github.com/erkamyaman/rust-anything/blob/main/Cargo.toml>) (github.com/erkamyaman, documentation)
- [CHANGELOG.md](<https://github.com/erkamyaman/rust-anything/blob/main/CHANGELOG.md>) (github.com/erkamyaman, 2026-11-22, release)

Canonical page: <https://emergent.fm/stories/116>
