1. Why Craft Anything?
When I pulled the repositories created in the past month from the GitHub search API on November 29, 2026, sorted by stars, this one came first. It went public on October 31, 2026, and in four weeks collected 45,458 stars and 8,982 forks (as of writing). Counted through the GitHub API, its main branch has 2,240 commits from 128 contributors, anonymous ones included, which is a lot of activity for a project less than a month old.
The README opens with this line:
See how any website, app or game works, then have AI build your own version; an open-source, clean-room engine in pure Rust.
"Take apart any software and have AI build your own version" sounds alarming at first. Open the code, though, and a good share of it is spent dealing with exactly that concern. What may be read, how what was read gets recorded, and whether the agent's output really resembles the original are each designed separately. This post follows those three threads.
2. What Using It Looks Like
Build the desktop app from source and launch it, and the first screen is Make. You pick whether to recreate a website, an app or a game, choose how closely to look (Clean room or Deep), describe what you want in a line and press Start. The build is handed to the coding agent picked under "Built by", Claude Code here.

Switch to Advanced mode and the analysis workbench opens. Below is the kilo binary from section 5 opened in Deep mode: 82 functions on the left, tabs for pseudo-C, disassembly, hex and the call graph in the middle, target details with Evidence and Unknowns panels on the right, and a box at the bottom for asking the agent.

