Reverse Engineer Anything (REA) lets Claude Code study how an app's feature works. Here's how to scope it, label its guesses and turn findings into tests.
Most of the features you'll build this month already exist in some app you use. A command palette, a drag-to-reorder list, a camera bubble that floats over a screen recording. The slow part was never typing the code. It was writing down exactly what "good" looks like so you, or your coding agent, could hit it.
That's why a repo called Reverse Engineer Anything (REA) went from nowhere to the top of GitHub trending in a few weeks. It gives coding agents like Claude Code a structured way to take apart a working app and tell you how a feature works, with evidence. I've been using it to study features before I rebuild them in my own projects, and the useful part turned out to be the discipline it forces on you more than the tool itself.
REA is an MCP server plus a CLI. MCP (Model Context Protocol) is the standard way to plug tools into an agent: the server exposes functions, and the agent decides when to call them. REA's functions wrap real reverse-engineering tools, the disassemblers and decompilers security people have used for years. Ghidra (free, from the NSA), IDA and Hopper (both commercial) turn compiled machine code back into something close to readable C. On top of those, REA adds its own analysers for things that don't need a disassembler at all: JavaScript and Electron bundles, .NET assemblies, Android APKs, WebAssembly, websites, recorded network traffic and more.
It also ships a skill, which is a packaged set of instructions the agent loads for this kind of job. The skill tells the agent how to run an investigation: narrow the scope, read summaries before raw dumps, cite evidence, and say what it couldn't find. It all runs locally.
Setup is one command. It registers the MCP server with whichever agent you use (Claude Code, Codex, Cursor and Gemini CLI are supported) and backs up your existing config first:
# needs Node 22.x or newer
npx rea-agents setup
# or install the CLI and run an analysis directly
npm install --global rea-agents
rea --help
rea analyze-javascript-application /absolute/path/to/app --json
Restart your agent after setup so it picks up the new server. One warning from the project itself: there are copycat repos with the same README. The official sources are the morluto/rea GitHub repo and the rea-agents npm package. Popular names attract typosquatters, so check before you run npx.
Here's the part that matters even if you never install REA. Agents are bad at inventing taste and good at matching a target. Ask for "a nice screen recorder bubble" and you get the median bubble from the training data. Point the agent at an app where the bubble already feels right and ask it to figure out why, and the result is far closer to what you had in mind.
A running app is a product requirements document (PRD) you didn't have to write. It holds every edge case the original team already argued about: what happens when you drag the bubble off-screen, whether it snaps to corners, what the countdown does if you pause. Writing that out by hand takes an afternoon, and you'd still miss half.
The same trick works outside software. Want an agent to write your weekly status report? Give it five reports you were proud of and have it work out the structure. Show the output, then work backwards.
My first attempt was "reverse engineer Notion." Bad idea. The agent burned a lot of tokens building a giant map of the app and gave me a summary I couldn't act on. A big Electron app can produce over a gigabyte of analysis output.
What works is picking one behaviour you can describe in a sentence and asking for evidence. Here's a before and after from my own prompts:
BEFORE
Reverse engineer this notes app and build me something similar.
AFTER
Using REA, find out how search ranking works in the notes app at
/Applications/Notes.app. I only care about ranking, not indexing or UI.
1. Tell me what the app is built with before you pick tools.
2. Read the summary output first. Only open module-level detail
for the code paths that touch ranking.
3. For each claim, mark it SEEN (you found it, with file/function),
INFERRED (the evidence points this way), or UNKNOWN.
4. Write the findings to docs/search-ranking-evidence.md.
Do not write any code yet.
Each line in that second prompt is there for a reason. "What is it built with" matters because the right tool depends on the target. An Electron app is mostly JavaScript, so static analysis of the bundle is cheap and often enough. A native Mac app needs a real disassembler, which is slower and gives noisier output. If the agent picks wrong it wastes an hour.
"Summary first" stops the agent from re-running the full analysis every time you ask a follow-up. The results are saved locally, so tell it to reuse them. I got stuck on this the first time: I asked three follow-up questions and the agent kicked off three full analyses.
And "don't write code yet" is there because the moment an agent starts coding, it stops investigating.
This is the habit I'd steal even without the tool. When an agent studies a compiled app, some of what it tells you is backed by a function it actually found, some is a reasonable guess from nearby code, and some is plain filler. In the chat window all three look identical.
If you build on an inferred claim as if it were fact, you find out three layers later when the behaviour doesn't match and you can't tell which assumption broke. So I make the agent keep an evidence file and I read it before any code gets written:
# Search ranking: evidence
| Claim | Status | Evidence |
|---|---|---|
| Title prefix match ranks above title substring | SEEN | scoreTitle() in search.bundle.js |
| Body matches rank below any title match | SEEN | same function, weight table |
| Ties break on last-edited time, newest first | INFERRED | sort comparator reads updatedAt |
| Query is trimmed and lower-cased | SEEN | normalizeQuery() |
| Typo tolerance | UNKNOWN | no fuzzy-match code found in the bundle |
The UNKNOWN rows are the most valuable ones. They're the questions you settle by poking the real app yourself, or the places where you decide your version will just do something different.
There's a pattern behind the most impressive results people have posted. Agents porting a whole framework to a new bundler worked because there was a test suite to grind against. Agents are very good at writing code when something can tell them, over and over, whether they got it right. Without that, they're guessing and you're reviewing.
So the step after the evidence file is a golden file: real inputs and the outputs the original app produced, captured by actually using it. These are called characterization tests, because they describe what the system does today rather than what a spec says it should do. Then the rebuild has a target it can check itself against.
Here's a small, complete version for the search example. The fixture holds notes and the results the original app returned for each query:
{
"notes": [
{ "id": "a", "title": "Deploy checklist", "body": "run migrations", "updatedAt": 100 },
{ "id": "b", "title": "Notes on deploy", "body": "rollback plan", "updatedAt": 200 },
{ "id": "c", "title": "Standup", "body": "talked about deploy timing", "updatedAt": 300 },
{ "id": "d", "title": "Groceries", "body": "milk, eggs", "updatedAt": 400 }
],
"cases": [
{ "query": "deploy", "expected": ["a", "b", "c"] },
{ "query": "DEPLOY ", "expected": ["a", "b", "c"] },
{ "query": "milk", "expected": ["d"] },
{ "query": "", "expected": [] }
]
}
Save that as fixtures/search-golden.json. The rebuild follows the SEEN rows from the evidence file:
// rank.js
export function rankNotes(notes, query) {
const q = query.trim().toLowerCase();
if (!q) return [];
return notes
.map((note) => {
const title = note.title.toLowerCase();
const body = note.body.toLowerCase();
let score = 0;
if (title.startsWith(q)) score = 3;
else if (title.includes(q)) score = 2;
else if (body.includes(q)) score = 1;
return { id: note.id, score, updatedAt: note.updatedAt };
})
.filter((r) => r.score > 0)
.sort((a, b) => b.score - a.score || b.updatedAt - a.updatedAt)
.map((r) => r.id);
}
And the test runs every golden case against it using Node's built-in test runner, so there's nothing to install:
// rank.test.js
import { test } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { rankNotes } from "./rank.js";
const golden = JSON.parse(
readFileSync(new URL("./fixtures/search-golden.json", import.meta.url), "utf8")
);
for (const { query, expected } of golden.cases) {
test(`matches original app for query ${JSON.stringify(query)}`, () => {
assert.deepEqual(rankNotes(golden.notes, query), expected);
});
}
Add {"type": "module"} to your package.json and run node --test. Now you can hand the agent a loop it can run without you: change the code, run the tests, repeat until green. When a newly captured case breaks the rebuild, you've found an INFERRED claim that was wrong, so update the evidence file too.
It's slower. Give two agents the same task, one with REA and one without, and the plain one usually finishes first. The REA run tends to produce the better result, because it investigates instead of pattern-matching from memory. For a simple JavaScript app, a plain agent that opens the bundle on its own is often good enough. I'd only reach for the full setup when the target is compiled, minified beyond reading, or the behaviour is subtle.
The output is only as good as the model reading it. REA hands back evidence. The model still has to understand it and write the code. One upside: once a strong model has produced the evidence file and golden tests, a cheaper model can often do the rebuild, because the hard thinking is already written down. That's a real saving on API bills.
Clones look finished long before they are. A recent wave of "open source Photoshop" clones went viral, until people opened real files and found sliders that did nothing. Their own roadmap admitted under half of feature parity. Copying the surface of an app is the easy part. The last 20% of behaviour is where the original team spent their years, and your golden file only covers the cases you thought to capture.
I'm not a lawyer, and the rules differ by country, so treat this as a working developer's rule of thumb. Study behaviour, rebuild it in your own code. Don't copy the original's code, shaders, icons, fonts or other assets into your project. Don't use it to get around licence checks or paid features. Only analyse software you've legally got on your machine, and get commercial tools like IDA through proper licences. REA's own README says the same: it's meant for research, interoperability, preservation, and analysing software you own or are allowed to examine.
The clean-room approach is the safe pattern. One pass (or one agent) studies the original and writes up behaviour in plain language and test cases. A second pass builds from that write-up alone, without seeing the decompiled code. The write-up doubles as documentation you'd want anyway.
My take after a few weeks: I wouldn't call REA magic, but the workflow it pushes is the right one. Pick one feature. Make the agent show its evidence and label its guesses. Turn what it found into tests before anyone writes code. Do that, and you're no longer hoping the agent understood you. You've given it a target it can check itself against, and that's when coding agents actually earn their keep.