Four ways to rebuild an app with an AI agent: blind quality scores and cost per run for Hybrid, REA-Direct, Pipeline and Baseline

Indexnine Whitepaper

Four Ways to Rebuild an App With an AI Agent: Cost and Quality, Measured

We asked an AI coding agent to rebuild the same desktop app eight times, using four different working methods. We measured what each method cost and scored every result blind.

This report shows what we found and how sure we are. Each run was a clean-room reverse engineering exercise: the agent could study what the original app does, but not copy any of it.

Model

claude-opus-5-5 in Claude Code 2.1.310–2.1.312

Machine

Apple M4, 10 cores, 16 GB, macOS 27.0.1

Target app

A popular commercial meeting-notes app for macOS (studied for behaviour only)

Spend

$159.53 for 8 builds, $12.57 for 8 evaluations

The four methods

Same task,

four amounts of process

Each method ran twice and was scored out of 100. They range from plain Claude Code to a full multi-agent pipeline, with REA, a set of reverse-engineering tools for studying the original app, in between.

Four AI agent methods by amount of process: Baseline with standard tools, REA-Direct with reverse-engineering tools, Hybrid with REA plus 5 plugin agents, and Pipeline with the full plugin and 241 to 409 subagent transcripts per run
Key findings

Six findings from

eight blind-scored builds

What the scores, costs and security checks showed, and how much weight each result can carry.

The bottom line

REA-Direct gives the best value, with near-top quality at about $6 a run. Choose Hybrid when security matters most: it was the only method to pass every security check, at about 3× REA-Direct’s cost.

Which method fits your rebuild: choose Hybrid at about $19 a run when security is the top priority, otherwise REA-Direct at about $6 a run

1. The question

Teams now use AI coding agents to rebuild existing software. There are many ways to direct such an agent. Some teams just give it the task. Others add special tools, or a full step-by-step process with many helper agents. More process costs more. We wanted to know if it also gives a better product.

Question: when an AI agent rebuilds a desktop app from scratch, how do four working methods differ in cost and in the quality of the finished app?

Why a desktop app? We chose one mid-sized desktop app for this first experiment: its shipped app can be studied locally, and it is small enough to rebuild eight times. The four methods are not limited to desktop apps. A web app with a backend can be studied and rebuilt the same way.

2. Experiment setup: a clean-room reverse engineering task

How the test worked: one spec, eight builds, blind copies, a fresh evaluator and a 100-point rubric covering features, test evidence, security, UX states, and build and size

The task

Every run got the same written specification. It asked for Meetpad, a local-first macOS meeting-notes app. The agent had to learn how the original app behaves and then build its own version. This is called a clean-room rebuild: the agent may study what the original does, but it may not copy its code, prompts, images or text, and it may not call the original app’s servers.

The stack was fixed: Tauri 2 desktop shell, React + TypeScript + Vite for the UI, Rust for the backend, on-device speech-to-text with whisper.cpp (whisper-rs, Metal), the Claude Messages API over raw HTTP, and SQLite. Six features were required:

  1. Notes: create, edit, list, search, delete.
  2. Record a meeting with live on-device transcription.
  3. “Enhance”: Claude merges the user’s notes and the transcript, with at least 3 templates.
  4. Chat about the current note.
  5. Show upcoming macOS Calendar events and create a note from one.
  6. Settings with an API key field that never shows the saved key again.

Each run also had to deliver a README, automated tests (npm test, cargo test), a release build of Meetpad.app, and a DONE.md summary.

How one run works

  1. A fresh, empty folder and a fresh agent session.
  2. The agent gets the same base prompt plus one method section.
  3. It works alone, with no human input, until it writes DONE.md.
  4. We log every token, call and minute from the session transcripts.

3. Design and controls

Design: a randomised complete block design with 4 methods × 2 blocks = 8 runs. In each block, all four methods ran at the same time on the same machine. So time of day, machine load and account limits hit every method equally. Run IDs were assigned to methods at random (seed 20261027).