One aside: on a Mac whose system language is Korean the UI comes up in Korean, but a source build ships without Korean glyphs, so every letter showed as a box. According to the docs, local builds need CRAFT_FONTS_DIR pointing at a craft-fonts checkout. I switched the language to English in settings for these screenshots.
The CLI does the same work. I ran a Clean room rebuild against a public page of this blog (https://martianlee.github.io/projects); I picked my own site to avoid cloning anyone else's.
craft-anything-cli --clean-room rebuild https://martianlee.github.io/projects "Recreate this page" \
--backend "Claude Code" --rounds 2 --unattended
The engine photographed the start page plus four more (/posts, /kb, /about, /projects/hanji) at three widths, and Claude Code built a Next.js project from those captures alone. Over 37 minutes it graded itself eight times, taking the similarity from 54% to 90%. Below is the first screen of the very first build next to the original: the original on the left, and on the right a build made without reading a single line of the original's HTML.

It is worth pinning down where the AI sat in this run. The builder was a separate Claude Code process that Craft Anything launched as a child.
craft-anything-cli rebuild … ← started by the Claude Code session writing this post
├─ engine: photographs the original (Study), photographs and grades the build (Check) ← no AI
└─ claude -p --output-format stream-json … ← the builder (Build, Refine)
└─ craft-anything MCP server
rebuild_check, core_action_approve, core_person_ask …
The builder shares no context with whoever started the run. It works from the brief and the capture folder and reaches the outside only through Craft Anything's MCP tools. The eight self-checks were the builder calling rebuild_check itself; the engine computed the scores. The question and approval cards a person would normally answer in the app were handled automatically because of --unattended: questions get the first choice, and anything outside the rules is refused.
Along the way the builder tried to delete files outside the project, the approval tool refused, and the log kept the line "The builder was refused permission for deleting anything outside the project or the temp folder." That is the permission layer from section 8.1 doing its job. The step-by-step scores and screenshots can be browsed in the visualization in section 6.
3. The One-Sentence Version
Craft Anything is a reverse-engineering engine with a coding agent attached, where the engine grades whatever the agent builds.
| Question | Craft Anything's answer |
|---|---|
| What can it analyse? | Websites, native programs, .NET, Java, Android, Apple apps, Electron, firmware, packet captures, databases and game files. |
| Who does the analysis? | The engine, not an AI. It ships its own disassembler, decompiler and parsers, and every analysis tool works without AI. |
| Who builds the new version? | By default, a coding agent installed on your machine. Claude Code is supported first; Copilot CLI, Grok Build and others connect over ACP. An API backend can also drive the built-in agent loop. |
| How does it know it's similar? | It captures the original and the build the same way and compares them. For websites, that means screenshots at three screen widths. |
| Does it read the original's code? | Not in the default Clean room mode, which only uses what is visible on screen, reference pictures you add and, if you allow it, a picture of the running window. Deep mode has to be switched on before code and files are read. |
| How do you use it? | As an egui desktop app, a CLI or an MCP server. All three share one engine and one tool list. |
| License? | MIT or Apache-2.0. The README labels it "early alpha". |
4. Repository Layout and Size
One Cargo workspace holds 13 crates and 3 apps. The crates are layered from L0 to L6; a crate may not depend on a higher layer or on another crate in its own layer, and cargo xtask layers enforces this.
| Layer | Crate | Role | Rust lines |
|---|---|---|---|
| L0 | evidence | Evidence records, confidence, unknowns, the error contract | 1,147 |
| L0 | formats | Parsers for ELF, PE, Mach-O, WASM, DEX, APK, plist and more (no I/O) | 80,127 |
| L1 | disasm | Its own disassembler: function discovery, CFG, call graph, pseudo-C | 9,809 |
| L1 | js | JavaScript bundle parsing, module graph, source maps, unbundling (oxc) | 10,024 |
| L2 | analysis | Analysers such as triage, comparison and app graphs | 15,578 |
| L2 | platform | Process launching, PTY capture, sandboxing, atomic file writes | 8,487 |
| L3 | engines | Optional external engines: Ghidra, adb, CDP, Frida, JADX and others | 14,698 |
| L4 | engine | Session, projects, the inbox (questions and approvals), tool registry, settings | 77,719 |
| L5 | ai | AI backends, the agent loop, the rebuild workflow | 48,981 |
| L5 | mcp | The MCP server | 1,975 |
| L5 | setup | Connecting to coding-agent apps, diagnostics, uninstall | 4,280 |
| L6 | ui-egui | The desktop UI; the only crate allowed to use egui and winit | 35,530 |
| - | testkit | Test helpers and synthetic sample builders | 8,760 |
The Rust code in crates/, apps/ and xtask/ adds up to 325,000 lines with 5,771 #[test] functions. On top of that, vendor/ carries 118,000 lines of patched copies of winit, wgpu-hal and egui-wgpu. Many of the parsers (ELF, PE, ZIP, SQLite and so on) live in the organisation's separate craft-libs repository and are pinned by commit hash.
docs/tools.md groups the tools by area: 55 for native programs, 37 for file formats, 36 essentials, 24 for websites, 24 for a connected phone (adb), 22 for projects, 17 for comparing and rebuilding, and so on. Those figures count engine tools only. docs/tools.md lists 310 engine tools, and the AI and setup layers add more on top. The README says 300 engine tools and 320 in total, which is slightly behind the list at this commit.
5. Running It on a Public Program
The README asks for Rust 1.97 or newer. My toolchain was 1.96, so I installed 1.97 alongside it with rustup toolchain install 1.97 and built only the CLI.
cargo +1.97 build -p craft-anything-cli --release
# Finished `release` profile [optimized] target(s) in 3m 16s
Including dependency downloads, it took 3 minutes 16 seconds and produced a 33 MB binary. craft-anything-cli commands listed 331 tools: the 310 engine tools plus 21 from the AI and setup layers, a few more than the README's 320.
For the target I picked a small program from a public repository: antirez/kilo, the terminal text editor by Salvatore Sanfilippo, the author of Redis. It is a single 1,308-line kilo.c under the BSD 2-Clause license. I compiled commit 323d93b with cc -O1 into a 54 KB arm64 Mach-O binary. With the source at hand, the decompiler's output can be checked line by line.
5.1 Clean Room Refuses Even to Open the File
Running triage in the default mode stops at the very first step, core_target_open.
{
"error": {
"category": "missing",
"code": "feature_missing",
"details": { "reason": "clean_room", "tool": "core_target_open" },
"message": "This looks inside the original (its code, files or page source), which Clean room never does.",
"remediation": "Turn on Deep mode: the switch in the title bar or Settings, `settings_set deep_mode true`, or `--deep` on the CLI.",
"retryable": false
}
}
This is the same refusal covered in section 8. The path that opens a file for static analysis is closed in Clean room from the start. For an app, Clean room can still look from outside by capturing its running window or reading the controls on screen, but kilo is a terminal program with no window, so that path isn't available.
5.2 Deep Mode Triage Comes Back as an Evidence Record
With --deep, the result comes back immediately. Trimmed to the main fields:
id: ev_aaf0a667e156927918e03a182786892e67eb2b17ee0158f41d7e57d5429bdce6
operation: core_target_triage
confidence: observed
authority: original-files
summary: kilo is a program for Mac, built for arm64 (64-bit).
limitations: heuristic_hints (toolchain and packer hints come from markers that can be faked or borrowed)
result: format=mach-o, architecture=arm64, stripped=false,
libraries=[/usr/lib/libSystem.B.dylib],
next_steps=[core_overview_show, native_functions_list, native_strings_find,
native_function_study, core_feature_find, apple_objc_classes_list,
apple_macho_show]
Running it again with a separate project folder gave the same id. Same machine, same file, same parameters: every hashed field matched, so the id did too (section 7). The result also lists seven tools worth running next, each with a reason, so an agent can pick its next step from that list.
5.3 Decompiling All 44 Functions
native-functions-list returned 82 entries (confidence derived, coverage complete). 44 are functions with code; the rest are 37 stubs for library calls such as printf and memmove, plus the Mach-O header symbol. The 44 cover the 36 function names from the source, along with 6 .cold pieces the compiler split off for rarely taken paths and 2 OUTLINED_FUNCTIONs it factored out as shared code.
Without Ghidra installed, decompiling falls to the built-in lifter. Running native-function-pseudocode on each of the 44 took 0.44 seconds in total and produced 3,160 lines of pseudo-C. 28 of the functions contain inline assembly the lifter couldn't turn into C, 148 lines in all. Most of it was harmless for meaning, like sign extension (sxtw, 57 lines) and register saves (stp, 27 lines), followed by conditional selects (csel, 10 lines; ccmp, 9 lines).
A clean recovery. This function checks whether a line ends inside an unclosed multi-line comment.
// kilo.c
int editorRowHasOpenComment(erow *row) {
if (row->hl && row->rsize && row->hl[row->rsize-1] == HL_MLCOMMENT &&
(row->rsize < 2 || (row->render[row->rsize-2] != '*' ||
row->render[row->rsize-1] != '/'))) return 1;
return 0;
}
// Craft Anything output (lightly condensed)
x10 = *(void*)(x0 + 0x20); // row->hl
if (x10 == 0) { w0 = 0; return w0; }
x9 = *(int32_t*)(x0 + 8); // row->rsize
if (w9 == 0) { w0 = 0; return w0; }
x8 = x9 - 1;
w10 = *(uint8_t*)(x10 + x8);
if (w10 != 3) { w0 = 0; return w0; } // HL_MLCOMMENT == 3
if (w9 < 2) { w0 = 1; return w0; }
x10 = *(void*)(x0 + 0x18); // row->render
...
if (w9 != 0x2a) { w0 = 1; return w0; } // '*'
...
if (w8 != 0x2f) { w0 = 1; return w0; } // '/'
w0 = 0; return w0;
Not a single line of inline assembly. Struct fields only show up as offsets (+0x20, +8, +0x18), but the logic survives intact: HL_MLCOMMENT's value of 3, the '*' (0x2a) and '/' (0x2f) comparisons, even the order that rules out short lines first. The field names in the comments are mine, matched against the source. editorRowDelChar, which deletes one character, also came out in order: the memmove call, the editorUpdateRow call, row->size-- and the global E.dirty++.
A switch that became a lookup table. editorSyntaxToColor, which maps a highlight type to a terminal colour number, is a switch in the source. The compiler turned it into a range check and a lookup table, and the output follows that shape.
int32_t _editorSyntaxToColor(int64_t x0)
{
w8 = w0 - 2;
if (w8 > 6 /* unsigned */) {
w0 = 0x25;
return w0;
} else {
x9 += 0xa18;
w0 = *(void*)(x9 + ((uint64_t)(uint32_t)w8 << 2));
return w0;
}
}
The default of 0x25 (37, white) and the range check are right. But the adrp x9, … that builds the table address is missing, so x9 starts at x9 += 0xa18 without ever being assigned. The colour numbers in the table (36, 33, 32…) don't appear either. In editorInsertNewline, the address of the global struct E turns into x21 += 0x2ec the same way.
A csel that loses its comparison. This is the part to be careful with. editorInsertNewline clamps the cursor to the end of the line when it has run past it.
// kilo.c
if (filecol >= row->size) filecol = row->size;
The compiler made this branch-free with a cmp followed by csel (conditional select), and the output kept this:
w10 = w11 + w10; // filecol = E.coloff + E.cx
__asm("csel w22, w10, w9, lt");
if (w22 == 0) {
The cmp is nowhere to be seen. The lifter never emits cmp as a statement; it only remembers it as the flag source for the next conditional branch (crates/disasm/src/pseudo.rs). A branch like b.lt uses that memory to build a condition such as if (w2 > 0), but csel has no C rule, falls back to inline assembly and never consumes the remembered comparison. The line just before it, (filerow >= E.numrows) ? NULL : …, compiled to ccmp and lost its comparison the same way. In the same function, the third argument to editorInsertRow (row->size - filecol) also dropped out of the call expression.
The result did carry warnings. Confidence was inferred, carries_target_content was true, and every result came with entries like these under limitations:
| Code | Meaning |
|---|---|
register_level | Variables are registers and stack slots; types are not recovered |
calling_convention_assumed | Arguments are assumed to follow the usual arm64 calling convention |
conditions_from_flags | Branch conditions are rebuilt from the last compare and may be approximate |
inline_asm | Instructions with no C rule are shown as __asm(...) |
deep_engine_unavailable | Ghidra isn't installed, so the less exact built-in decompiler was used |
The warnings are generic, though: none of them says the condition that clamps the cursor to the line length went missing. A person can see the __asm lines and go check the machine code, but an agent that rewrites the program from this output alone could lose the condition. That makes it important for the agent to actually read limitations.
6. The Four-Step Loop: Study, Build, Check, Refine
Pick a target on the app's main screen, describe what you want and press Start, and the loop in crates/ai/src/rebuild/mod.rs begins. The comment at the top of the file sums up the flow.
Study website: web_site_open + web_site_capture → capture/ (screenshots, blueprint, HTML)
local: triage (+ app graph for JS apps) → capture/README.md
Build the coding agent (an agent CLI such as Claude Code) works in the workspace with our
MCP server; edits outside app/ and unusual commands ask the person (core_action_approve),
questions arrive as cards (core_person_ask). Both go through the workspace inbox.
Check website: serve app/dist on loopback, capture it the same way, compare screenshots
(layout similarity per width). Other stacks: the build must succeed.
Refine measured differences go back to the agent, up to `max_rounds`.
flowchart LR
S[Study\ncapture original] --> B[Build\nagent writes app/]
B --> C[Check\ncapture and compare]
C -->|meets the bar| D[Ready]
C -->|falls short| R[Refine\ndiffs into prompt]
R --> B
C -->|fixes used up| E{Does it build?}
E -->|yes| D
E -->|no| X[Failed]
Below, the real run from section 2 is laid over this loop. You can step through the eight self-check scores and compare screenshots at each width for the steps where a copy was kept.


The builder reaches 90. The engine's own check rounds would come next; I stopped the run here.
- Claims
- 20/20
| Step | Type | Minute | Score |
|---|---|---|---|
| Study | Study | 0 | - |
| Self-check 1 | Builder self-check | 11.5 | 54 |
| Self-check 2 | Builder self-check | 22.7 | 79 |
| Self-check 3 | Builder self-check | 27.2 | 83 |
| Self-check 4 | Builder self-check | 30.1 | 84 |
| Self-check 5 | Builder self-check | 31.9 | 86 |
| Self-check 6 | Builder self-check | 33.7 | 86 |
| Self-check 7 | Builder self-check | 35.1 | 88 |
| Self-check 8 | Builder self-check | 36.6 | 90 |
No AI is involved in a website's Study step. The engine opens a browser and saves screenshots, the visible text and measured layout into capture/. The agent reads that folder and creates a new project in app/. The engine then serves the build on a loopback address, captures it with exactly the same tools it used on the original, and compares the two. There are exceptions: for a game in Deep mode, Study includes an AI extractor that pulls the game's own files into app/Original/, and choosing an API backend instead of an agent CLI hands Build to the built-in agent loop.
When the loop stops is decided by numbers. These are the app's default settings.
| Setting | Value | Meaning |
|---|---|---|
max_rounds | 6 | How many times the agent is asked to fix things after the first check. The CLI's --rounds defaults to 2. |
good_enough | 90 | A check with a similarity score must reach 90 to meet the bar; each check can set its own. |
NOT_WORKING_CHECK_LIMIT | 10 | Ten rounds in a row where any check has passed false, counted across runs, stops the build. A new request from the person resets it. |
UNCHANGED_TURN_LIMIT | 2 | Two agent turns in a row that leave the contents of app/ unchanged count as no progress and stop the run. |
The last one is the practical one. An agent will sometimes reply "fixed it" without having touched a single file. Craft Anything doesn't take the agent's word for it; it compares a fingerprint of the app/ folder before and after each turn.
"Good enough to stop fixing" is not a single score either. CheckResult::good requires all four of these:
pub fn good(&self, good_enough: f64) -> bool {
self.passed
&& self.unknowns.is_empty()
&& self.claims.iter().all(|c| c.passed)
&& self.similarity.is_none_or(|s| s >= self.good_enough.unwrap_or(good_enough))
}
The build has to work, nothing may be left uncompared (unknowns), every individual claim (for example, "the original's About menu exists in the build") has to hold, and the similarity has to clear the bar. A single leftover unknown keeps a check from being good, however high the score.
good only decides whether to keep fixing, though; being marked done is separate. When the fixes run out, or only differences another builder turn can't resolve are left, the loop ends, and if the last check's passed flag (the build runs and renders) is true, the status becomes Ready. So a build can be Ready with a score below 90. The finish message includes the score and the number of open questions, and those numbers matter more than the Ready label.
7. Evidence Records: The Unit of Every Answer
Analysis tools return their results as Evidence records; some tools, such as those reporting session or run status, return plain values instead. The type is defined in crates/evidence, the lowest layer, and every crate above it uses the same format.
pub struct Evidence {
/// `ev_` + 64 lowercase hex: SHA-256 of the canonical JSON of every other field except `summary`
/// and `subject.name` (display-only).
pub id: String,
pub subject: Subject,
pub operation: String, // the tool that produced it, e.g. native_function_pseudocode
pub params: Value,
pub result: Value,
pub summary: String, // one or two sentences for people; left out of the id
pub confidence: Confidence,
pub authority: Authority,
pub environment: Environment,
pub limitations: Vec<Limitation>,
pub coverage: Coverage,
pub locations: Vec<Location>,
pub links: Vec<String>, // ids of the evidence this was derived from
pub carries_target_content: bool, // also left out of the id
}
Four fields stand out.
id is a hash of the content. Run the same tool on the same target with the same parameters in the same environment and you get the same id. environment (engine version, host and so on) is part of the hash, so another machine or version may produce a different id. The human-facing summary and the display flag carries_target_content are excluded, so polishing the wording never changes the id. Records point to each other through links, so you can trace a conclusion back to the observations it came from.
confidence has three levels. Observed (read directly from the target), Derived (computed from observations by a deterministic function, such as a CFG) and Inferred (heuristics or a model's interpretation). However plausible an AI's judgement is, it is recorded as Inferred.
authority is the kind of source. The shipped files (OriginalFiles), a run the tool controlled (OurRun), a historical record (EarlierRecord, such as a HAR file), an outside service (OutsideService), or someone's interpretation (Reasoning).
carries_target_content is a prompt-injection guard. When a result embeds strings pulled from the target, decompiled code or a page body, this flag is true. The comment says the reader must treat that content as data from an untrusted artifact, never as instructions. A binary under analysis could easily contain a string like "ignore previous instructions".
Results too large for the MCP response budget come back as a summary first, with the rest paged through core_evidence_browse. coverage records how much of the whole was examined and, if pages remain, the next offset. The design keeps an agent's context window from filling up in one go.
8. The Clean Room Is an Allow List
The tools allowed in Clean room mode are listed one by one, by name, in the TOOLS array in crates/engine/src/clean_room.rs. There are currently 115. Anything not on the list is Deep-only. The comment at the top of the file states the principle:
Every other tool, a plugin's included, needs Deep mode, so a new tool is Deep-only until it's added here.
In other words, a newly added tool starts out blocked. To get on the list, a tool must either touch no target at all (sessions, settings, project management) or only look from the outside the way a visitor or user would (screenshots, window captures, the list of controls on screen).
The check happens twice on the way to running a tool: once in Engine::availability, which the UI uses to grey out buttons, and again right before the actual call.
if session.clean_room() && !clean_room::allows(spec.id) {
return Err(clean_room::refusal(spec.id));
}
The refusal carries details.reason = "clean_room", and clients use that value to show a "turn on Deep mode to use this" hint. Tests pin the boundary down too: looking_inside_needs_deep_mode checks that tools such as native_function_pseudocode, web_page_show and game_archives_list are refused in Clean room.
8.1 The Agent CLI's Permissions Follow the Same Principle
Blocking engine tools isn't enough on its own, because Claude Code has its own Read and Grep tools that could read the original's folder directly. docs/claude-code.md explains how this is handled when Claude Code is the builder.
- Claude Code is launched as a child process with
claude -p <task> --output-format stream-json, and--mcp-configplus--strict-mcp-configconnect only Craft Anything's MCP server. --permission-prompt-tool mcp__craft-anything__core_action_approveroutes permission prompts to Craft Anything's own tool. It allows edits inside theapp/folder and a fixed list of build commands such asnpm run buildandcargo buildstraight away. Dev servers such asnpm run devnever exit, so it refuses them. Everything else (the web, commands, files outside the project, pushing and publishing, deletes, system changes) is set per project and per kind to allow, ask or refuse, and any kind left unset follows Auto mode. A card appears in the app only for kinds set to ask.- In Clean room, even
Read,GlobandGrepare not pre-allowed; they go through the approval tool, which refuses any read aimed at the original's folder or site (the project folder excepted). Craft Anything's own MCP tools are pre-allowed at this layer; the engine's allow list guards them separately. - Claude Code's own question tool is turned off with
--disallowedTools AskUserQuestion. Instead,core_person_askputs a card with buttons in the app.
The documentation is upfront about the limits. Auto mode allows commands by default, and an agent that is allowed to run commands runs with the user's permissions and could read the original some other way if it wanted to, so these measures "raise the bar; they aren't a wall". The README likewise says Clean room is a rule about what Craft Anything offers and refuses, not an operating-system sandbox. Chats and questions use different controls from builds: a Claude Code chat turns off its file tools with --disallowedTools, and an ACP chat refuses the agent's own read, write, command and fetch requests.
9. How Is a Build Graded?
9.1 Websites: Three Widths, Two Metrics, a Noise Mask
Website comparison is handled by WebVisualCheck in crates/ai/src/rebuild/kinds/website.rs. The default widths are [1440, 768, 390], and settings can change them to up to four widths between 320 and 3840 px. The start page and any other pages recorded during Study (4 by default, at most 12) are captured at each width and paired with the original's screenshots. A width the original was captured at but the build can't be compared at becomes an unknown.
Each width scores the average of two metrics; widths are averaged within a page, then pages are averaged.
let Some(layout) = res.get("layout_similarity").and_then(Value::as_f64) else { return Ok(None) };
// Layout alone is generous to mostly empty pages; detail (SSIM) sees text and edges.
let detail = res.get("perceptual_similarity").and_then(Value::as_f64).unwrap_or(layout);
Ok(Some(((layout + detail) * 50.0, layout * 100.0, detail * 100.0, h("before"), h("after"))))
layout_similarity is the share of 16 px tiles whose mean colour matches, and perceptual_similarity is SSIM on brightness. The comment gives the reason: layout alone is too generous to mostly empty pages, while SSIM picks up text and edges.
Some regions are left out of the comparison. Study runs a noise pass (noise_pass: true) that photographs the same page twice more, about 0.9 seconds and then another 1.3 seconds later. The tiles that differ from the first shot are combined into a noise-<width>.png mask of the parts that change on their own (carousels, ads, clocks); if nothing changed, no mask is written. Those regions are ignored during grading, so the build isn't penalised for parts where the original doesn't even match itself.
Beyond the page screenshots, the check also captures and pairs up the states with menus, pop-ups and tabs open (states_note), and can run an accessibility floor (a11y_floor) on the build alone. A menu missing from the build becomes a failed claim; the accessibility floor is off by default.
9.2 Apps and Games: Make Them Take Their Own Picture
Desktop apps and games are hard to photograph from outside the way a website can be. So the brief given to the agent includes a contract:
Give the program a
--screenshot <file.png>option: start normally, draw about 120 frames, save the window's picture as a PNG to that file and exit.
After each build, the engine runs the program with that option. No picture, or a blank one, means the build doesn't pass. A console program with no window has its recorded runs compared instead. The contract even spells out, per stack (egui, Unity and others), how to keep the window from stealing focus, so the check doesn't pop up in front of whatever the user is doing.
There are two picture comparisons. If the person added pictures of the original, the build's shot is scaled to 640×360 with them and scored against the closest one. If Study pictured the original's window, the build is also launched normally and a note records how alike the two windows look. When both UI trees (ui-tree.json) exist, each of the original's labelled interactive controls (up to 20) becomes a claim the build must satisfy. Picture scores are advisory by default; setting build.picture_good_enough makes them part of the decision to keep fixing.
10. Register One Tool, Get Four Entry Points
Tools are defined as a ToolSpec in crates/engine/src/tools/<area>.rs.
pub struct ToolSpec {
pub id: &'static str, // snake_case id; the MCP tool name, kebab-case on the CLI
pub title: &'static str,
pub summary: &'static str, // for agents and experienced users
pub beginner: &'static str, // plain-English text for Beginner mode
pub toolset: Toolset,
pub effects: Effects,
pub requires: Requires,
pub input_schema: fn() -> Value,
pub run: ToolFn,
}
Registering one of these creates a CLI subcommand, an MCP tool, a tool for the built-in AI agent and an entry in the desktop app's command palette, all at once. Higher-layer tools such as rebuild_* and plugin tools are registered separately but land in the same registry. The input schema is generated from a Rust type with schemars, and both the CLI options and the MCP schema draw on it. Each tool also carries two descriptions, summary and beginner: short and precise for agents, plain words for first-time users.
The repository's agent rules (AGENTS.md) say panels should change engine state only through registered commands, meaning anything the UI can do must also be doable through the automation interface. The table in crates/ui-egui/tests/headless_parity.rs keeps track of this, classifying every app action as Tool, Cli, Pending or UiOnly. The rule is a SHOULD, though, and the table still has Pending actions with no automation path yet and UiOnly ones that only work in the window.
The MCP server doesn't expose all 300-plus tools up front. Toolsets for each area are switched on with enable_toolset when needed, which saves the agent's context. The same rules say, as a MUST, that MCP entry points refuse to start without --automation-read-root and --automation-write-root and refuse file access outside them. The CLI at this commit has neither flag, though. I started craft-anything-cli mcp without them and sent an initialize request, and it answered normally. The rule and the implementation don't match yet.
11. Suggested Reading Order
docs/extending.md: the "to add X, change Y" table and the workspace map. It works as a table of contents for the whole repository.crates/evidence/src/lib.rs:Evidence,Confidence,Authority,Coverage. A little over 700 lines, so a quick read.crates/engine/src/tool.rsandcrates/engine/src/lib.rs:ToolSpecand the call path, including where the Clean room check happens.crates/engine/src/clean_room.rs: the 115-entry allow list, the refusal error and the boundary tests in one file.crates/ai/src/rebuild/mod.rs: the header comment and the check loop (around line 1,200) give you the rebuild flow.crates/ai/src/rebuild/kinds/website.rsandscreenshot.rs: how grading works.docs/claude-code.md: which flags Claude Code is launched with and how its permissions are tied down.docs/pitfalls.md: a collection of past mistakes and how they were fixed.
12. Design Points Worth Noting
1. The engine measures, the agent generates. No AI takes part in a website's Study or Check. Captures aren't pixel-identical from one shot to the next (that is what the noise pass is for), so the whole pipeline isn't deterministic, but grading the same two captures always gives the same score. The uncertainty is concentrated in Build, and its output is measured again by fixed rules.
2. It looks at files and pixels, not at what the agent says. Instead of trusting "I fixed it", it checks whether the app/ folder's fingerprint changed. Instead of trusting "it looks similar", it compares screenshots. The rules for writing checks say the same thing: decide on passed and similarity, never on text.
3. It doesn't hide what it doesn't know. A width it couldn't compare goes into unknowns, and any unknown keeps a check from being good. The finish message also says how many questions about the original are still open.
4. The default is no. A new tool is born Deep-only, and someone has to write its name on the allow list before it runs in Clean room. Plugin tools follow the same rule and by default ask for the user's consent on every call.
5. The contribution rules mirror the product's clean-room principle. AGENTS.md requires that an agent operating a proprietary app only writes a behaviour specification, and that an agent writing code never operates that app or reads its install. That is the legal clean-room design process (separating the spec team from the implementation team) applied to contributing to the repository. There is also a rule against reading any GPL-family source at all.
13. Things to Watch Out For
1. The name says clean room, but that is not a legal guarantee. Clean room mode is a tool policy: nothing inside the original is read. Even a build made only from screenshots can run into trouble if it copies designs, trademarks or wording. The README describes Deep mode as "for your private use". Anyone using this for real should check the target's license and terms separately.
2. A score of 90 means "looks similar", and Ready means "it builds". The website score comes from pixel layout and SSIM. It says nothing about whether behaviour that isn't directly visible, like form submission, login or data flow, matches. For apps and games, picture scores are advisory by default. And as section 6 showed, a build can reach Ready with a score below the bar once the fixes run out.
3. Agent integrations vary in maturity. Claude Code is supported first. According to the README, the Codex adapter hasn't been verified on a real install, and Kimi Code CLI hasn't been run live yet. The docs say agents such as Codex, Gemini CLI and OpenCode are not held to these Clean room constraints in a chat and keep only whatever sandbox they have. And as section 10 showed, the file-access rule for MCP entry points isn't implemented yet.
4. The built-in decompiler is still rough. As section 5 showed, a comparison can go missing around a cmp and csel pair, which is easy to miss unless you also read the result's limitations. The project's advice when accuracy matters is to install Ghidra and use Deep mode.
5. It is changing very fast. Four weeks produced 2,240 commits, and the version is 0.6.1. The top three contributors have each pushed between 300 and 470 commits. The numbers in this post (tool counts, allow-list size, thresholds) may not stay accurate for long.
14. Conclusion
The core of Craft Anything lies less in the AI than around it. The agent only writes code during Build; examining the original and grading the result are mostly left to the fixed rules of a 325,000-line engine. That engine records every result as an evidence record with its source and confidence, runs only allow-listed tools in Clean room, and captures each build the same way as the original, sending it back for fixes until the score reaches 90 and nothing is left unknown.
If you are building a tool that hands work to an agent, there is a lot to borrow here. Measure what the agent built yourself rather than asking the agent. Start every capability at "no" and open them one at a time. Leave what you don't know in the result, in plain sight. None of these three ideas is specific to reverse engineering; they carry over to agent tools in any field.
15. How It Relates to Earlier Posts
It sits close to three repositories this blog has covered.
| Project | In common | How Craft Anything differs |
|---|---|---|
| DeepSeek Harness | Both design how an agent gets tools and permissions | DeepSeek Harness builds the agent runtime itself. Craft Anything launches an existing agent CLI as a child process and only tightens its permissions. |
| HyperFrames | Both capture a headless browser to look at the result | In HyperFrames the captured frames are the product. In Craft Anything they are grading material compared against the original. |
| Lemo-Opuscar | Both check an agent's output with tools | In Lemo-Opuscar the agent calls the checking tools itself. In Craft Anything an outer loop does the checking and sends the agent back when the score is low. |
Analysis date: 2026-11-29 Commit analysed:
8356b96(mainbranch, 2026-11-29) Repository: https://github.com/storytold/craft-anything (MIT OR Apache-2.0) Test environment: Apple M5 Pro (15 cores), macOS 27.2, Rust 1.97, Apple clang 21.0 (-O1).craft-anything-cliand desktop app 0.6.1 release builds, Ghidra not installed. Analysis target: antirez/kilo323d93b(BSD 2-Clause). Rebuild target: this blog's https://martianlee.github.io/projects, builder Claude Code, Clean room. The run was stopped after eight self-checks, before the engine's check rounds.
Written with Claude Code