# rust-anything: rewrite an app in Rust one piece at a time, gated on recorded behavior
<!--
ref: @content/web/github/2026-11-16-rust-anything
tags: [claude-code, verification, agent-tooling]
version: 2
updated_at: 2026-11-22T15:39:39.053Z
-->

**[Read the original](https://github.com/erkamyaman/rust-anything)**


*Synthesized from the rust-anything README on GitHub (erkamyaman/rust-anything), created 2026-11-16.*

An MIT-licensed project by Erkam Yaman, at about 7.8k stars within a week of creation, that ports an existing codebase to Rust incrementally with a coding agent.

## Core Thesis

Agent-driven rewrites are safe only when each step is checked against the original's real behavior. The README's premise is "Rewrite your whole app in Rust, one piece at a time."

## Key Insights

- **Record, then port.** It records what the existing TypeScript, Python, C, Go, Ruby or Java code returns or throws, then has the agent write the Rust for each piece.
- **Replay gate.** Every recorded case is replayed against the Rust port, and a piece moves on only after all cases match and the gate passes.
- **Claude Code integration.** Install the CLI with cargo or npm, run its setup command to register an MCP server and workflow skill, or install it as a plugin, then ask Claude to port a unit and prove it behaves the same.

## Actionable Takeaways

- The record-and-replay gate is a reusable pattern for any long-running agent migration.
- Worth reading as an example of a plugin that enforces verification outside the model.

---

*Related: `@protocol/verification-tactics` · `@content/web/xinyadu/2026-11-29-claude-code-task-framing-study` · `@protocol/shell-and-runtime-traps` · `@protocol/silent-signal-and-evidence-traps` · `@content/web/github/2026-11-27-resume-command-osc-7577-issue-112408`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*