Block Started (UTC) Baseline REA-Direct Pipeline Hybrid
1
26 Oct 20:54
R3
R4
R2
R1
2
27 Oct 18:52
R6
R8
R7
R5

Held constant: the same model (claude-opus-5-5, also for all subagents), Claude Code in headless auto mode, spec and prompt frame, machine, tools and API key. No human input after launch. Runs could not read other runs or the experiment files (0 blocked-path calls in all 8 runs). Each run had at most 12 work attempts and 48 hours.

4. What we measured

Cost

  • Output tokens: the tokens the model wrote, from the session transcripts, including all subagents, with duplicates removed. This is the main cost measure.
  • Total tokens: input + cache writes + cache reads + output.
  • Cost in USD: Claude Code’s own running total for the session (total_cost_usd), at API prices. The account was on a subscription plan, so this is an API-equivalent figure.
  • Active time: the time between transcript events, with gaps of 5 minutes or more removed (waiting for limits is not work).

Quality: blind scoring

  1. After both blocks, each of the 8 apps was copied without its process files (analysis notes, logs, DONE.md). Names that showed the run were replaced.
  2. Each copy got a random letter. The key was hidden from the evaluators.
  3. A fresh agent session (same model) evaluated each app. It built the app from a clean copy, ran the tests, ran a real end-to-end scenario with live Claude calls, and took screenshots of its own app window. It never saw other apps, the runs or this protocol.
  4. It scored the app on a fixed 100-point rubric and listed defects by severity.
Rubric part Points How it is scored
A. Features
30
6 required features × 0–5, each tried in the running app (0 absent … 5 solid)
B. Test evidence
20
Test pass rate (8), the end-to-end scenario: note → audio file → transcript → real Claude enhance → saved after restart (8), and whether the tests check real behaviour (4)
C. Security
20
10 checks × 2 points (see the security grid in §7)
D. UX states
15
5 states × 0–3: first run, no API key, no calendar access, empty notes list, enhance error
E. Build and size
15
Clean release build (5), app launches (5), app size: ≤ 50 MB 5, ≤ 150 MB 3, larger 1

5. Result: Baseline scored lowest in both blocks; the other three form one top group

Blind quality scores by method: Hybrid mean 87.5, REA-Direct 85.0, Pipeline 83.5 and Baseline 78.5, with gaps under 7 points possibly chance
Figure 1. Blinded quality score of every run (n = 8; 2 per method). ● = block 1, ◆ = block 2. The faint bar is the range and the dark tick is the mean.

Within each block, we compare methods that ran at the same time. Table 1 shows the paired differences.

Comparison Block 1 Block 2 Same sign in both blocks? Ranges overlap? Reading
Hybrid − Baseline
+11
+7
yes
no
Clear difference
REA-Direct − Baseline
+11
+2
yes
no
Clear difference
Pipeline − Baseline
+5
+5
yes
yes
Cannot separate
Hybrid − REA-Direct
+0
+5
no
yes
Cannot separate
Hybrid − Pipeline
+6
+2
yes
yes
Cannot separate
Pipeline − REA-Direct
-6
+3
no
yes
Cannot separate

Table 1. Score difference between two methods in the same block. “Clear difference” means the two methods’ ranges do not overlap (our pre-stated rule).

6. Result: Pipeline used 8.6× REA-Direct’s tokens for no gain in quality

Cost per run by method: Baseline $4.91, REA-Direct $6.22, Hybrid $18.91 and Pipeline $49.73, with quality points per dollar of 16.0, 13.7, 4.6 and 1.7
Figure 2. Cost per run and the quality it bought, means of two runs per method. Costs are API-equivalent estimates.
Per method (mean of 2) Baseline REA-Direct Pipeline Hybrid
Output tokens
101K
98K
840K
271K
Cost per run
$4.91
$6.22
$49.73
$18.91
Active time per run
26 min
34 min
111 min
61 min
Quality points per $
16.0
13.7
1.7
4.6

Table 2. Cost per method. Per-run values are in the appendix.

Related reading: why AI bills grow while token prices fall.

7. Result: only Hybrid passed every security check, in both runs

