Craft Anything: Pure-Rust Reverse Engineering Meets Closed-Loop Coding Agents

How storytold/craft-anything pairs a 320-tool pure-Rust inspection engine with an autonomous Study-Build-Check loop—and where its Clean room vs. Auto mode trust boundaries actually hold.

13 min read
Craft Anything: Pure-Rust Reverse Engineering Meets Closed-Loop Coding Agents

Point an AI coding agent at a compiled binary or a live website, and it can guess blindly or skip verification. If you saw viral clips calling it “Graph Anything”—a tool that clones any app or game on autopilot—the real repository is Craft Anything (storytold/craft-anything, 42,727 GitHub stars on 2026-11-24).

One-shot screenshot-to-code prompts dump out files and stop. Craft Anything takes a stricter path. It pairs a pure-Rust inspection engine (~320 tools) with a closed-loop Study → Build → Check → Ready harness that drives your own local coding agent.

That design improves auditability and visual checks. It also creates sharp tradeoffs around token cost, shell trust, and alpha maturity. Below, we unpack how the engine works, what kind of agent it runs, and which CLI and MCP workflows are ready to use today.

TL;DR

  • What it is: storytold/craft-anything (v0.6.1, MIT/Apache-2.0) is a pure-Rust reverse-engineering and clean-room rebuild engine. It is not a hosted SaaS cloner.
  • What problem it solves: It replaces blind one-shot generation with structured evidence records (ev_<sha256>), deterministic inspection, and multi-round checks. Websites get 3-viewport SSIM and layout diffs; games get --self-test checks.
  • The autonomous agent: Craft Anything ships no bundled builder model. It orchestrates your local coding CLI—primarily Claude Code (claude -p), plus adapters for Copilot CLI, Devin, Grok Build, DeepSeek Harness, OpenCode, Maki, and Aider—with adapter-specific permission wiring.
  • The trust boundary: Its default Clean room mode is an engine-level allowlist, not an OS sandbox. Because Auto mode defaults to commands: allow, an agent running build commands still executes as your OS user.
  • Best use today: As of docs/STATUS.md (last updated 2026-11-21, accessed 2026-11-24), live Clean room end-to-end builds remain unverified in maintainer tests. Its pure-Rust CLI and MCP toolkit (triage, report, mcp --restricted) is far more mature right now than unattended cloning [INFERENCE].

What Craft Anything Is (and What Problem It Solves)

In earlier posts on spec-to-spec legacy migration and reverse-engineering features into Spec Kit artifacts, we covered white-box workflows where you own the source repo. Craft Anything targets a harder surface: external websites, compiled binaries, mobile packages, archives, and games without clean source code.

Point an ordinary coding agent at a compiled binary or live web app, and two things break fast:

  1. Context collapse and hallucination. Raw disassembler dumps or minified JavaScript blow out context windows. When an agent guesses what a function does, nothing separates observed facts from model guesswork.
  2. Unverified “done” states. An agent happily reports a finished clone while buttons fail, mobile layouts overflow, or a game drops its HUD.

Craft Anything splits deterministic inspection from probabilistic code generation, then forces the output through a verification loop before marking a project Ready.

Core Architectural Decisions

Reading Cargo.toml, docs/ROADMAP.md, and crates/evidence/src/ in v0.6.1 (2026-11-12) shows four core design choices:

1. One Pure-Rust Engine, Four Front-Ends

The workspace forbids unsafe Rust (unsafe_code = "forbid" in Cargo.toml). In v0.6.1, its core decoders run in pure Rust: object, iced-x86, yaxpeax-arm, oxc_* for JavaScript, wasmparser, and in-tree crates/formats parsers for PE, ELF, Mach-O, DEX, ASAR, SQLite, HAR, and PCAP (main has since moved several parsers into storytold/craft-libs).

