CODEX.md is a per-repository instruction file read by OpenAI's Codex coding agent, giving it project conventions, build and test commands, and guardrails so AI-assisted changes match how the team actually works.
CODEX.md
CODEX.md is a plain-markdown instruction file that OpenAI’s Codex coding agent reads from a repository to learn how that specific project wants to be worked on. It sits alongside the code and answers the questions a new contributor would ask: what are the coding conventions, how do I build and test, and what should I not touch. It belongs to the same family as AGENTS.md and other agent-context files that are quietly becoming a de facto standard for steering coding assistants.
- Project conventions - Naming, formatting, and structural rules the agent should follow when it edits code.
- Build and test commands - The exact commands to compile, run, and verify changes so the agent can check its own work.
- Guardrails and scope - Directories, files, or behaviors that are off-limits, keeping automated edits inside safe boundaries.
- Human- and machine-readable - One markdown file that both a developer and the agent parse the same way.
In day-to-day API operations this is where the agentic turn meets the repository. A well-written CODEX.md is the difference between an agent that generates plausible-looking code and one that produces changes matching the team’s real conventions, passing the real test suite, and respecting the real boundaries. As more of the design, documentation, and governance work around an API gets handed to coding agents, files like this become part of the contract for how a codebase is maintained.