The AI cost of JavaScript frameworks
B · Useful, limited Web performance engineer Nolan Lawson publishes an open, repeated benchmark with variance shown; careful and checkable, but one small app, one model and one agent limit how far it generalises.
Summary based on the full text·Original: about 14 minutes to read
In short
A blog post (28 October 2026) by Nolan Lawson testing claims that some JavaScript frameworks are "better for agents". He had Claude Opus 5.5 build the same small Pokémon browsing app five times in each of 12 frameworks, checked each build against a conformance suite, and measured cost, time, tokens, Lighthouse scores and code size. Lightweight server-rendered stacks were cheapest to build and produced less code and JavaScript; Angular, Gracile+Lit and SvelteKit cost the most.
Key numbers
- $2.67 vs $4.97median API-price cost per build, cheapest (Hono+htmx) versus most expensive (Angular), across 12 frameworks
- 3.85M to 9.76Mmedian tokens per build, Nuxt (lowest) to Angular (highest)
- 1,370 vs 2,009median lines of code, Hono+htmx versus Angular, for the same app
- 8.2 to 17.2 minmedian wall-clock build time, Astro to Angular
- 5builds per framework, median reported (3 for Angular on quality metrics after 2 spec failures)
As reported by the source.
English·Web page·opens nolanlawson.com
What it reports
- Median cost per build at API list prices: Hono+htmx $2.67, Astro $2.76, Nuxt $2.82, up to SvelteKit $4.28, Gracile+Lit $4.65, Angular $4.97. Ranges overlap: the cheapest React Router run ($2.82) beat the most expensive Hono+htmx run ($3.19).
- SvelteKit runs read the v3 migration guide every time, likely because the version postdates the model's training data; Gracile agents cloned the repo or read compiled source.
- Framework MCP servers and skills were used inconsistently: the Nuxt MCP never, Next.js skill files in 1 of 5 runs, React Router's skill in 5 of 5.
- Lighthouse performance, accessibility and layout-shift scores were near saturated for all. JavaScript shipped ranged from 0 KiB (Astro) to 142 KiB (Next.js); largest contentful paint broadly favoured multi-page apps.
- "Vanilla" JavaScript with Vite, no framework, cost more than several frameworks and was built as a single-page app all five times.
- Angular failed the spec in 2 of 5 runs by building a server-rendered app that rejected non-localhost requests.
How they got it
Opus 5.5 at high effort in Claude Code, sandboxed, given the spec, the conformance suite (based on the accessibility tree) and each framework's official MCP or skills; no architecture or performance instructions. Costs and tokens are as reported by Claude Code at list prices on a flat-rate plan. Lighthouse mobile tests with CPU and network throttling, median of five runs per app. The benchmark is on GitHub.
Limits
- One content-style app; a complex interactive app could favour single-page frameworks.
- One model and one agent; results are stochastic, with wide ranges per framework.
- Lighthouse is known to favour multi-page apps.
- Costs are list-price equivalents, not money spent.
Why it matters for companies
Framework choice now carries a running AI cost: more code means more tokens on every future agent edit, so a stack that needs fewer lines is cheaper to maintain with agents. The spread here is close to 2x on the build alone. The method is the reusable part: teams choosing a stack for agent-built software can run a small conformance-tested benchmark on their own app type instead of relying on vendor claims, and should check whether official MCP servers and skills are used at all.
Summary based on the full text. Read the original for the full argument and data.Read the original on nolanlawson.com