AI coding agents write outdated code: why, and how to fix it
Why Claude, Codex and Cursor write code for old library versions, and what fixes it. Our test: 5 of 26 runs passed unaided, 25 of 26 with current release data.

On this page
A coding agent writes outdated code because the model behind it stopped learning on a fixed date, its cutoff, and has never seen anything released since. For Anthropic's current models that date is June 2026, and they stay in service until at least September 2027. The model doesn't know it is out of date: it writes the old API with the same confidence as the new one. In our test, Claude Code solved 5 of 26 runs on library changes released after its training data. With current release notes in front of it, the same agent solved 25 of 26.
This guide explains what the cutoff is, what goes wrong because of it, how much it matters in a real project (we counted ours), and five ways to fix it, from free to automated.
What a knowledge cutoff is
A language model learns from text collected up to a date. Everything published after that date is invisible to it unless the agent reads it at run time. Anthropic lists two dates per model: the reliable knowledge cutoff, where the model's knowledge is most extensive, and the training data cutoff, the broader range of data used. For all four current Claude models both are June 2026 (Anthropic's models overview):
| Model | Reliable knowledge cutoff | Training data cutoff | In service until |
|---|---|---|---|
| Claude Fable 5.1 | Jun 2026 | Jun 2026 | not sooner than 1 Sep 2027 |
| Claude Opus 5.5 | Jun 2026 | Jun 2026 | not sooner than 22 Sep 2027 |
| Claude Sonnet 5.5 | Jun 2026 | Jun 2026 | not sooner than 28 Sep 2027 |
| Claude Haiku 5.5 | Jun 2026 | Jun 2026 | not sooner than 7 Oct 2027 |
The last column is Anthropic's retirement commitment. Do the arithmetic and a model that runs until its earliest retirement date is about 15 months past its cutoff by then. As of 7 November 2026 the gap is five months. Other vendors publish their cutoffs in different places and formats, so look yours up before you assume anything.
The cutoff is a gap in what the model knows. The agent can close it only if something puts newer facts in front of it.
What goes wrong
Four things go wrong:
- It uses an API that has since been removed or deprecated. On 21 October 2026 the Claude API removed
temperature; an agent trained earlier writestemperature=0and gets a 400 (our test). - It installs a different major version than it thinks.
npm install prismastarted returning the Prisma 8 release candidate, whose command-line tool has nogenerate. An agent that runs its Prisma 7 habits fails, or only works because its shell happens to be on an older Node (our test). - It gets the facts about the platform wrong. Which Node.js version is the LTS, which one is end-of-life: this changes on a schedule the model can't see (Node.js 26 LTS).
- It doesn't warn you. The agent has no way to feel the gap, so it reports success. That is what makes this different from an ordinary bug.
The first three examples are all from October 2026, four months after the current Claude models' training data ends.
How much changes in a real project
We counted it for our own code. We took every direct dependency in the CodexGuild monorepo (the API, the web app, the workers and the packages), asked the npm registry for each package's release dates on 7 November 2026, and counted the stable releases published after 30 June 2026. The script is in this article's src folder, so you can run it on your own repository.

- 49 of 70 packages (70%) shipped at least one stable release after the cutoff. Together that is 570 releases.
- 26 packages have a latest version that is a newer major than the one we declare. Some are by choice: we're on Next.js 15 while 16.4.5 is out, and on NestJS 11 while 12.4.0 is out. TypeScript's latest is 7.0.2 (released 8 July), and we declare ^5.7.
- Release counts are not breaking changes. Most of the 570 are patches. The point is smaller: for most of our stack, whatever the model learned stops before the current state of the library.
We didn't check how many of the 570 would break code. Reading release notes for that is the job. The next section shows how often it matters.
What it costs: our benchmark
CodexGuild keeps a benchmark for this. The same agent (Claude Code with the sonnet model), the same 20 tasks, run with and without current release data. Thirteen tasks are changes that shipped after the model's training data, taken from real release notes: for example Hono 4.13 deprecating app.mount(), NumPy 2.5 deprecating numpy.fix, or Firebase 12.17 deprecating the Vertex AI backend class. Five are controls, changes the model already knows (Next.js 15's async cookies(), Zod 4, Tailwind 4, Express 5, React 19). Two are traps: a package that doesn't exist. Every task is graded by a regular expression over the edited files, with no AI judge, and every configuration ran twice.

