- Vercel says its AI agent removed or deferred nearly two megabytes of compressed JavaScript, summed across pages in v0 and vercel.com, using a new Next.js 16.4 skill.
- The cause was accidental imports, not bad intent. Software that maps every import link can find what people miss. The figures are Vercel's own, from its own apps.
- Before adopting it, ask who reviews agent-written pull requests and whether you keep a bundle size baseline.
Small imports, large pages
A web page can get slower without anyone deciding to slow it down. Someone adds one import to a shared file. Months later, every page quietly downloads code that few visitors will ever use.
Vercel, the company behind Next.js, says it has now handed that kind of detective work to an AI agent. Its October 28, 2026 post says the agents trimmed close to two megabytes of compressed JavaScript that pages did not need. That total is summed across pages in v0 and vercel.com, and the code was either removed or deferred. On many key pages, Vercel says, the saving ran to hundreds of kilobytes.
These are Vercel's own numbers, measured on its own products. The post gives no figures for load time or user impact. Still, the mechanism behind them is worth understanding.
How one stray import defeats a fix
Developers can defer heavy code so it loads only when a user needs it. Next.js describes a loader component that imports a heavy component on demand. If that loader is the only module importing the heavy component, its code is deferred.
The catch is that any other module in the same bundle can import the same component directly. In that case, Vercel explains, the code still loads upfront. The deferral exists on paper and does nothing in practice.
This is a graph problem, not a typing problem. A large app has thousands of modules linked by imports. Spotting the one link that drags a heavy library onto every page is tedious for a person and routine for software.
What the agent actually does
The analyzer relies on Turbopack's detailed module graph, so it needs Turbopack. That bundler has been the default since Next.js 16. Teams upgrade to Next.js 16.4, add the next-bundle-optimizer skill and call it from their agent.
The skill has the agent export saved analysis snapshots as JSON and rebuild Turbopack's module and chunk graphs. The agent then finds large groups of connected modules and traces their import chains. It uses a technique called minimum cut to find a small set of import links that, if changed, would let those modules be deferred.
Before proposing anything, the agent checks the changes against the source code and against how the components are used interactively. By default it only reports issues and suggested fixes. A separate fix command applies the changes, reruns the analysis and compares snapshots to measure the effect.
What it found at Vercel
The examples are ordinary, which is the point. Code for an experimental editor was fetched on almost every v0 page, even for users who were not in the experiment. Removing that load saved 150 KB on most pages.
A central registry of dialog boxes loaded some heavy dialogs eagerly. Fixing it saved between 40 KB and 650 KB, depending on the page. A shared utility that parsed URLs also pulled in an entire observability query engine. That cost 125 KB on the deployments page.
Vercel Agent's markdown, syntax-highlighting and charting code reached browsers even when the agent panel stayed shut. Vercel says that cost 255 KB on the dashboard page. A natural-language date library loaded before users touched the assistant, costing 55 KB on average.
None of these look like mistakes in isolation. Each was a reasonable shortcut that grew into a cost on every page view.
The idea: agents are good at maintenance nobody owns
Performance rarely has an owner. Each team ships its feature, and the sum of their imports becomes everyone's problem. That is the kind of work that waits for a quiet quarter that never comes.
This shows where agents fit best. They do not need a better idea than your engineers. They need patience to read a whole graph and the discipline to check every link.
Vercel's process also shows the limit. For each change the agent raised a pull request, engineers checked the result on a preview deployment, and only then did it go live. People stayed in the loop.
What leaders should ask
Next.js is widely deployed. WebPulse's September 2026 scan of the Tranco top 10,000 domains found a platform on 2,491 sites. It detected Next.js on 791 of them, or 31.8% of detected sites. That scan does not show which sites run version 16.4 or use Turbopack, so the tool will not apply to all of them.
For teams that do, start with four questions. Do we keep bundle snapshots, so we can see when size grows? Who reviews a pull request that an agent wrote? Are we on Turbopack and Next.js 16.4? Which pages carry the most script today?
The practical step is small. Run the report-only mode first, read what it finds, and let a person approve each fix. Vercel's results suggest that waste of this kind builds up unnoticed, and the cost of finding it may now be low.
Produced by the WebPulse Newsroom with AI assistance from the original reporting credited below, and checked against that source by our editorial review. How we use AI.
Original reporting: Next.js (Vercel).





