What AGENTS.md Is and Which Agents Actually Read It
AGENTS.md is a Markdown file of rules for coding agents. Who maintains it, which tools read it, what to put in it, and real annotated example files.
The Short Version
- AGENTS.md is plain Markdown with no required fields, and agents read it before they work in your repo.
- The Agentic AI Foundation under the Linux Foundation stewards the format.
- Codex, Cursor, GitHub Copilot and VS Code read it by default, and Gemini CLI and Aider need one setting.
- Claude Code skips AGENTS.md whenever a CLAUDE.md or CLAUDE.local.md exists, so add one import line to CLAUDE.md.
- Keep it short: Codex stops reading at 32 KiB by default, and Claude's docs target under 200 lines.
On this page
- AGENTS.md Is a README Written for Agents
- The Linux Foundation Now Stewards the Format
- Seven Tools Confirm Support in Their Own Docs
- Claude Code Skips AGENTS.md When Any CLAUDE.md Exists
- A Good AGENTS.md Holds Six Sections
- A 2026 Study Found Most AGENTS.md Lines Cost More Than They Help
- Generated Files Need a Human Cut Before They Ship
- Temporal's SDK File Shows the Code Repo Pattern
- A Notes Repo File Swaps Build Commands for Link Checks
- Put Shared Rules in AGENTS.md and Claude Rules in CLAUDE.md
- Nested Files Let One Folder Add Its Own Rules
- Five Mistakes Make Agents Ignore the File
- Write Your First AGENTS.md in Four Steps
- Skip AGENTS.md in Two Cases
- Build Your Notes Repo AGENTS.md Now
- Questions and Answers
You explain the same house rules to every AI coding tool you try. Codex forgets them, Cursor never heard them, and Claude Code follows a different file. AGENTS.md, often searched as agents md, is the one file they share.
AGENTS.md is a plain Markdown page at the root of a project that tells AI agents how to work there. It holds how to build and test, the conventions, and the limits. Codex, Cursor, GitHub Copilot and about 20 other tools read it, so one file briefs every agent you use.
I keep one AGENTS.md that Claude Code and Codex both follow in the same repos.
| Tool | Reads AGENTS.md | What to know | Docs |
|---|---|---|---|
| Codex | ✓ by default | Also reads a personal file, stops at 32 KiB | Codex docs |
| Cursor | ✓ by default | Root and subfolders, plain Markdown with no metadata | Cursor rules docs |
| GitHub Copilot | ✓ by default | Files anywhere in the repo, nearest one wins | GitHub docs |
| VS Code | ✓ by default | Copilot reads AGENTS.md, Claude reads CLAUDE.md | VS Code docs |
| Claude Code | ✓ with a condition | Read only when no CLAUDE.md exists, from v2.1.277 | Claude Code docs |
| Gemini CLI | ✗ until you set it | Reads GEMINI.md unless you change one setting | Gemini CLI docs |
| Aider | ✗ until you set it | Load it as a read-only file in settings | Aider docs |
AGENTS.md Is a README Written for Agents#
AGENTS.md holds the context an agent needs and a human reader would skip. The agents.md site calls it "a README for agents."
The format has no schema. The site says it is just standard Markdown, so any headings work. An agent reads the text the way you would.
The site counts more than 60,000 open-source projects that use the file, based on a GitHub code search. It shows examples from openai/codex, apache/airflow and temporalio/sdk-java.
The Linux Foundation Now Stewards the Format#
The agents.md site says the Agentic AI Foundation, under the Linux Foundation, stewards AGENTS.md. No single vendor owns the name.
The site names OpenAI Codex, Amp, Jules from Google, Cursor and Factory as the makers behind it. So a file written for Codex also works in Cursor.

