The hidden AI cost of your JavaScript framework

Coding agents write code for you, but the framework you choose dictates how much time and money those agents burn.

Tools · Source: Hacker News

What happened

Developers pick JavaScript frameworks based on vibes. They claim certain tools are blazing fast or better for AI agents without showing any proof. Nolan Lawson got tired of this evidence free culture and built a benchmark. He forced Claude Opus 5.5 to build the exact same Pokémon application across different frameworks. The app was simple but non trivial. It required searching, filtering, and pulling data from an external API.

The experiment ran five times per framework to account for the random nature of large language models. Lawson tracked the dollar cost, token count, and wall clock time for each run. He used Claude Code with high effort settings. Agents were given official Model Context Protocol servers or skills when available to keep the test fair. He also measured the final output using Lighthouse to check performance and accessibility scores.

The results show massive gaps between tools. Hono paired with htmx built the app for a median cost of just two dollars and sixty seven cents. Angular was the most expensive at nearly five dollars and failed to create a measurable app twice. Heavy frameworks burned more tokens and took longer to generate working code. Astro was the fastest at eight minutes. Angular dragged on for over seventeen minutes.

Key facts

Why it matters

Your tech stack now has a direct token tax. If you build with heavy single page application frameworks, your AI agents will consume more of your context window. This costs you real money. Simple multi page applications or vanilla setups let agents move faster and cheaper. You pay for complexity twice in the agentic era. First, you pay in raw compute costs. Second, you pay in slower development loops while you wait for the agent to finish generating boilerplate.

The second order effect is a massive shift in framework dominance. Tools optimized for human developer experience do not automatically translate to good agent experience. Agents struggled to write SvelteKit without reading the migration guides every time because the framework was too new for the training data. If a framework requires agents to constantly read source code or documentation, founders will stop using it. We will see a rise in frameworks explicitly designed to minimize token usage and agent confusion.

For builders

Dump heavy frameworks for agent tasks

Agents write Hono and htmx faster and cheaper than Next.js or Angular. Founders who stick to bloated stacks will pay higher API bills for every feature they ship. You lose money and time waiting for agents to navigate complex abstractions that were meant for humans.

Vanilla JavaScript is viable again

Agents building with plain JavaScript and Vite outperformed several modern frameworks in cost and speed. You do not need a massive user interface framework if the agent can just write raw code efficiently. Builders who strip away dependencies will ship faster and keep their token costs low.

Provide standard context to agents

Agents wasted tokens reading source code when they did not know a framework well. If you use a niche tool, you must provide clear documentation or a Model Context Protocol server. Companies that build good context tools for their frameworks will win the agent adoption war.

My take

Developers spent ten years arguing about developer experience and virtual DOMs. None of that matters now. Agents do not care about your favorite syntax. They care about token efficiency, clear patterns, and small output sizes. If your framework confuses a large language model, it is a business liability. Stop picking tools based on vibes and start measuring your token burn.

Original reporting: Hacker News. This is my rewrite and opinion.

More AI news for builders