React Native · AI harness · 18 min
The React Native AI Harness That Gets Faster Every Week
The surprising partBun rewrote a 535,496-line Zig codebase in Rust in 11 days. It wasn’t one heroic prompt, and it definitely wasn’t zero tokens.
The model wrote code. The harness kept the work moving.
We’ll shrink that idea to one React Native team: less repeated context, safer parallel work, and a path from request to proof that survives whichever model you use next.
Build the harnessThe eleven-day clue
The speed was outside the chat box.
Press Assemble. Watch one giant conversation turn into a production line.
Bun's reported setup:
64 coding agents at full scale
4 isolated workflow shards
2 adversarial reviewers per change
1 implementation-independent test suite
Bun’s team kept changing the workflow when agents failed. The useful unit wasn’t a clever answer; it was a repeatable path that caught bad answers.
Bun first wrote its porting decisions into files. Then implementers, reviewers, and fixers received different jobs and different context.
The Rust compiler and roughly one million test assertions became a work queue. When agents learned a bad habit, the team fixed the workflow generator instead of hand-correcting every future result.
The honest token number
Bun reports 5.9 billion uncached input tokens, 690 million output tokens, and 72 billion cached input reads. The achievement was not low total usage; it was converting a huge amount of model work into reviewed, tested progress.
For a React Native team, the smaller goal is more useful: stop paying to repeat decisions, rediscover commands, and repair preventable mistakes.
Keep thisDon’t chase zero tokens. Chase zero repeated explanation and zero unverified output.
What does that production line look like for one ordinary mobile feature?
Pack the task
Save decisions. Don’t save the whole conversation.
Our recurring job is small: stop PaymentConfirmationScreen from sending twice. Pack only what the next worker needs.
Choose the smallest packet that lets the agent inspect, change, and verify.
Think of context as a carry-on bag. AGENTS.md holds stable repo rules; FEATURE.md holds today’s destination; a skill is the folded route you open only for this kind of trip.
MCP is the socket for live systems: GitHub, a design file, an emulator, logs, or a test device. Connect the tool when it can answer today’s question, not because it exists.
At the end, write a compact handoff: decision, changed files, test result, open risk. A fresh worker can read that in seconds; it does not need the reasoning monologue that produced it.
One fact, one home
TaskToday’s goal, allowed surface, acceptance checks, and stop condition.
AGENTS.mdRepo commands, conventions, and proof required for every relevant change.
SkillA repeatable workflow with examples, references, and scripts loaded when needed.
Hook / CIA mechanical rule that must run, not another sentence the model may forget.
MCP / CLILive access to a device, issue, design, build, log, or external system.
Handoff fileThe compact state the next role needs: result, evidence, risk, next action.
Keep thisSerialize decisions, not conversations. Load methods and tools only when the task calls for them.
The packet is small. But who should receive it?
Separate the rooms
Don’t ask the author to forget why the code is “obviously right.”
Switch roles below. Each worker sees only the evidence needed for its job.
The implementer gets the original behavior and a failing witness. The reviewer gets the contract and the diff—but not the implementer’s long explanation defending it.
The device verifier gets a build and one exact journey. Separate context reduces confirmation bias and keeps each window small.
This is what “use subagents” should mean. More agents are useful only when their work is independent or their perspectives must stay independent.
Repeated failure:
An agent stubs a hard function
just to make TypeScript compile.
Make the reviewer reject placeholders, then add a hook or CI check where detection can be mechanical. Repeated failure should improve the harness, not enlarge every future prompt.
A hook is a guardrail at a lifecycle boundary. It can block a dangerous command, run a fast check after edits, or require proof before handoff.
Keep hooks quick and deterministic. Slow, flaky hooks teach people—and agents—to route around the safety system.
Keep thisOne role creates. Another doubts. Hooks enforce the rules neither role should negotiate.
Good roles prevent bias. We still need a queue that tells them what to do next.
Turn failure into the queue
A failing check is a tiny, honest task description.
Our risk crosses a button, pending state, a hook, and an API call. Pick the cheapest witness that can see all four.
Risk: two quick taps may call submitPayment twice.
The reducer is correct.
The bug appears when UI and async state meet.
The interaction test can press twice and count API calls. It is wide enough to witness this bug and cheap enough to rerun after every meaningful edit.
Tests do two jobs in an AI harness. They define the target before code, then turn every failure into a bounded next action.
TDD is useful when behavior is crisp or a bug needs a permanent witness. For a visual spike, explore on the phone first; once the behavior settles, lock it at the cheapest reliable layer.
Keep thisGive the agent a failure it can explain, not a feature request it can endlessly reinterpret.
The JavaScript proof is green. The original report came from Android.
Open the right socket
Use MCP when the answer lives outside the repository.
Focused interaction test: pass
Type-check: pass
Lint: pass
The bug was reported on Android.
Open the smallest live tool that can answer the unresolved question. Here, that is the Android app—not another repository scan.
- 1Open the exact screen
- 2Press Confirm twice
- 3Inspect network requests
- 4Save the evidence
$ waiting for device proof
Device verification has not run.
An agentic device tool helps during discovery because the next tap depends on what the app shows. Once the journey is known, save it as a deterministic regression.
That keeps future agents from spending tokens rediscovering the route. They run the script, read the failure, and work on the smallest unexplained step.
Choose one exploration tool and one memory
Agent-led inspection and actions, with replay scripts and export to Maestro flows.
Simulator control plus deeper component, log, network, and performance evidence.
Readable black-box journeys that are easy to keep in CI.
React Native-focused gray-box E2E with synchronization around app activity.
Do not install every tool. The harness is better when each tool has a clear question it owns.
Keep thisTools answer live questions. Scripts remember settled answers.
One feature is safe. When should we add more agents?
Scale the harness, not the chaos
Sixty-four agents is a migration strategy, not a daily habit.
Choose the smallest team shape that keeps work independent and review honest.
Focused task · hooks · one test · human or fresh-context review.
Implementer · adversarial reviewer · device verifier.
Independent slices · per-slice review · shared test queue · controlled merge.
Parallelize files, platforms, or failures that can be owned without stepping on the same code. If two agents need the same mutable truth, split the decision first—or keep the work sequential.
Every shard needs an owner, an allowed surface, a proof command, and a handoff format. Worktrees isolate edits; tests and merge checks reunite them.
The model can change between tasks. The contracts, role boundaries, tool interfaces, and evidence format remain useful.
Keep thisMore agents multiply a good queue. They also multiply an unclear one.
We can finally ask whether the harness is actually saving anything.
Measure the right economy
Spend fewer tokens on remembering. Spend enough on proving.
A tiny prompt followed by four corrections is not cheap.
- Time from request to device evidence
- Repeated context pasted by a human
- Corrections after the first “done”
- Failures caught before review or release
- Workflow lessons saved for the next task
Stable instructions may be cached by some harnesses and providers. Skills can keep large playbooks out of unrelated tasks, while compact handoffs let you start fresh when a role or goal changes.
Tool schemas, file reads, screenshots, and results still cost context, time, or money. Selective access is the saving; pretending tools are free is not.
Measure five similar tasks before and after the harness. If verified lead time falls and escaped bugs do not rise, the system is improving.
Keep thisThe cheapest workflow is not the one that generates least. It is the one that needs least rework.
Put the whole system on one screen and it becomes reusable.
The reusable harness
Build the road once. Let models drive on it.
When a mistake repeats, don’t write a longer apology. Improve the road.
Goal: prevent duplicate payment submits.
Success: two quick taps create one request.
Scope: this screen and its hook; keep the API unchanged.
Route: follow AGENTS.md and the fix-rn-bug skill.
First proof: add the smallest failing interaction test.
Then: make the minimal patch; run hooks and focused checks.
Review: give the diff and contract to a fresh reviewer.
Device: verify the same flow on Android.
Return: changed files, evidence, risk, next action.
Stop: no unrelated refactor.
Start with one recurring task, not a grand platform. Write its finish line, save its method as a skill, and turn its repeated mistakes into hooks or review rules.
Add a device tool when the phone owns the answer. Add subagents when work or judgment can be cleanly separated.
Then watch the real number: how quickly a request becomes trusted behavior. That is the speed worth compounding.
Source notes
The claims behind the harness.
Primary sources for the migration story, context surfaces, testing boundaries, and mobile tools.
- Bun’s Rust rewrite — planning artifacts, isolated workflows, adversarial review, compiler-driven queues, test scale, token usage, and the 11-day timeline.
- OpenAI Codex customization — the distinct jobs of durable guidance, skills, MCP, and hooks.
- OpenAI AGENTS.md guide and skills guide — small repository guidance and reusable workflows.
- React Native testing overview — component-test and E2E boundaries.
- Callstack agent-device and Software Mansion Argent — agent-led mobile inspection and runtime evidence.
- Maestro for React Native and Detox — durable device-level regression options.