OpenAI / Codex7 minLesson 10 of 60

AGENTS.md for Codex

Codex reads an AGENTS.md file before it touches your code. It is the same idea as CLAUDE.md: a plain Markdown file that tells the agent how your project works. AGENTS.md started with Codex and is now an open format many agents read.

Layering

Codex builds an instruction chain when it starts, reading files from broad to specific. That means you can keep global preferences in one place and repo-specific rules in another, and the closer-to-the-code file wins on conflicts.

AGENTS.md
# AGENTS.md

## Setup
- Install: `pnpm install`
- Dev: `pnpm dev`

## Testing
- Run `pnpm test` and make sure it is green before finishing.

## Style
- Functional React components. No class components.
Write it once, reuse it everywhere
Because AGENTS.md is an open format, the same file often works across Codex, Cursor, Gemini CLI, and others. Write your project rules once and let every agent benefit.
Custom instructions with AGENTS.md (OpenAI)Official guide to how Codex discovers and uses AGENTS.md files.developers.openai.com
Finished this lesson? Mark it read to track your progress.