> ## Documentation Index
> Fetch the complete guide index at: https://www.synscribe.com/agentic-discovery/llms.txt
> Use this file to discover all pages before exploring further.

---
title: "Next.js Case Study: Running Every Agentic Play at Once"
description: Next.js holds 10.97% of all AI-agent doc retrieval — #1 by far. Versioned llms.txt, content negotiation, default CLAUDE.md, public evals. The teardown.
slug: /agentic-discovery/case-studies/nextjs
series: The Agentic Discovery Playbook — Case Study
last_verified: 2026-06-11
---

# Next.js: What Running Every Play at Once Looks Like

> **The lesson:** Next.js doesn't just publish agent docs — it colonizes the agent's working environment: docs inside the npm package, AGENTS.md and CLAUDE.md written by default at scaffold time, markdown served to any non-browser fetcher, and a public benchmark. The mechanics are copyable by anyone; the #1 position also rests on a training-data prior that isn't.

## At a glance

| | |
|---|---|
| Category | React framework (Vercel) |
| Agent retrieval share | **10.97%** of all Context7 library traffic — **#1**, more than double #2 (2026-06-11) |
| Context7 entry | 587,985 tokens · 2,550 snippets · trust 10 · benchmark 84.9 · updated 1 d (2026-06-11) |
| 30-day momentum | +16% (within-top-50 share) |
| Ecosystem context | Vercel cluster (next.js + websites/vercel + vercel/ai + ai-sdk_dev) ≈ **18.5%** of all agent doc retrieval |

## What they built

Next.js is the maximalist of our audit: the only product we found running a serious version of every play at once, across all four surfaces — retrieval, instruction, environment, product.

| Surface | What we observed (2026-06-11) | Play |
|---|---|---|
| Versioned llms.txt | `@doc-version: 16.2.6` stamps; per-version files; llms-full.txt alongside | [Play 5](/agentic-discovery/llms-txt) |
| `.md` mirrors | YAML frontmatter on every mirror: `url`, `docs_index`, `version`, `lastUpdated`, `prerequisites` | [Play 6](/agentic-discovery/markdown-docs-for-ai-agents) |
| Content negotiation | Served markdown to our non-browser fetcher **on canonical URLs without `.md`** — the agent never hits HTML | [Play 6](/agentic-discovery/markdown-docs-for-ai-agents), [Play 1](/agentic-discovery/ai-agent-web-search-and-fetch) |
| Docs in the package | Documentation ships *inside* npm: `node_modules/next/dist/docs/` — present offline, no fetch required | [Play 6](/agentic-discovery/markdown-docs-for-ai-agents) |
| Scaffolder injection | `create-next-app` writes **AGENTS.md + CLAUDE.md by default**; retrofit codemod `npx @next/codemod agents-md` for existing repos | [Play 9](/agentic-discovery/scaffolder-rules-claude-md) |
| Public agent benchmark | nextjs.org/evals | [Play 11](/agentic-discovery/ai-evals-and-leaderboards) |
| Framework MCP | Exposes running-app state to agents | [Play 3](/agentic-discovery/mcp-server-distribution) |

The instruction layer rides inside the environment layer. The generated rules file counter-programs the model's own memory:

> "Your training data is outdated — the docs are the source of truth."
> — AGENTS.md / CLAUDE.md generated by default by `create-next-app` (per nextjs.org/docs/app/guides/ai-agents, observed 2026-06-11)

That sentence, written into every new project by default, is the whole strategy in miniature: the #1 product in agent training data telling agents not to trust their training data — and pointing them at surfaces Next.js controls instead.

The content negotiation is the gold standard of the retrieval layer. Most products that serve markdown require the agent to know the `.md` convention. Next.js detects the non-browser fetcher and serves markdown at the *canonical* URL — no convention-guessing, no empty bodies, full content to a plain HTTP GET.

The npm-package move closes the loop from the other side: the docs are present in `node_modules` before the agent's first network call. An agent working in a Next.js project has current reference material on disk, version-matched to the installed framework — retrieval with zero retrieval latency and zero fetch failures.

## The receipts