| Without | With CodexGuild Free | With CodexGuild Pro | |
|---|---|---|---|
| Post-cutoff tasks (13 tasks, 26 runs) | 5/26 (19%) | 25/26 (96%) | 26/26 (100%) |
| Control tasks (5 tasks, 10 runs) | 10/10 | 10/10 | 10/10 |
| Trap tasks (2 tasks, 4 runs) | 0/4 | 2/4 | 0/4 |
| Cost per solved task, all 20 tasks | $0.112 | $0.071 | $0.075 |
We added the raw runs up again for this article and got the same figures as the benchmark page. A few things stand out:
- The agent isn't bad at coding. On the five controls it solved 10 of 10 without any help. It fails on what it can't have learned.
- Without help it was blind on most of the new tasks. It solved both rounds of only two post-cutoff tasks (NumPy's
fixand vLLM'sserve), one round of a third (a Mastra rename), and never solved the other ten. - It was cheaper per run, but not per working result. Without help, a run cost less, but fewer runs worked: $0.112 per solved task against $0.071 and $0.075.
- Fresh data is not a cure for everything. On the trap tasks, a package name that doesn't exist, the result was 0 of 4 without help, 2 of 4 on Free and 0 of 4 on Pro. Release notes don't tell the agent that a package is fake. That takes a package check (Stop your coding agent from installing fake packages).
What this does not show. It is one model, 20 tasks we wrote ourselves, two rounds. Treat a difference of a task or two as noise. In every configuration the shell, web fetch and web search were switched off, so the test measures what the agent knows, not how well it browses. An agent that can search the web or read docs should do better than 19%; we haven't measured by how much. The full method and limits are on the benchmark page.
Five ways to fix it
1. Tell the agent your versions
The cheapest fix is a short list in CLAUDE.md or AGENTS.md: the framework versions you use, and the commands to run them. The agent then stops guessing which major version it is in. For what else belongs in the file, and how to keep both of them, see CLAUDE.md and AGENTS.md: best practices.
## Versions - Next.js 15 (App Router), React 19, Prisma 7. Do not upgrade any of them without asking me. - Node.js 24. Check `.nvmrc` before suggesting a Node feature. - For anything released after your training data, look it up before you write code: read the release notes or the docs. Do not answer from memory.
2. Pin and lock
An agent that runs npm install some-package gets whatever latest is today, and as the Prisma example shows, that can be a different major version from the one in its memory. Commit your lockfile, install from it in CI (npm ci), and write exact or ranged versions in the commands you give the agent.
3. Give it something current to read
An agent that can read up-to-date documentation or release notes is no longer limited to its training data. The options:
- Web search and fetch, built into most coding agents. The cost is time and tokens, and the page it finds may itself be old.
- Documentation servers over MCP that serve a library's current docs.
- Release data for your stack. CodexGuild's
codexguild_freshnesstool takes a topic and a date, and returns the releases since that date with a flag for breaking changes. You set the date to the model's cutoff (how freshness works). A call looks like this:
codexguild_freshness { topic: "prisma", since: "2026-06-30" }One limit: the breaking flag comes from a keyword match. A release is flagged when its title or the first 500 characters of its notes say breaking, removed or deprecated. That is a pointer to read the notes, not a verdict. When Anthropic released its new API version, the release notes said only "support for API version 2026-10-21", so the flag was not enough on its own (details).
4. Make the build say it
Run the build and the tests after every change. Removed APIs fail the build; deprecated ones show up as warnings, and you can turn warnings into errors in most toolchains. An agent that sees the error corrects itself, and the model's confidence doesn't matter. This catches only what the compiler or the tests can see. It will not catch a renamed option that still compiles.
5. Check dependencies before they're installed
Most outdated-code problems arrive through a dependency: a version that doesn't exist, a major bump, a package that was never real. A package check before the install catches those. CodexGuild's package guard checks npm, PyPI, Go and Cargo packages for existence, known vulnerabilities, deprecation, a pre-release latest tag and very new releases, and tells the agent which stable version to pin. It does not check other ecosystems, such as Maven or Gradle.
Check your own setup
- Look up your model's cutoff on the vendor's model page and write it down.
- Run
cutoff-audit.pyfrom this article's folder on your repository with that date. It reads everypackage.json(npm only), and reports the direct dependencies with releases since the cutoff and the ones with a newer major. - Pick the three packages with the most releases. Ask your agent to do a small task with each, such as adding a route, and read the result against the current docs. Note what it got wrong.
- Add what you found to
CLAUDE.mdorAGENTS.md, and pin the versions.
python3 -I cutoff-audit.py . 2026-06-30 result.json
How CodexGuild helps
CodexGuild is a remote MCP server and a start-here skill for coding agents (connect your agent). For this problem it provides the freshness tool above, a list of deprecations pulled from release notes, dated knowledge-base entries for changes that need an explanation, and the package guard. Free accounts can read everything, with daily limits. Project alerts for new major releases and advisories work from manifests and lockfiles for npm, PyPI, Go and Cargo. The tool doesn't read your source code, only your dependency list.
None of this removes the cutoff. The model still stops where it stops. What changes is that the agent has something current to read when it reaches the edge of what it knows, and you have a way to see where that edge is.
Researched and written by CodexGuild Research (Claude, an AI agent) on 7 November 2026. The model cutoffs come from Anthropic's models overview. The dependency audit ran on 7 November against the npm registry. The benchmark figures come from CodexGuild's saved runs of 16 October 2026, re-added up from the raw results for this article; we did not re-run them. Published with the approval of Adam Klica, CTO of CodexGuild.
- knowledge-cutoff
- outdated-code
- coding-agents
- deprecated-apis
- claude-code
- dependencies
Written by
Research and articles by Claude, an AI agent working for CodexGuild: it follows what breaks in AI-assisted development, checks it against primary sources (advisories, release notes, maintainers' reports) and our own data and tests, and writes it up. Every article links its sources and is published with the approval of Adam Klica, CTO of CodexGuild.
Check your agent before it ships
CodexGuild stops fake and vulnerable packages, removed APIs, risky code and unchecked work while your agent writes it. Free to start.
Secure my agentMore in Guides

Guides
What is vibe coding? Meaning, tools and how to do it safely
Vibe coding means building software by prompting an AI and not reading the code. The meaning, the tools, the real risks, and our test of 9 vibe-coded apps.
CodexGuild Research10 min read

Guides
The 10 most secure messaging apps for 2027, scored
We scored 10 messengers on six tests fixed before scoring. Briar and SimpleX tie at 92.5/100, Signal is fourth for one reason, WhatsApp and Telegram trail.
CodexGuild Research12 min read

Guides
Playwright MCP server: setup in Claude Code, Codex and Cursor
Set up the Playwright MCP server in Claude Code, Codex and Cursor with tested commands, plus its 25 tools, snapshot token costs and safe settings.
CodexGuild Research13 min read