Security checks for all eight runs: both Hybrid runs passed all 10 checks, and 5 of 8 apps failed check 10, prompt injection

Security checks per run. Checks: 1 Key not in a plain file · 2 Key never sent back to UI · 3 No open localhost server · 4 No 0.0.0.0 bind · 5 Strict CSP · 6 Markdown sanitised · 7 SQL parameterised · 8 No secrets in repo · 9 Safe URL schemes · 10 Transcript treated as untrusted. Each check is worth 2 points. Every result cites a file and line or an observed behaviour.

Check 10 (prompt injection) was the main dividing line. A meeting transcript is text that other people spoke. If the app pastes it into a Claude prompt without care, a speaker could say “ignore your instructions…” and the model might obey. Both Hybrid apps (R1, R5) tell the model that meeting text is data and not instructions, and they stop that text from closing its own tags. A test checks both (R1: enhance.rs DATA_RULE + neutralize(), test rule_038; R5: prompts.rs:99-100, test sec002). Five of the six other runs failed this check. Pipeline R7 passed it on a lenient reading: it escapes the tags but has no “do not follow instructions” rule (see §10).

Other failures: Baseline R3 writes the API key to a plain text file (secrets.rs:72-90, mode 0600) instead of the macOS Keychain. Two separate evaluators found this. REA-Direct R8 sets no Content Security Policy (tauri.conf.json:16, “csp”: null), rated High.

How prompt injection through a meeting transcript reaches the model, and how the Hybrid apps stop it with a rule and a test

8. Result: features and security explain most of the gap

Rubric part (max) Baseline REA-Direct Pipeline Hybrid
A. Features (30)
22 (21, 23)
26 (25, 27)
23.5 (23, 24)
26 (24, 28)
B. Test evidence (20)
18 (18, 18)
19.5 (20, 19)
17.5 (17, 18)
19.5 (19, 20)
C. Security (20)
17 (16, 18)
17 (18, 16)
19 (18, 20)
20 (20, 20)
D. UX states (15)
10.5 (9, 12)
11.5 (12, 11)
10.5 (11, 10)
13.5 (12, 15)
E. Build & size (15)
11 (11, 11)
11 (11, 11)
13 (11, 15)
8.5 (11, 6)
Total (100)
78.5 (75, 82)
85 (86, 84)
83.5 (80, 87)
87.5 (86, 89)

Table 3. Mean score per rubric part, with both runs in brackets.

  • Features (A): REA-Direct and Hybrid averaged 26 and 26 of 30; Pipeline 23.5; Baseline 22. All eight apps built all six features, so the differences are about how well each feature works.
  • One Hybrid run’s release build failed. R5’s app does not build from a clean copy, because of a release setting (lto = true). The run never tested a clean rebuild, so it missed this. R5 scored 6 of 15 on part E, against 11 for most apps. It is the only build failure among the eight apps, and it is why Hybrid scores lowest on part E.
  • Size (part of E) mostly measures one choice. Seven apps bundle the 148 MB speech model (154–162 MB in total). Pipeline R7 does not: the user must point Settings to a model file. R7 gets full size points (20 MB) for that.

9. Hypothesis verdicts

We wrote the hypotheses down before the start of the experiment. Decision rule: with only 2 runs per method, we call a difference clear only if the two methods’ score ranges do not overlap. We do not use p-values. With 2 blocks, the smallest one-sided p-value a paired sign test can give is 0.25, so no test here could reach 0.05.

Hypothesis Prediction Observed (mean, range; n = 2 each) Verdict
H1 cost
Baseline ≈ REA-Direct < Hybrid < Pipeline
Output tokens 101K ≈ 98K < 271K < 840K. Hybrid and Pipeline ranges do not overlap with any other method.
Supported
H2 quality
Pipeline ≥ Hybrid > REA-Direct ≥ Baseline
Hybrid 87.5 > REA-Direct 85.0 > Pipeline 83.5 > Baseline 78.5. Pipeline did not lead. Only “REA-Direct ≥ Baseline” is clear.
Not supported
H3 efficiency
Hybrid within 10 points of Pipeline at ≤ 50% of its tokens
Hybrid scored +4.0 on average with 32% of Pipeline’s output tokens. This held in each block (+6 at 39%; +2 at 27%).
Supported
H4 REA effect
REA-Direct > Baseline on features (A)
REA-Direct 26 (25, 27) vs Baseline 22 (21, 23). The ranges do not overlap.
Supported
H5 plugin effect
Pipeline > Baseline on security (C) and tests (B)
C: 19 (18, 20) vs 17 (16, 18); the ranges touch. B: 17.5 vs 18, the wrong direction.
Not supported

