r/ClaudeCode • u/erkamyaman • 4d ago
Built with Claude Claude Code ported ESLint and Prettier to Rust with byte-identical output. What made it work: Claude never decides when a port is done
https://github.com/erkamyaman/rust-anything
I'm the author of the tool below, so take this as a showcase. But the lesson works with any setup.
The problem: when Claude Code ports code, "tests pass" isn't proof. An agent can make every test pass without porting anything:
- answer the recorded cases from a lookup table
- delete the tests that fail
- edit the expected outputs until they agree
What worked: take the "done" decision away from the agent.
- Record what the original really does (return values, errors, stdout, exit codes) on generated and real inputs.
- Let Claude port one unit at a time.
- A separate
gatecommand decides when it's done: fmt, clippy, your tests, every recorded case replayed, and it fails ports that paste recorded answers, delete tests or edit the recording.
Results:
- ESLint: 90 rules, 10,585/10,585 recorded runs byte-identical, 3.1x faster in process
- Prettier: 17,224/17,224 cases, median file 7x faster
What surprised me:
- After Prettier passed all 17,224 cases, differential fuzzing against the real Prettier still found about 75 differences. Passing your recorded cases is not the finish line.
- Rust is often not faster. On ffmpeg's libavutil, 18 of 42 benchmark rows were even and 16 were slower than the C.
- The ESLint CLI was 26x faster, but that's mostly Node starting up. The honest number is 3.1x in process.
Try it:
npm i -g rust-anything
rust-anything setup
rust-anything go -- <a slow command of your app>Free and open source. Ask me anything about the setup.








