---
id: 18105
lang: en
title: "Four Lines in AGENTS.md Raised Coding Agents' Library Upgrade Success Rate to 100%"
published_at: "2026-11-24 22:26:01"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1111958/?utm_campaign=1111958&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18105"
categories: ["llm", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Four Lines in AGENTS.md Raised Coding Agents' Library Upgrade Success Rate to 100%

> **Краткая суть (BLUF):** You ask an AI agent to upgrade a library, and it installs the old package. The tests pass, even though the package has already moved to a new name. The author checked this across 591 runs of four agents. Four lines in AGENTS.md (the instruction file the agent reads before working) tell it to run a full npm view and look for the official upgrade guide. With those lines, the agents succeeded in 100% of the Hedera and Prisma 8 tasks, 156 out of 156. That is why such steps are worth writing into the project in advance.  - Codex with a Russian-language task searched the web in 9 of 10 runs without the lines, and in 0 of 10 runs with the lines - Claude Code with Haiku searched the web only 2 times out of 40 without the lines, and 36 times out of 40 with them - DeepSeek V4.1 Flash: 100 runs cost $2.02, about two cents per run

The most unpleasant coding-agent failure is a silent one. You ask the agent to upgrade a library, it does, the project builds, and the tests are green. In reality, the old package is still installed, the package moved to a different name long ago, and you keep building on outdated code. The author of a Habr write-up checked how often this happens and whether it depends on the language of the task. She ran 591 runs: four agents, English, Russian, Ukrainian and Spanish prompts, and two libraries. The main result: a short four-line instruction in AGENTS.md (a plain-text file in the project root that the agent reads before working) raised the success rate to 100%: 80 out of 80 on Hedera and 76 out of 76 on Prisma 8.

## What the tasks were and where the catch was

Both tasks involved npm, and in both the project pinned an old version. The first required upgrading @hashgraph/sdk (Hedera) to a supported version. But the SDK had moved to the @hiero-ledger/sdk package. The old package looks alive: it has a latest tag and no deprecated notice. The agent upgrades it, the project works, and it never switches to the new SDK.

The second task required upgrading Prisma 7 to version 8. In version 8 there is no @prisma/client package; the client lives in @prisma/orm-postgres. Meanwhile, @prisma/client@latest still installs version 7. A hidden script checked that the project was on the new package and did the same things as before. Green tests alone were not enough for that.

## What the runs showed

Web search solves the problem. On Hedera without a hint, the agent searched in 15 runs and passed 13 of them. Out of 65 runs without search, only 7 passed. The command npm view @hashgraph/sdk version does not report the move, but a news item about it can be found through search.

The task language affects Codex most strongly: with a Russian task it stops searching, while with Ukrainian and Spanish tasks it searches again, though not always. The author does not know why Russian behaves this way. The effect is weaker for the other agents. Claude Code with Haiku hardly searched in any language without a hint: 2 runs out of 40. Kimi and DeepSeek searched rarely on Hedera and often on Prisma 8.

The remedy turned out to be simple: four lines in AGENTS.md (and in CLAUDE.md for Claude Code). They require running the full npm view, reading the deprecated and dist-tags fields, checking whether the package has moved, reading the documentation shipped inside the package, and searching for the official upgrade guide before editing any code. With these lines, all agents passed all runs in all languages. Codex with the Russian task searched in 9 of 10 cases with the lines, and in 0 of 10 without them. Haiku rose from 2 search runs out of 40 to 36 out of 40. The lines are written in English and do not name specific libraries, so they fit any project. A note saying "colleagues hit a similar case" gave the same result (40 out of 40 and 38 out of 38), but it has to be rewritten for each library.

## Task wording and model choice

The first version of the task read "upgrade Prisma to the current version." Even the four lines barely helped here: 13 runs out of 80, and 5 out of 80 without a hint. The agents saw that prisma@latest is the release candidate 8.0.0-rc.33 while the client was still 7.10.1, and reasonably chose to stay on the latest stable version. Only a note stating that the current Prisma is version 8 helped (38 out of 40). So if you need a specific version, name the number. The other Prisma figures refer to the reworded task "upgrade to version 8" (200 runs).

The model matters too, not just the agent. In the same Claude Code setup, the DeepSeek V4.1 Flash model searched the web in 10 runs out of 40, while Haiku 5.5 searched in 2 out of 40. On Hedera without a hint, DeepSeek succeeded in 7 of 20 runs versus 0 of 20 for Haiku; on Prisma 8 it was 18 of 20 versus 3 of 20. With the four lines, both models passed everything. DeepSeek is also inexpensive: 100 runs cost $2.02, about two cents per run.

On timing, Codex with GPT-6-Sol (effort low) has the shortest median: 72 s on Hedera and 152 s on Prisma 8. Claude Code with Haiku takes 97 s and 260 s, and with DeepSeek it takes 109 s and 302 s. On Prisma 8, DeepSeek reads about 2.69 million input tokens, though that figure includes reads from the cache.

## Limitations and what to do

The test covers only npm. The author did not check PyPI or crates, nor local models such as Qwen and Gemma. The Ukrainian and Spanish translations were made by ChatGPT, and no native Ukrainian speaker was among the reviewers. Search was counted from actual tool calls in the logs, not from the agent's own claims: Claude's self-report in the previous round turned out to be wrong.

The practical takeaway: put the four lines into AGENTS.md, even if you write tasks in Russian. Don't trust latest or green tests; check the package name and version in package.json. Name the version number. And maintainers of libraries should keep in mind that some agents don't go online, so the deprecated flag and the documentation shipped inside the package are the signals that reach every agent.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1111958/?utm_campaign=1111958&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18105
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