10. Robustness checks: Hybrid or REA-Direct stays on top; Baseline is always last

We recomputed the averages with each rubric part removed in turn, and with one strict scoring rule for check 10. Scores were rescaled to 100.

Variant (rescaled to 100) Baseline REA-Direct Pipeline Hybrid Top method
Main result
78.5
85.0
83.5
87.5
Hybrid
Without A (features)
80.7
84.2
85.7
87.8
Hybrid
Without B (tests)
75.6
81.8
82.5
85.0
Hybrid
Without C (security)
76.9
85.0
80.7
84.3
REA-Direct
Without D (UX states)
80.0
86.5
85.9
87.1
Hybrid
Without E (build & size)
79.4
87.1
83.0
92.9
Hybrid
Strict reading of check 10
78.5
85.0
82.5
87.5
Hybrid
  • Baseline is last in every variant.
  • Without security (C), REA-Direct edges past Hybrid. Hybrid’s lead over REA-Direct therefore comes from security.
  • Without build and size (E), Hybrid’s lead grows, because R5’s build failure no longer counts.
  • Without UX states (D), Hybrid, REA-Direct and Pipeline are within 1.2 points of each other.

11. Evaluator agreement and audit

Two independent evaluators scored four apps; their totals differed by 3 points on average and by at most 7
Figure 3. The four block-1 apps were each scored twice by independent blind evaluators: once without screenshots (screen capture was broken then) and once in the final round with screenshots. Totals differed by 3.0 points on average and by at most 7. They agreed on 39 of the 40 security checks.

What we checked by hand

  • Isolation: 0 of 8 evaluator sessions read a blocked path (other apps, runs, results, transcripts, this protocol). None captured the full screen.
  • Claims re-checked against the code: the decisive ones, which are every failed security check, the build failure, the test failures and the app sizes.
  • Corrections: blinding removed two files that tests or the evaluators expected. Two hybrid apps (R1, R5) each have one test that reads analysis/BRIEF.md. We gave back that test (+0.1 each) after confirming it passes in the original run folder. “DONE.md missing” defects were dropped because blinding removed DONE.md on purpose (it is not scored). No other score was changed.
  • Uneven screenshot coverage: evaluators could capture the screen but could not click, because macOS Accessibility control was not granted. Apps with a built-in test or autorun mode (R1, R4, R5, R8) let evaluators reach more states and take 9–26 screenshots. The others got 2–3. This favours testable apps on part D.

12. Why: likely explanations

Explanation Rating Evidence
Writing must-have rules as named tests produces security that holds up
Likely
Only Hybrid’s prompt asked for a P0 rule contract with a test per rule. Both Hybrid runs passed all 10 checks; the prompt-injection fix in each traces to a rule test (rule_038, sec002).
Studying the original with REA, and running the real app with live API calls during the build, improve features
Likely, but the two are mixed
The two methods that used REA and live checks (REA-Direct, Hybrid) both averaged 26/30 on features. The two that used neither (Pipeline, which was allowed REA but made 0 calls; Baseline) averaged 23.5 and 22. Our design cannot separate the effect of REA from the effect of live checking.
More process and more agents do not add quality on a task this size
Unclear
Pipeline used 241–409 subagent transcripts and 8.6× REA-Direct’s tokens but scored lower. Its security step still missed check 10 in R2. Possible causes: coordination overhead, or the plugin being designed for human checkpoints we removed.
Differences come from the model, the machine or the time of day
Unlikely
All held constant or balanced by blocking. The Claude Code patch updates (D13) affected both blocks.

