# AGENTS.md

> Canonical: https://skillalmanac.com/glossary/agents-md | Last verified: 2026-11-24 | Index status: not offered to search engines

AGENTS.md is an open, plain Markdown format for giving instructions to AI coding agents. It sits in a repository like a README written for agents, holding build steps, tests and conventions.

Also called: agents md, agents md file, agents.md codex.

## In plain language

AGENTS.md is a plain text file you put in a software project to tell AI coding tools how the project works: how to build it, how to run the tests, what style to follow. The agents.md site describes it as a README for agents. The same file can be read by several different tools, so a team does not keep one note per tool. A large project can have more than one file, and the one closest to the code being edited takes precedence. The limit is that each tool decides how it loads the file, and the text only guides the agent, so it is not a security control.

## Technical definition

AGENTS.md has no required fields: it is standard Markdown placed at the repository root, with optional copies in subdirectories. According to agents.md, the closest file to the edited file wins and an explicit user prompt overrides everything. Tools differ in how they load it. Codex checks AGENTS.override.md, then AGENTS.md, then names in project_doc_fallback_filenames, takes at most one file per directory, concatenates them from the root down, and stops adding files at project_doc_max_bytes, which defaults to 32 KiB. Claude Code reads a root AGENTS.md only when no CLAUDE.md or CLAUDE.local.md applies, or through an @AGENTS.md import from CLAUDE.md. agents.md says the format is maintained by the Agentic AI Foundation under the Linux Foundation.

## How it shows up when you use agents

AGENTS.md is the instruction file that more than one coding agent can read. If you use Codex, it is the file Codex looks for. If you use Claude Code, the file matters when your repository already has one, because Claude Code reads it only under a specific condition. The general idea is covered under [agent instruction file](/glossary/agent-instruction-file); this entry is about the AGENTS.md format itself.

What breaks when it is misunderstood:

- **Missing instructions.** A team adds AGENTS.md and a CLAUDE.md that says something else. Claude Code then reads CLAUDE.md files only, and the AGENTS.md rules do not load. An `@AGENTS.md` line inside [CLAUDE.md](/glossary/claude-md) imports it.
- **Silent truncation.** Codex stops adding files once the combined size reaches its limit. Keep files short and place specialised rules in subdirectories.
- **Over-trust.** The text is guidance for the model. Anything that must be enforced belongs in permissions or a sandbox.

A next action: put build and test commands first, run your agent, and ask it which instruction files it loaded. The [Codex AGENTS.md setup](/learn/codex-agents-md-setup) guide shows how to check this in Codex, and [CLAUDE.md vs AGENTS.md](/learn/agents-md-vs-claude-md) covers both tools together. Keep the file within the [context window](/glossary/context-window) budget your tool allows.

## Common confusions

- **AGENTS.md versus README.** A README is written for people. AGENTS.md is a README for agents, with the commands and conventions that would clutter the human version.
- **AGENTS.md versus CLAUDE.md.** AGENTS.md is an open format. CLAUDE.md is Claude Code's own file, loaded first when it exists.
- **AGENTS.md versus AGENTS.override.md.** In Codex, an override file in the same directory takes precedence over AGENTS.md. It suits temporary or specialised rules.
- **Myth: all agents load it the same way.** The agents.md page lists many agents, but each decides how it discovers, orders and limits the files.

## Worked examples in this catalogue

### [Codex AGENTS.md setup: file locations and layering](https://skillalmanac.com/learn/codex-agents-md-setup)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Where Codex finds AGENTS.md files, how global and project layers combine, and how to confirm which instructions load in a session.

Why it exercises the concept: Codex is a tool that documents AGENTS.md loading in detail, so this guide shows the format working as specified.

### [Make Claude Code read AGENTS.md: import and verify](https://skillalmanac.com/learn/make-claude-code-read-agents-md)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Claude Code reads AGENTS.md only when no CLAUDE.md is in or above the working directory. The guide shows an @AGENTS.md import to share one file, then a check with /memory.

Why it exercises the concept: It covers the main way the format and a vendor-specific file collide, and how to resolve it.

### [rules-to-skills-migration](https://skillalmanac.com/skills/skill-almanac/rules-to-skills-migration)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Move editor rule files to AGENTS.md plus portable skills without losing how each rule was switched on.

Why it exercises the concept: It treats AGENTS.md as the shared destination for rules that began in one editor's own format.

### [Codex](https://skillalmanac.com/tools/codex)

```
codex
```

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Codex CLI starts. According to the Codex documentation, it then looks for AGENTS.override.md and AGENTS.md from the project root down to the current directory.

Why it exercises the concept: Codex is one of the agents the agents.md site lists as reading the format.

## Related terms

- [Agent instruction file](https://skillalmanac.com/glossary/agent-instruction-file.md)
- [CLAUDE.md](https://skillalmanac.com/glossary/claude-md.md)
- [Coding agent](https://skillalmanac.com/glossary/coding-agent.md)
- [System prompt](https://skillalmanac.com/glossary/system-prompt.md)
- [Context window](https://skillalmanac.com/glossary/context-window.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)

## Sources

- [AGENTS.md](https://agents.md/), agents.md (accessed 2026-11-24)
- [Custom instructions with AGENTS.md](https://learn.chatgpt.com/docs/agent-configuration/agents-md), OpenAI (Codex docs) (accessed 2026-11-24)
- [How Claude remembers your project](https://code.claude.com/docs/en/memory), Anthropic (Claude Code Docs) (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
