Skip to content

Claude Code writes code for an old version of your framework

By the Toolbay team · Checked against the sources below on

The model learned your framework at some point in the past, so without help it writes the API it remembers. Tell it the exact versions in CLAUDE.md, give it documentation that matches the installed version, and let the typecheck and build reject calls that no longer exist.

Fixes

  1. State versions in CLAUDE.md or AGENTS.md: "Next.js 16.4, React 19. Do not use APIs removed in earlier majors."
  2. Use docs that ship with the package where they exist. Next.js 16.2 and later include documentation matching the installed version in node_modules/next/dist/docs/. From 16.3, create-next-app writes an AGENTS.md telling agents to read it, and next dev keeps it up to date when it detects a coding agent. For 16.1 and earlier, npx @next/codemod@canary agents-md downloads a copy.
  3. Fetch current docs on demand with an MCP server. Context7 pulls version-specific documentation into the agent; add "use context7" to the prompt.
  4. Point at the framework's llms.txt when it has one. Next.js serves https://nextjs.org/docs/llms.txt and a Markdown version of every docs page.
  5. Run the typecheck and build after each change, in CLAUDE.md or as a hook, so an old signature fails at once.

How to spot it

  • The typecheck names an export or option that does not exist in your installed version.
  • The build or dev server prints deprecation warnings for code the agent just wrote.
  • The agent cites a file convention or config key from an older major version.

For Next.js 16 and later, the dev server also exposes an MCP endpoint; with the next-devtools-mcp package connected, the agent can read the running app's errors, routes and logs instead of guessing.

Vercel reports the effect in its own evaluations: the Next.js docs say bundled documentation reached a 100% pass rate, compared with up to 79% for skill-based approaches. That is their result on their tasks, linked below.

When a skill or vault helps, and when it does not

Helps

  • A vault of version-specific notes for your framework can help on hard tasks, where the model's memory is most likely wrong.
  • A skill that says "read the bundled docs before editing" turns the habit into a step.

Does not help

  • Extra knowledge can also make some tasks worse. Measure on your own tasks before you rely on it.
  • If the framework ships its own versioned docs, use those first; they are free and maintained.

A knowledge vault for Next.js 16.3/16.4 raised hard-task passes from 16 of 42 to 35 of 42 runs but made two tasks worse, so it is not on sale yet.