13. Limitations

  • Small sample. Two runs per method. We can see large effects only, roughly 7 points or more given the rater noise.
  • One app, one model. One mid-sized desktop app, built with claude-opus-5-5. Results may differ for large legacy systems, other stacks or other models.
  • One evaluator per app. Agreement was checked on 4 apps only (Figure 3).
  • Arms were built as supersets. Pipeline was allowed REA but never used it. A cleaner design would test REA and the plugin separately (a 2 × 2 design: with/without REA × with/without plugin).
  • The plugin was used without people. The code-modernization plugin expects human checkpoints. Here they were auto-decided, which may handicap Pipeline.
  • Interruptions. In block 1, account limits paused all runs; R1 and R2 finished a day later on an upgraded plan (D2–D6). Each run resumed its own session.
  • UI was hard to test. No screenshots in block 1 (fixed before block 2), and no click automation for evaluators.
  • No code-similarity check. We did not compare the apps’ code with the original app’s bundle. The clean-room rules were followed by instruction, not verified.
  • Blinding was not perfect. Some hints remained, such as test file names like live-loop.sh. Evaluators were not asked to guess, so we cannot measure this. Process folders, logs and run IDs were removed.

14. What we do not claim

  • That Hybrid is better than REA-Direct or Pipeline in general. Their ranges overlap.
  • That these results hold for other apps, bigger systems or other models.
  • That the code-modernization plugin is a poor tool. It was used outside its intended human-in-the-loop setting.
  • That the costs are what you would be billed. They are API-equivalent estimates.

15. Appendix and data

A. Every run, every number

Measure R1 R2 R3 R4 R5 R6 R7 R8
Method
Hybrid
Pipeline
Baseline
REA-Direct
Hybrid
Baseline
Pipeline
REA-Direct
Block
1
1
1
1
2
2
2
2
Letter
Z
N
M
K
Y
X
W
V
A
24
23
21
25
28
23
24
27
B
19
17
18
20
20
18
18
19
C
20
18
16
18
20
18
20
16
D
12
11
9
12
15
12
10
11
E
11
11
11
11
6
11
15
11
Total
86
80
75
86
89
82
87
84
Output tokens
283,019
718,015
90,881
100,340
259,766
110,170
962,967
95,697
Total tokens
36.87M
65.91M
4.32M
9.79M
23.66M
7.24M
72.70M
9.31M
API calls
291
1,166
67
99
260
75
1,847
75
Subagent transcripts
5
241

0

0

5

0

409

0

Cost
$23.92
$43.67
$4.90
$7.08
$13.91
$4.91
$55.78
$5.36
Active min
67.1
120.5
24.7
30.2
54.0
27.6
101.5
37.8
Tests
79/79*
74/74
48/48
38/38
80/80*
59/59
48/48
37/37
Scenario /8
7
6
6
8
8
6
6
8
Build/Launch
5/5
5/5
5/5
5/5
1/2
5/5
5/5
5/5
App MB
154
159
158
158
149.95
161
20
159
High/Med/Low defects
0/0/5
0/2/6
0/2/4
0/2/4
1/0/3
0/2/5
0/1/4
1/2/5
Screenshots
9
2
2
26
14
3
2
20

Table 4. Raw values per run. * = test count after the blinding correction (one test restored). The letter is the blind code used in scoring.

B. Deviations from the plan

14 deviations were logged (D1–D14), none affecting the comparison: block-1 screen capture and usage-limit pauses (R1 and R2 finished a day later on an upgraded plan), idle time, a Claude Code patch update, and two +0.1 blinding corrections.

C. Data availability

The full data behind this report is available on request: the plan and hypotheses with the full deviations log, the specification and the four method prompts, the random assignment, the scores, and the evaluators’ logs and screenshots. Contact us to request it.

Clean-room study: the original app was studied for behaviour only. No vendor code, prompts or assets are in the built apps by instruction; this was not independently verified.

Get started

Rebuild your app with AI, the right way

Share the problem you’re solving. We’ll reply with practical next steps.

Create at AI speed, with outputs you can trust.