What an AI Agent Pays to Build With JavaScript Frameworks
Picking a web framework used to be partly a choice about what developers liked writing. Coding agents change that calculation. When an agent writes most of the first draft, the relevant costs include how much context it needs, how long it takes to finish, what it ships to the browser, and how much code a human must maintain afterward. Those costs can be measured, even if no single benchmark can settle the choice for every application.
Nolan Lawson’s experiment gives that question a concrete test. He asked the same coding agent to build a small Pokémon information site in twelve JavaScript stacks. The result is especially useful because it keeps the app specification and acceptance checks fixed while letting each agent decide how to implement the site. It also reveals where a framework comparison can become a comparison of agent decisions rather than framework capabilities.
One application, twelve toolkits
The target was a site backed by PokéAPI, with Pokémon listings, types, moves, game data, search, and filters. This is a content-heavy application with modest interaction. It is a reasonable test of navigation and initial page load, but it does not stand in for an editor, dashboard, or game where long-lived client state dominates.
Each run used Claude Opus 5.5 at high effort, in a sandbox, with a request to use the current version of its assigned framework. The agent had a specification and a conformance suite. The suite inspected the accessibility tree, so it could test behavior without dictating a DOM structure. Agents could choose server or client rendering. Lawson supplied official framework MCP servers or skills where available, but their use was not forced. CSS was constrained by shared design tokens and a ban on component frameworks, avoiding an unrelated styling contest.
The twelve choices were Angular, Astro, Gracile with Lit, Hono with htmx, Next.js, Nuxt, Qwik, React Router, SolidStart, SvelteKit, TanStack Start, and plain JavaScript or TypeScript with Vite. Each was built five times. For most measures Lawson reports the median of those runs, which gives a better center than picking the best screenshot or the worst failure. Angular produced two apps that could not be measured behind the specified reverse proxy, so its browser and code-size medians use three runs; the build-cost numbers still use five.
The agent bill is measurable, but noisy
The least expensive median builds were Hono with htmx at $2.67, Astro at $2.76, and Nuxt at $2.82. Next.js came in at $3.14. SvelteKit cost $4.28, Gracile with Lit $4.65, and Angular $4.97. These are API-equivalent prices reported by Claude Code, not Lawson’s actual subscription bill. The ordering should not be read as a universal price list: even individual runs within a framework varied enough for their ranges to overlap.
Elapsed time roughly followed cost. Astro’s median was 8.2 minutes, Hono with htmx 8.6, Nuxt 9.0, and Angular 17.2. Reported total tokens ranged from a Nuxt median of 3.85 million to Angular’s 9.76 million. Those totals include cache reads as well as input and output, so they are a workload measure rather than a direct count of newly generated text.
The runs also show why an installed agent tool is not the same as a used tool. Nuxt’s MCP server was never called. Astro’s was called in two of five runs. SvelteKit’s plugin was used in all five; React Router’s skill files were read in all five. Some SvelteKit agents repeatedly read a migration guide, and some Gracile agents investigated framework source. Extra documentation work may be appropriate for a new or unfamiliar framework, but it also raises the bill. A benchmark of agent cost therefore captures the framework plus its documentation, agent instructions, and the model’s current familiarity.
Plain Vite was not the cheapest option. Its agent had freedom to build without a UI framework, yet chose a single-page app all five times and spent a median $2.98. A small framework can give an agent a useful route and rendering pattern, reducing decisions it must invent. That is a plausible explanation for the result, not proof that vanilla code is intrinsically more expensive.
Nearly perfect scores hide different pages
The Lighthouse headline scores were close to saturated. Accessibility was 100 for every measured stack; performance ranged from 97 to 100, with most at 100. Those numbers say the tested home pages met the automated checks. They do not imply identical loading behavior or full accessibility for every user and route.
The amount of JavaScript transferred separated the implementations much more clearly. Astro’s median home page sent 0 KiB, plain Vite 7 KiB, Hono with htmx 18 KiB, SvelteKit 36 KiB, Nuxt 84 KiB, and Next.js 142 KiB. This is the output of the particular agent-written applications, not a fixed tax charged by each framework. Some agents made notably different architecture decisions: two Gracile runs did not use Lit at all.
Under Lighthouse’s simulated mobile conditions, median total blocking time was 0 ms for Astro, Gracile with Lit, Hono with htmx, SvelteKit, and Vite. It was 40 ms for Nuxt, 71 ms for Next.js, and 103 ms for Angular. Chrome’s definition counts the portions of main-thread tasks beyond 50 ms during loading. All these medians are relatively small; the spread matters more as a signal about work done at startup than as a dramatic usability verdict.
Largest Contentful Paint made the rendering choices visible too. Astro’s median was 810 ms, Hono with htmx 978 ms, Qwik 979 ms, Nuxt 1,727 ms, and Next.js 2,090 ms. These are lab measurements with mobile throttling on one Ubuntu laptop, not field measurements of real visitors. Lawson also observed large swings when the browser selected a different largest element or when image loading differed. The LCP specification and guidance explain why the candidate element can change during a load. Treat a single LCP value as a clue to investigate, not a permanent property of a framework.
Source size is another cost, with limits
Lawson used nonblank source lines as a simple maintenance proxy. Hono with htmx had the smallest median at 1,370 lines. Nuxt had 1,415, Astro 1,461, Next.js 1,539, SvelteKit 1,611, and Angular 2,009. Fewer lines can mean less code for an agent to read on later edits, but line count does not measure clarity, modularity, tests, or the effort needed to change a feature. It should be paired with an actual maintenance task before making a long-term claim.
This experiment’s strongest result is methodological: compare complete, checked applications rather than framework slogans. A useful internal benchmark would begin with a representative feature, run the same model and prompt several times per stack, enforce behavior checks, record agent time and token usage, and test browser output under the same conditions. Then inspect what the agent actually built. A fast result that skipped a requirement is not a win; a slower result that ships a much simpler page may be.
There is no overall champion here. Content-oriented sites gave server-rendered and multi-page approaches a natural advantage in initial-load metrics. A more interactive application could change the ranking, as could another model, different agent guidance, or a later framework release. The reproducible benchmark repository is the right starting point for adapting the test to a team’s own product. Framework selection can now include agent cost alongside developer experience and user experience, with each measured on the workload that matters.