
What is AGENTS.md? How to write one your coding agents follow
AGENTS.md is a Markdown file that tells AI coding agents how to work on your repo. What it is, which tools read it, and how to write one that works.
One AGENTS.md that Codex, Cursor, Copilot, Claude Code and Gemini CLI all read, with bridge files, a loading-rules cheat sheet and a handoff template.
Write your rules once. These files make every major coding agent read them.
| Agent | Reads by default | To make it use AGENTS.md |
| --- | --- | --- |
| **Codex** | `AGENTS.md` (or `AGENTS.override.md`), one per folder, merged from the repo root down. Default size cap 32 KiB (`project_doc_max_bytes`). | Nothing to do. |
| **Cursor** | `AGENTS.md` at the root and in subfolders, plus `.cursor/rules/*.mdc`. | Nothing to do. A plain `.md` in `.cursor/rules` is ignored. |
| **GitHub Copilot** | The nearest `AGENTS.md` in the tree. It also uses `.github/copilot-instructions.md` if that exists. | Nothing to do. |
| **Claude Code** (v2.1.277+) | `AGENTS.md` **only if there is no** `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md` in the folder or above. | If you keep a `CLAUDE.md`, start it with `@AGENTS.md` (included). |
| **Gemini CLI** | `GEMINI.md`. | Add `.gemini/settings.json` with `context.fileName` (included), or put `@./AGENTS.md` in GEMINI.md. |
## Quick fixes for "my AGENTS.md never loads"
AGENTS.md: project rules with [brackets] to fill inCLAUDE.md: one-line bridge that imports @AGENTS.md.gemini/settings.json: makes Gemini CLI load AGENTS.mdLOADING-RULES.md: what each agent reads, and fixesHANDOFF.md: pass a task from one agent to another.gemini/settings.json? Merge the context key instead of replacing it.Anyone using more than one coding agent on the same repo.

AGENTS.md is a Markdown file that tells AI coding agents how to work on your repo. What it is, which tools read it, and how to write one that works.

How to run coding agents safely with Claude Code permission modes, Codex sandbox and approval settings, deny rules, and habits that keep secrets out of reach.

MCP security best practices for vibe coders: prompt injection risks, what the MCP spec requires, and a checklist to use MCP servers without leaking data.
The Codema publication. Consent is required. You are not subscribed until you confirm from the email, and nothing is stored if email delivery is not connected.