Seven Tools Confirm Support in Their Own Docs#
The agents.md site lists 23 tools. Seven of them confirm support in their own docs, as the table above shows. Five read the file by default, and two need one setting. Three details in those docs change how you write the file.
- Codex stops at 32 KiB. The Codex docs say it reads your personal file first, then one file per folder from the project top down to your working folder. Past 32 KiB combined, later files drop out. The Codex AGENTS.md use case shows what happens when that file goes stale.
- Copilot reads the pull request branch. The GitHub docs say Copilot code review reads agent instructions from the head branch. So a pull request can change the rules its own review follows.
- Gemini CLI and Aider need one setting. Gemini CLI reads GEMINI.md until you add AGENTS.md to its context file names, as the Gemini CLI docs show. Aider loads conventions files as read-only context, and the agents.md site gives the one line for its settings file.
Cursor reads the file in the root and in subfolders, per the Cursor docs. VS Code reads it for its Copilot harness, per its docs. I did not check the other 16 tools on the list, such as Jules, Zed, Warp and Devin.
Claude Code Skips AGENTS.md When Any CLAUDE.md Exists#
Claude Code reads AGENTS.md from version 2.1.277, with one condition. Thariq Shihipar from Anthropic announced it on X on 18 Sep 2026: Claude uses AGENTS.md when a folder has no CLAUDE.md.
The Claude Code memory docs name the three files that block it. A CLAUDE.md, a CLAUDE.md inside the hidden Claude folder, or CLAUDE.local.md in your working folder or above it makes Claude read those instead.
CLAUDE.local.md is the trap. It is a personal file you keep out of git. Add one to a team repo that relies on AGENTS.md, and Claude stops reading the team rules for you alone. Your teammates see no change.
Your personal CLAUDE.md in your home folder does not count, so it loads beside AGENTS.md. Two fixes keep both files:
- Add one import line at the top of CLAUDE.md that points at AGENTS.md. Claude reads the shared file, then your Claude-only rules.
- Change the Project instructions setting so Claude loads both files in each folder. The Claude Code memory docs name the option.
The post on CLAUDE.md for a notes repo covers the Claude side in depth.
A Good AGENTS.md Holds Six Sections#
The agents.md site suggests five sections: project overview, build and test commands, code style, testing instructions and security. Add one more section for pull request rules.
- Overview: what the repo is, in two lines and no more. The study below found that repository overviews did not help.
- Commands: the exact build, test and lint commands.
- Layout: which folder holds what, and which folders to leave alone.
- Conventions: style rules a linter does not catch.
- Checks before done: the commands that must pass. The agents.md site says agents try to run listed commands and fix failures before they finish.
- Pull requests and limits: commit format, PR template, and what needs a human.
Link to your contributing guide instead of copying it.
A 2026 Study Found Most AGENTS.md Lines Cost More Than They Help#
Thibaud Gloaguen and four co-authors tested whether these files help coding agents finish real tasks. Their paper, Evaluating AGENTS.md, first posted on 12 Feb 2026, found that context files do not generally raise success rates. They raised inference cost by over 20% on average.
Agents followed the instructions well. Repository overviews did not help, although model providers recommend them. The files helped most when they named non-standard practices, the rules an agent cannot guess.
So I run every line through the guess test. Would an agent get this wrong with the file deleted? If no, cut the line.
Example. Five lines from a notes repo AGENTS.md, sorted by the guess test.
| Line | Would an agent guess it? | Keep or cut |
|---|---|---|
| This repo holds Markdown notes | Yes, from the files | Cut |
| Write in clear English | Yes, it already tries | Cut |
| Never edit a note in the library folder, add a new note in the inbox | No | Keep |
| Keep the source line when you merge two notes | No | Keep |
| A file name with spaces is correct, do not rename it | No | Keep |
Agents obey the file, so every extra rule sends them to read and test more. A short file of rules an agent cannot guess costs less than a long file of facts it can read.
Brainfeed's agent prompt shows the shape. Its key line is "Never accept or reject ideas yourself. Only I swipe." No agent would guess that rule, and every agent would break it without the line.
Generated Files Need a Human Cut Before They Ship#
A setup command drafts the file from what it finds in the repo. By the guess test, most of that is noise. Treat a generated file as a list to cut, never as the finished file.
| Source of the line | Keep it when |
|---|---|
| A tool's setup command | It names a command or limit you confirm is real |
| A mistake an agent made twice | Always, with the fix in one line |
| A rule you hold in your head | An agent broke it at least once |
| A fact the code already shows | Never |
Temporal's SDK File Shows the Code Repo Pattern#
The temporalio/sdk-java AGENTS.md is 59 lines and was last changed on 15 Oct 2026. It shows four of the six sections. Open the link to read it in full.
What each part does:
- Repository Layout maps each module in one line. The agent edits the right module first.
- General Guidance draws one hard line, the public API, and frees every internal folder. A clear limit beats a list of preferences.
- Building and Testing gives exact commands and warns that the full suite is slow. The agent runs one test class instead.
- Review Checklist is the definition of done. The file ends by pointing to the contributing guide for the rest.
A Notes Repo File Swaps Build Commands for Link Checks#
A notes repo has no build, but it still has ways to break. The Networked Thinking vault AGENTS.md, last changed on 21 Sep 2026, guards an Obsidian vault. For other ways to bring AI into a vault, read Obsidian AI in 2026.
It has three sections. Open the link to read it in full.
What each part does:
- Editing Rules names the Obsidian syntax an agent might "fix" by mistake, such as folder names with spaces.
- Vault Conventions turns a known failure, broken links after a rename, into a search the agent must run.
- Verification replaces a test suite with a path length script and a link review.
For a second brain, add trust levels per folder and rules for answering from notes. The AGENTS.md guide for a second brain covers those sections and gives a template to copy.
Put Shared Rules in AGENTS.md and Claude Rules in CLAUDE.md#
Use AGENTS.md for rules every agent shares. Use CLAUDE.md only for what Claude Code alone needs.
| AGENTS.md | CLAUDE.md | |
|---|---|---|
| Read by | Codex, Cursor, Copilot, VS Code and others | Claude Code, plus Copilot and VS Code's Claude harness |
| Personal variant | A home-folder file for Codex | CLAUDE.local.md and a home-folder file |
| Imports | None in the format | One line pulls in another file |
| Size guidance | 32 KiB default cap in Codex | Under 200 lines per file |
The setup I use: all rules live in AGENTS.md. CLAUDE.md holds one import line and a few Claude-only lines. When a tool insists on its own file name, the agents.md site suggests a link file that points back to AGENTS.md.
Nested Files Let One Folder Add Its Own Rules#
Put a second AGENTS.md in a subfolder when one part of the repo has different rules. A monorepo package or a client folder are the usual cases.
Each tool gives the nearest file the last word. The agents.md site says the closest file to the edited file wins, and your chat prompt overrides every file. Codex joins files from the root down, so the closer file comes later and overrides. Cursor combines nested files with their parents, and the more specific rule wins.
Five Mistakes Make Agents Ignore the File#
Most failures come from length, location or vague wording.
- The file is too long. Codex drops files past 32 KiB combined, and Claude Code's docs say length lowers adherence.
- A CLAUDE.local.md hides it. Claude Code reads your local file and skips the team AGENTS.md. Import it from CLAUDE.md.
- Rules say "write clean code". It fails the guess test. Name the formatter the project runs.
- Facts live in the file. Project status and team lists go stale. Link to the file that holds them.
- Gemini CLI or Aider never loads it. Both need the setting shown above.
Write Your First AGENTS.md in Four Steps#
Start from what an agent got wrong last week. That gives you rules with a reason.
- Create AGENTS.md at the top of the project with a two-line overview.
- List the exact checks you run before you share work.
- Add one line for each mistake an agent made twice.
- If you use Claude Code, add a CLAUDE.md with one import line.
For a notes repo, the free AGENTS.md generator builds the file from seven questions in your browser.
Example. This is demo content, not a real run. A newsletter issue argues that agent rule files should list commands, not adjectives. Brainfeed shows a card labeled builds on, linked to your note on agent rules. You accept it. A new note on rules as commands lands in your notes repo through one pull request you merge.
Skip AGENTS.md in Two Cases#
A rules file pays off only when agents work in the repo often.
- You use one tool that has its own file. A Claude Code user with a working CLAUDE.md gains no new rule from a second file.
- The repo is a one-off script. An agent reads a 50-line script faster than you can write rules for it.
Build Your Notes Repo AGENTS.md Now#
AGENTS.md tells agents how to work in your repo. For a notes repo, open the free AGENTS.md generator, answer seven questions, and copy the file. It builds in your browser, needs no account, and outputs AGENTS.md or CLAUDE.md.
Brainfeed then does the weekly reading for you. Agents compare every new idea with your notes, you swipe, and only accepted ideas reach your repo. Your first pull request is free, and Starter costs $9 for your first month, then $19. Start at brainfeed.atharvashah.com/#join.
Questions and Answers#
- What is AGENTS.md?
- AGENTS.md is a plain Markdown file of instructions for coding agents, placed at the root of a repo. The agents.md site calls it a README for agents. It has no required fields. It holds what an agent needs and a human reader does not: build commands, test commands, conventions and limits.
- Who maintains the AGENTS.md format?
- On 20 Nov 2026 the agents.md site says the Agentic AI Foundation under the Linux Foundation stewards the format. It grew out of work across OpenAI Codex, Amp, Jules from Google, Cursor and Factory. The site lists 23 tools that support it.
- Does Claude Code read AGENTS.md?
- Yes, from version 2.1.277, but only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md exists in your working directory or above it. To keep both files, add one import line to CLAUDE.md that points at AGENTS.md, or change the Project instructions setting so Claude loads both.
- What is the difference between AGENTS.md and CLAUDE.md?
- AGENTS.md is the shared format that Codex, Cursor, GitHub Copilot and about 20 other tools read. CLAUDE.md is Claude Code's own file, with extras such as imports of other files and a personal local variant. Keep the rules in AGENTS.md and import them from a one-line CLAUDE.md.
- How long should AGENTS.md be?
- Keep it under 200 lines. Claude Code's docs give that target for CLAUDE.md, because longer files cost context and lower how well the agent follows them. Codex stops adding instruction files at 32 KiB combined by default. A 2026 study found extra lines raise cost, so keep only rules an agent cannot guess.
- Where do I put AGENTS.md?
- Put one at the repo root. Add more in subfolders for rules that apply only there. Codex, Cursor and GitHub Copilot all apply the nearest file, so a subfolder file adds to or overrides the root. Codex also reads one personal AGENTS.md from your home folder.
Read Next#
- AGENTS.md for a Second Brain: What to Put in ItWhat to put in AGENTS.md for a second brain: a folder map, trust levels, note format, write rules an agent can check, answer rules, and an access key per agent.
- For Codex usersCodex and AGENTS.md Context That Stays CurrentCodex follows AGENTS.md even when it is stale. Brainfeed adds the newsletter ideas you accept to your repo each week, so the context Codex reads stays current.
- How to Give Claude Code Memory From Your Notes RepoGive Claude Code memory from a notes repo: a CLAUDE.md under 200 lines, a folder map, frontmatter on every note, and path rules that load only when needed.
- Markdown Frontmatter That Agents Can UseWhich frontmatter fields help Claude Code and other agents pick the right note: a one-line description, sortable dates, a source link and a clear status.
Keep the Best Ideas From Every Newsletter
Paste a GitHub repo of Markdown notes. The free scan shows which of 41 newsletters fit what you already know.
No account needed. Your first pull request is free.
ExampleFrom a newsletter issue
Small teams now ship with one agent per repo.
Builds on agents.md