Per docs/ROADMAP.md, the project follows a headless-first rule. Orchestration, persistence, and process control live in crates/engine, crates/ai, and crates/platform—never in the egui desktop UI. Because workflows route through Engine::call, the desktop app, craft-anything-cli, and the MCP server (crates/mcp) share the full engine. The WebAssembly viewer (apps/craft-anything-web) reuses a wasm-safe subset for browser-local file triage.

2. Evidence-First Records (crates/evidence)

Instead of returning unstructured text blobs, inspection tools emit typed Evidence structs (crates/evidence/src/lib.rs) carrying explicit provenance and limits:

  • Confidence (categorical, not a probability): Observed (read directly from bytes or captured requests), Derived (computed deterministically, like a call graph), or Inferred (heuristics or model interpretation).
  • Authority: OriginalFiles, OurRun, EarlierRecord, OutsideService, or Reasoning.
  • Coverage & Limitations: Tracks Complete, Partial, or Unknown status with examined, total, and next_offset fields so agents know when output was truncated.
  • Canonical ev_<sha256> IDs: Evidence::compute_id hashes canonicalized JSON (excluding mutable display fields like id, summary, carries_target_content, and subject.name) to verify imported records. Single-file targets pin input bytes with SHA-256 (ErrorCode::FileChanged if modified, per target.rs). Directory targets hash only the path string, so contents can change on disk without triggering a stale-target error.
  • Separate Unknown tracking: Open questions (unknown.rs) use optimistic concurrency revisions (StaleRevision on mismatch) and require at least one evidence_for record before marking a question Resolved.

3. Trait-and-Registry Extensibility

docs/ROADMAP.md bans giant match blocks for core product types. Target formats, verification checks, AI builders, asset providers, and external engines (like Ghidra or JADX) sit behind traits and registries, while build recipes and model catalogs live in data tables such as toolchains.toml. Adding a new language stack or agent adapter does not require rewriting the core loop.

4. Bounded Closed-Loop Verification (Study → Build → Check → Ready)

Every rebuild follows four stages:

  1. Study: Inspects the target—capturing pages across screen widths, colors, fonts, and opened menus (or files, disassembly, and JS in Deep mode).
  2. Build: Invokes a local coding agent to scaffold a project in app/. It uses your requested stack, or defaults to Rust + egui for apps and Unity/Unreal/Godot for games.
  3. Check: Compares the build against the original. Per docs/STATUS.md and andrew.ooo’s v0.5.0 review (2026-11-08), websites are served on loopback and compared at 1440px, 768px, and 390px using layout metrics plus perceptual SSIM (ignoring dynamic areas across three captures). Games must pass --self-test for movement, actions, and HUD rendering.
  4. Termination & Ready: Refinement stops at 90% likeness or when rounds run out (default 6 in the app, 2 in the CLI via --rounds). If the build fails usability checks at the round limit, Craft Anything returns ProgramFailed. A working build can still be marked Ready below 90%, and visual similarity alone does not prove functional correctness.

Inside the Autonomous Agent: Orchestration and Trust Boundaries

Craft Anything does not ship its own hosted LLM for building. Instead, crates/ai acts as a local agent harness that spawns your own installed coding CLI and intercepts its tool calls and permissions.

flowchart TD
    U[User Request & Target] --> E[Craft Anything Rust Engine]
    E -->|Clean room default| CR[clean_room::allows Allowlist]
    E -->|Opt-in Deep mode| DP[Full Disasm / JS AST / Ghidra]
    CR --> S[1. Study: Observable UI & Layout]
    DP --> S
    S --> B[2. Build: Spawn Local Agent<br/>claude -p / ACP / DSH]
    B -->|Permission prompt| AP[core_action_approve]
    AP -->|Workspace-bound check| OL{off_limits?}
    OL -->|Yes in Clean room| DENY[Deny Access]
    OL -->|No| CAT{ActionKind Policy}
    CAT -->|Auto mode: commands allow| OS[Host OS Execution as User]
    CAT -->|publish / delete_outside / system| ASK[Refuse or Ask Inbox Card]
    OS --> C[3. Check: 3-Viewport SSIM / --self-test]
    C -->|Below threshold & rounds left| B
    C -->|Threshold or round limit| VER{Usable build?}
    VER -->|Yes| R[4. Ready / Project Folder]
    VER -->|No| FAIL[ProgramFailed]

