Stop Doing AGENTS.md
Yes, this includes CLAUDE.md
Thesis
Almost no prompting is actually globally-applicable to all interactions: you are wasting tokens & confusing your agent by using global prompts.
Corollary
The few prompts that are globally-applicable are often better-served by paving your desire paths so you donât have to tell the agent about them.
The Problem
AGENTS.md and its ilk - including CLAUDE.md are one of several kinds of AI agent customization techniques. Weâll borrow from a16nâs taxonomy and refer to them as a form of GlobalPrompt:
A GlobalPrompt is always added to the agentâs context in any interaction.
The thing is, if youâre using AI agents correctly, theyâre handling multiple sorts of tasks for you. And if thatâs the case, itâs very unlikely that any single bit of information is going to be truly globally-applicable. Consider the example AGENTS.md from their own site:
# Sample AGENTS.md file
## Dev environment tips
- Use `pnpm dlx turbo run where <project_name>` to jump to a package instead of scanning with `ls`.
- Run `pnpm install --filter <project_name>` to add the package to your workspace so Vite, ESLint, and TypeScript can see it.
- Use `pnpm create vite@latest <project_name> -- --template react-ts` to spin up a new React + Vite package with TypeScript checks ready.
- Check the name field inside each package's package.json to confirm the right nameâskip the top-level one.
## Testing instructions
- Find the CI plan in the .github/workflows folder.
- Run `pnpm turbo run test --filter <project_name>` to run every check defined for that package.
- From the package root you can just call `pnpm test`. The commit should pass all tests before you merge.
- To focus on one step, add the Vitest pattern: `pnpm vitest run -t "<test name>"`.
- Fix any test or type errors until the whole suite is green.
- After moving files or changing imports, run `pnpm lint --filter <project_name>` to be sure ESLint and TypeScript rules still pass.
- Add or update tests for the code you change, even if nobody asked.
## PR instructions
- Title format: [<project_name>] <Title>
- Always run `pnpm lint` and `pnpm test` before committing.
This is very typical. Someoneâs tried to put good tips into one place, but none of them are universally-applicable; theyâre all task-specific. There are actually several classes of failure here:
Self-Evident to AI (DUH)
- Use
pnpm dlx turbo run where <project_name>to jump to a package instead of scanning withls. - Run
pnpm install --filter <project_name>to add the package to your workspace so Vite, ESLint, and TypeScript can see it. - Use
pnpm create vite@latest <project_name> -- --template react-tsto spin up a new React + Vite package with TypeScript checks ready. - Run
pnpm turbo run test --filter <project_name>to run every check defined for that package.
These are basic usage patterns of these tools; a modern agent should already know how these tools work and use them correctly. And if not, the CLIsâ own help text will reveal the basic usage - there is no need to duplicate this information here.
This would have been handy for a human who showed up to the project and had never seen pnpm before.
But the LLMs have seen it all - they know. Donât waste tokens telling them. Maybe just put it back in README.md.
Task-specific Guidance Delivered Globally (HUH)
- Check the name field inside each packageâs package.json to confirm the right nameâskip the top-level one.
- Find the CI plan in the .github/workflows folder.
- Fix any test or type errors until the whole suite is green.
- After moving files or changing imports, run
pnpm lint --filter <project_name>to be sure ESLint and TypeScript rules still pass. - Add or update tests for the code you change, even if nobody asked.
These are fine things to do, but theyâre not universally-applicable. While updating documentation, you do not care about the âCI planâ in .github/workflows/.
When you are working on that CI plan, though, you definitely donât care about âmoving files or changing importsâ - youâre just shuffling CI, not writing the main code.
And so on, and so forth. Now, these handful of one-liners may seem harmless, but in practice you can see AGENTS.md files balloon in size to hundreds of lines with paragraphs upon paragraphs of task-specific guidance⊠and the more of that you add, the smaller the percent of AGENTS.md that actually applies to the task at hand.
But youâre still including it in every context window.
Duplicated Non-Canonical Information (DRY)
- Title format: [<project_name>] <Title>
Is that for a GitHub Pull Request? Or an Issue? We have templating standards for that, theyâll be in .github/PULL_REQUEST_TEMPLATE.md and .github/ISSUE_TEMPLATE.md respectively.
Is that for a commit? Well, humans commit, too, donât they? Whereâs the guidance for them? in CONTRIBUTING.md maybe?
Duplicating information in AGENTS.md that has its canonical source in a different file is a recipe for drift and agent âmisbehavior.â
Misuse of LLM (WASTE)
- Always run
pnpm lintandpnpm testbefore committing.
We have a tool for that that doesnât cost tokens: pre-commit hooks. Itâs way cheaper to use that than to ask an LLM to
- understand the natural language
- reason out how to achieve the desired outcome
- call tools to do it
- call more tools to verify that it was done correctly
While that example is specifically for pre-commit hooks, itâs a pattern that gets repeated over and over: yes, we can tell the agents to do the things humans would do, but you often donât need to - and doing so wastes context.
¿Por qué no los dos?
You can definitely offend in multiple of the above categories, too, by the way! For example, the pnpm ... command guidance would also be a DRY violation, if there were a package.json that conveniently bound some npm run-scripts to those long-form commands.
A Note on Wasting Context
âWasting context (window space)â is not just about price-per-token - itâs also about keeping confusing or contradictory information out of the agentâs context to maximize the chances of success.
Maybe âAlways run pnpm lint and pnpm test before committing.â is only a few tokens, and you donât notice that extra cost. But⊠now the agent has that to think about, too. When youâre revising documentation and the agent finishes writing intro.md, itâs going to consider whether it needs to run pnpm test - even if it ends up not doing it.
And maybe that particular sentence is harmless. But neither of those scales up well as AGENTS.md gains section after section of content that is not related to your specific task.
Sub-Agents?
What if you just use a sub-agent per task, and give it its own AGENTS.md, and then everything in there is globally-applicable?
Well, yeah, that is what you do with sub-agents but - âsub-agents are for a single taskâ is a handy mental modelling technique thatâs not actually true. The âjust clean up the codeâ sub-agent is going to be reading code, writing code, making judgement calls, possibly consulting documentation on this codebaseâs style, running test suites to make sure it didnât break things, etc⊠sub-agents narrow the scope of the tasks, but they are almost never single-task. A true single-task, single prompt/response interaction doesnât warrant the overhead complexity and cost of a sub-agent in the first place!
Doing it Right
With all that, we can arrive at a simple set of rules for putting something valuable into a GlobalPrompt like AGENTS.md:
DONâT repeat yourself - DO reference canonical sources
Instead of repeating how to run the project, consider
This project is built with pnpm; see `./package.json` for supported build scripts and patterns.
Instead of spelling out your style guide, consider
This project uses `eslint` for linting; see `./eslint.config.js` for the configuration and `package.json` for how to run it properly.
Vercelâs next.js AGENTS.md, while somewhat long, is also a pretty decent example of this technique.
DONâT correct behavior - DO pave your desire paths
Why should you even have to tell an agent to look into package.json for how to invoke eslint, though? Is it not npx eslint per the eslint docs or just npm run lint?
Why not?
Noticing what the agent gets wrong is the right first step. Paving your desire paths is better than building an ever-growing list of corrective prescriptions.
Agents love to write a âCommon Pitfallsâ section in guidance files, and that may work - especially at first when the document and list is short - but itâs a wasteful antipattern for all but the most egregious of offenses.
I have a project in which the agents keep trying to run npm run format to format the code. I donât have that hooked up to eslint --fix, which is the extent of the formatting I use in that project.
â WRONG: AGENTS.md
...
- When formatting code, always run `npx eslint --fix`, **not** `npm run format`.
...
â
RIGHT: package.json
{
"scripts": {
"format": "npx eslint --fix"
}
}
Fixed Example
Here is an AGENTS.md for the same pnpm/turbo monorepo featured in the original example, rewritten with the techniques and tips described above.
AGENTS.md
This workspace is a pnpm monorepo using Turbo. See `./package.json` (and `packages/*/package.json`) for build scripts, workspace layout, and package names.
CI and test/lint behavior are defined in `.github/workflows/`. Use the scripts in `package.json` from the repo root or via `pnpm ⊠--filter <project_name>`; these are the same commands that CI runs.
See `CONTRIBUTING.md` for the proper process for contributing to this project.
We assume the desire paths are paved: package.json defines lint, test, and any other scripts the agent might reach for; pre-commit runs lint and test so we donât have to say it; PR and commit conventions live in their canonical files (e.g. .github/PULL_REQUEST_TEMPLATE.md and CONTRIBUTING.md).
The AGENTS.md âGlobalPromptâ now just points the agent at the canonical sources for things that it might need to look up, and weâve done the work in the repository to ensure that the agentsâ intuition about the repository is correct.
But Actually, Donât
⊠points the agent at the canonical sources for things that it might needâŠ
Hey, thatâs an AgentSkill - a big set of information that is not automatically in context, hidden behind a little in-context description indicating when it might be useful and/or when it should be pulled into context.
Just use those instead of the GlobalPrompt that is AGENTS.md.
All the leaders in the field - Cursor, Claude, Codex - support this open standard. If youâre using a tool that doesnât⊠itâs well past time to switch.
Non-Sub-Agent
There is still a place for a GlobalPrompt though: use AGENTS.md as if you were building a sub-agent, but to bootstrap the core persona of your primary agent. Something like niko-core.mdc. No specifics about the repo at all - just general guidelines for how the Agent should be.
Core Persona & Approach
Act as a highly skilled, proactive, autonomous, and meticulous senior colleague/architect. Take full ownership of tasks, operating as an extension of the userâs thinking with extreme diligence, foresight, and a reusability mindset. Your primary objective is to deliver polished, thoroughly vetted, optimally designed, and well-reasoned results with minimal interaction required. Leverage available resources extensively for proactive research, context gathering, verification, and execution. Assume responsibility for understanding the full context, implications, and optimal implementation strategy. Prioritize proactive execution, making reasoned decisions to resolve ambiguities and implement maintainable, extensible solutions autonomously. Not every interaction requires code changes - youâre happy to discuss, explain concepts, or provide guidance without modifying the codebase. When code changes are needed, you make efficient and effective updates.
No But Actually Donât
Oh, hey,
No specifics about the repo at allâŠ
Put that guidance in a user-wide setting in your home directory - e.g. ~/.claude/CLAUDE.md - instead, and leave AGENTS.md out of the project altogether.
What about others who come to hack on the project with an agent but without the sophistication that youâve now developed from having read this? I guess you can leave a link to this blog post in your AGENTS.md so they can catch up! ;)
Further Reading
Or, people who agree with me (though possibly for different reasons)!
- Stop Putting Everything in AGENTS.md - Basically this same post but slightly less sassy.
-
Stop Using .md for AI Agent Instructions - Attacks the use of the
.mdextension, rather than the semantics of the content. -
Helmsman: Stop Writing AGENTS.md That Lies to Half Your Models - notes that different
AGENTShave different capabilities in both reasoning and environment setup, butAGENTS.mdtries to advise all of them the same way.
Postscript
2026-02-24
The same day I published this, an incredibly damning research paper (of which, at the time, I was completely unaware) was published:
Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?
arxiv.org/abs/2602.11988 (archive)
Spoiler: they arenât!
- developer-provided files only marginally improve performance compared to omitting them entirely (an increase of 4% on average)
- LLM-generated context files have a small negative effect on agent performance (a decrease of 3% on average)
- ⊠as a result, increase costs by over 20%
Q.E.D.