All figures observed 2026-06-11; single-day Context7 snapshot, ±10% error bars (we watched one product's snippet count read 130 and 207 on the same day).

**The ranking.** /vercel/next.js: 10.97% of all Context7 library traffic — #1, vs 4.59% for #2 (Better Auth) and 2.57% for React's docs. 30-day momentum: +16%.

**The cluster.** Vercel-ecosystem entries in the same top 50:

| Entry | Share |
|---|---|
| /vercel/next.js | 10.97% |
| /websites/vercel | 3.35% |
| /vercel/ai | 3.12% |
| /websites/ai-sdk_dev | 1.05% |
| **Cluster total** | **~18.5%** |

Roughly one in five agent doc fetches lands on a Vercel-ecosystem surface. No other org in the data comes close.

**The index entry.** 587,985 tokens, 2,550 snippets, trust 10, benchmark 84.9, updated 1 day — high quality score on a *moderate* corpus. Consistent with our audit-wide finding that corpus mass buys little (log-tokens vs benchmark ρ≈0.30, n=17, correlational): Next.js wins on density and freshness, not volume.

**The fetch test.** In our markdown probes, Next.js served complete markdown to a non-browser HTTP client on canonical URLs without the `.md` suffix — the only product in the audit doing user-agent content negotiation. It is the exemplar for the "Fetchable" property in our agent-grade docs definition (report §7).

**The environment default.** `create-next-app` writing AGENTS.md + CLAUDE.md *by default* — not behind a flag — is the precedent that normalized scaffolder injection as a category norm. Our pilot E1 (single model, n=3 per arm, 2026-06-11) measured the generic rules-file mechanism at a 100% selection flip (3/3 vs 0/3); Next.js installs that mechanism in every new project, plus a codemod for old ones.

**The public benchmark.** nextjs.org/evals publishes how well models and agents perform on Next.js tasks — one of only two public agent-eval boards we found among audited products (Convex's llm-leaderboard is the other).

## What to copy

- [ ] Stamp versions into your llms.txt (`@doc-version`) and ship per-version files plus llms-full.txt ([Play 5](/agentic-discovery/llms-txt)).
- [ ] Put machine-readable frontmatter (`url`, `version`, `lastUpdated`, `prerequisites`) on every `.md` mirror ([Play 6](/agentic-discovery/markdown-docs-for-ai-agents)).
- [ ] Implement content negotiation: detect non-browser fetchers and serve markdown at canonical URLs — the gold standard for agent fetch ([Play 1](/agentic-discovery/ai-agent-web-search-and-fetch), [Play 6](/agentic-discovery/markdown-docs-for-ai-agents)).
- [ ] Ship docs inside your package so agents have current reference material with zero network calls ([Play 6](/agentic-discovery/markdown-docs-for-ai-agents)).
- [ ] Write AGENTS.md + CLAUDE.md at scaffold time, with a retrofit codemod for existing repos — disclosed, following the ethics rules ([Play 9](/agentic-discovery/scaffolder-rules-claude-md)).
- [ ] Publish an agent benchmark for your product once the internal eval harness exists ([Play 11](/agentic-discovery/ai-evals-and-leaderboards)).

## What NOT to over-copy

- **Maximum training-data prior.** Next.js is saturated in every model's memory; its #1 retrieval share sits *on top of* a default position most products start without. The mechanics above are copyable; the prior is not.
- **The ecosystem cluster.** ~18.5% of all retrieval flows to Vercel-ecosystem surfaces, and the AI SDK, hosting platform, and framework cross-promote one another's agent surfaces. A standalone product replicates the plays, not the gravity.
- **Resourcing.** Content negotiation, an in-package docs pipeline, a maintained codemod, a framework MCP, and a public eval board is platform-team-scale work. The sequencing for everyone else: index and mirrors first, scaffolder and evals later (see [the playbook overview](/agentic-discovery/agentic-discovery-playbook)).
- **Point-in-time, one index.** All numbers are a 2026-06-11 Context7 snapshot, ±10% error bars; retrieval share is a flow metric that moves in weeks (another top-10 entry fell −50% in the same 30 days).
- **"By default" carries obligations.** Default injection has been accepted from Next.js without visible backlash, but the precedent that drew sustained anger — an undisclosed, no-opt-out insertion — is one design decision away ([Play 9's ethics box](/agentic-discovery/scaffolder-rules-claude-md)).

## FAQ

**Why is Next.js the #1 documentation source for AI agents?**
Both halves matter: it carries the largest training-data prior in its category *and* runs the most complete agent surface we audited — versioned llms.txt, content negotiation to markdown, docs inside the npm package, default AGENTS.md/CLAUDE.md at scaffold time, a framework MCP, and a public benchmark. As of 2026-06-11 it held 10.97% of all Context7 retrieval, more than double #2.

**Does create-next-app really write CLAUDE.md by default?**
Yes — as of 2026-06-11, `create-next-app` writes AGENTS.md and CLAUDE.md by default, containing "Your training data is outdated — the docs are the source of truth" (nextjs.org/docs/app/guides/ai-agents). Existing projects can be retrofitted with `npx @next/codemod agents-md`.

**What is content negotiation for AI agents?**
Serving different representations of the same URL by client: browsers get HTML, non-browser fetchers get markdown — at the canonical URL, no `.md` suffix needed. Next.js was the only audited product doing this, and it's the gold standard because agents get full content without knowing any convention.

---

*Snapshot date 2026-06-11; single-day metrics carry ±10% error bars. Part of [Case Studies](/agentic-discovery/case-studies) · [The Complete Playbook to Agentic Discovery](/agentic-discovery).*

← Previous: [Bun's CLAUDE.md Growth Hack](/agentic-discovery/case-studies/bun) · Next: [Inside Convex's Eval-Driven Agent Strategy](/agentic-discovery/case-studies/convex) →

> **Stay ahead of the agents.** We re-test this playbook quarterly and publish what changed — new data, busted myths, ranking shifts. [Get the update digest →](/agentic-discovery#updates)
>
> **Want this done for you?** Synscribe runs agentic-discovery programs for B2B SaaS and developer platforms. [Talk to us →](/contact)