How It Drives Claude Code and Other Builders

For its primary builder, Claude Code, Craft Anything spawns your unmodified claude binary in headless mode (claude -p <task> --output-format stream-json --verbose), passing:

  • --strict-mcp-config and --mcp-config pointing to craft-anything-cli mcp
  • --permission-prompt-tool mcp__craft-anything__core_action_approve
  • --disallowedTools AskUserQuestion (routing questions to Craft Anything’s core_person_ask UI/CLI prompt instead)

Craft Anything never reads or proxies your Anthropic credentials—you sign in via claude auth login, keeping usage under your own agreement (docs/claude-code.md, 2026-10-31). Note, however, that local orchestration is not local inference. With cloud-backed CLIs, any target-derived context the agent reads goes to your model provider.

Beyond Claude Code, v0.6.0 and v0.6.1 support ACP-based agents (Copilot CLI, Devin, Grok Build, Maki), DeepSeek Harness (via a generated --patch overlay), OpenCode, and Aider (which gets no Craft Anything tool server). Permission interception depends on each adapter. Grok Build and Aider refuse Clean room runs because Craft Anything cannot block their native file or shell reads (v0.6.0 release notes, 2026-11-09).

Clean Room vs. Auto Mode: Policy, Not a Sandbox

This is the single most important architectural boundary to understand before running Craft Anything on a work machine:

Control LayerWhat It EnforcesWhat It Does Not PreventSource
Clean room (clean_room.rs)Refuses internal inspection tools (core_target_open, core_target_triage, native_function_pseudocode, js_app_map) in Engine::call_innerDoes not isolate the OS, network, or filesystem from shell commandsclean_room.rs
off_limits in core_action_approveFor workspace-bound rebuilds (with --inbox), blocks Read/Glob/Grep/writes targeting the original’s folder or WebFetch to the original’s hostUnavailable without a readable rebuild workspace/inbox, and bypassed by shell scripts that construct paths dynamicallyinteraction_tools.rs
Auto mode (workspace.rs)Refuses publish, delete_outside, system, and other_tools by default; auto-allows commands and outside_filesAny side effect inside an allowed npm install, cargo build, or arbitrary shell commandworkspace.rs
MCP Restricted (--restricted)Hides and blocks consent-requiring machine tools (EXECUTES_FOREIGN_CODE, MUTATES_DEVICE), ADB, and network tools; web and capture have separate opt-insNot a read-only policy (WRITES_FILESYSTEM / LAUNCHES_PROCESS remain allowed unless blocked elsewhere), and cannot restrict the client’s own native toolscrates/mcp/src/lib.rs

As a comment in interaction_tools.rs puts it: “with commands allowed, the builder is trusted that far” (and docs/claude-code.md notes the same trust boundary). Clean room is an engineering discipline and tool-level gate, not an OS container or legal immunity. For broader context on why approval flags must sit beside hard controls, see Agent Risk Flags Are a Setting.

How to Use It: Verified CLI & MCP Examples

You do not need an AI subscription to use Craft Anything’s inspection engine. All examples below are verified against apps/craft-anything-cli/src/ in v0.6.1.

1. Check Your Environment and Integrations

Start with doctor to verify binary availability, installed external engines (such as Ghidra or JADX), AI CLI reachability, and an MCP stdio self-test (with a 20-second timeout):

craft-anything-cli doctor

To see how Craft Anything would register its MCP server and skills with Claude Code (or Cursor/Codex) without modifying config files:

