AGENTS.md

AGENTS.md is a Markdown file of standing project instructions addressed to AI coding agents in general rather than to one product, which an agent loads into its context before it starts work.

Codex CLI reads it before doing any work. As of September 2026, it reads a global file from its home directory (~/.codex by default), then one file per directory from the project root down to the working directory, and joins them in that order, so the guidance nearest to where you work comes last and takes precedence. An AGENTS.override.md replaces the regular file in its directory, and /init writes a starter file.

Codex also caps what it loads. It stops adding files once their combined size reaches project_doc_max_bytes, 32 KiB by default, and instructions past that point never reach the model. The chain is assembled once when Codex starts, so an edit applies from the next run.

Claude Code 2.1.277 and later reads AGENTS.md as the project instructions when no CLAUDE.md exists in the working directory or above it, and a setting makes it read both. A CLAUDE.md that contains @AGENTS.md imports the file explicitly, which lets one set of instructions serve several tools.

Sharing a file removes duplication; it does not make the file cheaper. Like any instruction file, AGENTS.md is part of every request in the session, so every line is paid for on every turn, by every agent that reads it. The same discipline applies as for CLAUDE.md: keep what every task needs and move the rest to where it is read only when relevant.

← All terms