How to automate code rewrites and ports with AI agents
6 real setups for code rewrites and ports, most-discussed first. Steps come from each source; the full prompt is one click away.
6 real setups on agentsetups show how people automate code rewrites and ports with AI agents. Agents used: Claude (4), Codex (1), Perplexity Computer (1), Amp (1).
Fastest start (from Decompile a full game with a long-running agent swarm by momo5502):
- Start with 3 worker agents decompiling and committing, plus 1 reviewer that coordinates and flags bugs; communicate via Discord.
- Trigger compaction earlier (they cut the threshold from 90% to 42% context fill) to save tokens.
- Stop the reviewer trusting workers’ comments: verify deviations against the original independently.
+1 more step in the copyable prompt.
Last updated · based on 336 use cases on agentsetups, each credited to its author.
1. Decompile a full game with a long-running agent swarm
Over 3 months and 500B tokens, worker + reviewer agents reached 99% of functions, 83% byte-exact.
- Start with 3 worker agents decompiling and committing, plus 1 reviewer that coordinates and flags bugs; communicate via Discord.
- Trigger compaction earlier (they cut the threshold from 90% to 42% context fill) to save tokens.
- Stop the reviewer trusting workers’ comments: verify deviations against the original independently.
- Build a verification harness, then scale workers and let them run autonomously.
Claude, Codex · tools: Discord · by momo5502 (blog, 9 Oct 2026) · source
2. Port a Windows-only app to Linux with Perplexity Computer
Computer decompiled a keyboard app with headless Ghidra and rebuilt it in Rust for Linux, with music-synced lighting and macros.
- Have Computer download the binary into its cloud sandbox and decompile it with headless Ghidra.
- Have it read the decompiled code to learn how the app drives the hardware.
- Rebuild it piece by piece as a native Rust app (here: lighting synced to music via PipeWire, 3D view, key remapping, macros, profiles).
Perplexity Computer · tools: Ghidra, Rust, PipeWire · by Aravind Srinivas (X post, 14 Oct 2026) · source
3. Port a 1993 Amiga game by having an LLM read 68000 assembly
Its creator moved a 34k-line C++ engine into Godot 4, then had Fable 5 work from the original 72,758 lines of assembly.
- Plan conditional steps, each only if the previous works.
- Step 1 (safe): move an existing engine port into the new engine (34,000 lines of C++ into Godot 4).
- Step 2 (hard): give the agent the original assembly (72,758 lines of 68000) and binary level maps.
- Play the result every night, say what feels wrong, and make the decisions only the original author can.
Claude · tools: Godot 4 · by rabahs (Babylonian Twins) (blog, 3 Sep 2026) · source
4. Rewrite 65k lines of Go in Rust for $400
Extract the code as a data representation, operate on it, put it back as Rust; Fable orchestrates subagents, never writes code.
- Ask the model to represent your code as graphs, ontologies, state machines, process charts, constraints or formulae.
- Operate on that representation: simplify state machines, remove hidden communication channels.
- Ask for the code back, in the new language.
- Forbid the main agent from reading or writing code itself; have it orchestrate subagents (Claude Code’s Glob, Grep, WebSearch) to save context on long runs.
Claude · by Iurii Krasnoshchok (blog, 1 Sep 2026) · source
5. Let Amp find a deploy bug and upgrade Node
Amp traced a bad API token from headers alone, reproduced it, migrated deps and code to Node.js v24; first PR all green.
- Give Amp the failing project and symptoms.
- Let it diagnose from the request headers and reproduce the issue.
- Have it migrate dependencies and code to Node.js v24.
- Review the PR once checks are green.
Amp · tools: Node.js · by Liran Tal (X post, 12 Oct 2026) · source
6. Rewrite a critical Node.js service in Go overnight
Checkly built ~600 black-box tests from production scenarios first; Claude Code wrote 13k lines of Go and servers went 20→5.
- Build black-box tests from real production scenarios (Checkly had about 600).
- Have Claude Code rewrite the service in the target language.
- Run the same tests against the new service before switching traffic.
Claude · by Checkly (X post, 29 Sep 2026) · source
Questions people ask
Which AI agent is best for automating code rewrites and ports?
In the 6 setups here, the agents named are Claude (4), Codex (1), Perplexity Computer (1), Amp (1). That is what people used, not a quality ranking.
What do I need to automate code rewrites and ports with an AI agent?
An agent (Claude, Codex, Perplexity Computer are the most common here). Each setup lists only the tools its source states.
Is there a prompt I can copy?
Yes. Every use-case page has a copyable prompt with the steps embedded and a “Based on” credit line, for example Decompile a full game with a long-running agent swarm.
Related guides
- Best AI agent for coding39
- Best AI agent for making games29
- How to automate email triage with AI agents9
- How to automate a daily briefing with AI agents9
- How to automate lead generation and outbound sales with AI agents8
- How to automate meal planning and grocery orders with AI agents3
- How to automate subscriptions and household bills with AI agents6
- How to automate bookkeeping and invoices with AI agents4