craft-anything-cli setup --dry-run --client claude_code

2. Inspect a Binary With Zero AI Tokens (Deep Mode)

Under default settings (Clean room), core_target_open is refused—so triage on a local binary requires --deep for that run. Pair it with --project if you want a persistent .cany workspace that later commands can read:

# Inspect a binary you own or are authorized to analyze (0 LLM tokens used)
craft-anything-cli --deep --project ./audit.cany triage ./target-binary

# Generate a Markdown report backed by the project's evidence ledger
craft-anything-cli --project ./audit.cany report --out ./report.md

Note that report --html selects HTML output (global --format controls CLI output format, not the report file format).

3. Serve the Restricted MCP Server (Clean Room Recipe)

Independent of the Deep-mode workflow above, you can expose Craft Anything’s inspection tools to Claude Code, Cursor, or another MCP client without ADB, consent-requiring device tools, or general network tools:

# Reduced-exposure MCP server (blocks ADB, consent-requiring, and network tools; not a read-only or OS sandbox)
craft-anything-cli mcp --restricted --clean-room

# Opt in to website opening and screenshot capture only when needed (does not re-enable ADB)
craft-anything-cli mcp --restricted --clean-room --allow-web --allow-capture

Remember that --clean-room here blocks core_target_open and binary disassembly; switch to --deep only if you are deliberately exposing authorized binary analysis over MCP.

4. Run a Bounded Headless Rebuild

When you want the full Study → Build → Check loop from the terminal, rebuild creates a project folder, invokes your coding agent, and stops after --rounds refinement passes (default 2 in CLI):

# Unattended prompt handling: picks first choice on questions, refuses out-of-project inbox approvals
craft-anything-cli rebuild https://example.com "Recreate this landing page" \
  --rounds 2 \
  --unattended

Security preflight: --unattended only auto-answers inbox prompts; default Auto mode still allows build commands and ordinary outside-project writes without asking. This is not a project-confinement flag—run untrusted rebuilds in a disposable container or VM without host credentials or broad mounts.

Alpha Reality Check: Costs, Loops, and Production Limits

Before adopting Craft Anything into a team workflow, weigh four realities documented in the repo’s own docs/STATUS.md (last updated 2026-11-21, accessed 2026-11-24) and community issue tracker:

  1. Token burn is real. Craft Anything is free (MIT/Apache-2.0), but rebuild bills your own Claude Code subscription or API key. Multiple refinement rounds—plus optional fal.ai asset generation—burn quota fast, which is why CLI builds default to --rounds 2.
  2. Visual likeness is not functional correctness. A website scoring 90% on 3-viewport SSIM + layout diffing can still ship broken forms or missing auth logic. Behavior checks for apps and games are still maturing (STATUS.md).
  3. Agent maturity is uneven. While v0.6.1 records live runs for Devin (Windows, 2026-11-03), Maki (Linux, 2026-11-02), Grok (Deep mode, 2026-11-06), DeepSeek Harness (macOS arm64, 2026-11-07), and Copilot CLI, Claude Code remains the primary tested path. Earlier alpha reports documented empty-build loops (issue #736 with gemini-cli) and argument mismatches on small local models (issue #498), though later releases shipped fixes.
  4. Live Clean room builds remain unverified upstream. In docs/STATUS.md (last updated 2026-11-21), maintainers note: “Clean room and Deep mode: engine, AI, MCP, CLI and app tests; no live Clean room build run yet”. Auto mode likewise says “Unit tests, UI tests; not tried in a live build.”

Bottom line: Treat Craft Anything v0.6.1 as two tools in one repo. As an unattended “clone any app” button, it is an early alpha with real IP, shell-trust, and token-cost caveats. As a pure-Rust, evidence-backed MCP and CLI reverse-engineering toolkit for authorized targets, it is already a disciplined piece of engineering [INFERENCE].

Sources