Write most of a TypeScript frontend with Claude Code and track first-try passes

Diego Prieri let Claude Code write most of a 120k-line TypeScript frontend for 8 weeks: 86% of edits passed typecheck on the first run and caching cut input cost by 87%.

Done withClaude Code· Nov 3, 2026

What they did

Diego Prieri leads the frontend of a TypeScript app of about 120,000 lines where coding agents produce most of the code. Over eight weeks he worked with Claude Code day to day, and nothing the agent wrote was committed until a gate re-ran the typecheck and the tests with full output. To see how well this was going, he wrote a small open source CLI that replays the session logs Claude Code keeps on disk. It totals token use by type and, for every file edit, checks whether the next typecheck or test command the agent ran passed.

How it went

Across about 30,400 responses and 7.5 billion input tokens, 98.4% of input came from the prompt cache, which he puts at 87% below the uncached price. Of 205 typecheck runs after an edit, 86.3% passed first time; of 298 test runs, 75.2% did. Counting only runs where the agent did not pipe output through head, grep or tail, tests passed just 52.4% of the time (21 runs), so he treats 75% as a ceiling.

Worth knowing

The agent often trims long command output, which can hide the failing line, so a gate that re-runs checks unfiltered is what catches the misses. On a subscription plan the 87% is notional API cost, not money saved. These are observations from uncontrolled tasks, not an eval, and old transcripts get cleaned up, so the window is whatever is still on disk.

Try it

With Claude Code· 4 parts to fill in

You are working in [my repo], a [language] codebase. For each task I give you, make the change, then run [typecheck command] and [test command] with full output, never piped through head, grep or tail. If either fails, fix it and run both again. Do not commit until both pass on an unfiltered run. At the end of each task, tell me whether the first typecheck and first test run after your edit passed or failed. Stop and ask me if the same check fails three times in a row.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related