AGENTS.md
AGENTS.md is a versioned instruction file that tells coding agents how to work in a repository — including commands, conventions, boundaries, and checks.
AGENTS.md is a plain-Markdown instruction file that tells coding agents how to work in a repository. It typically records the project map, build and test commands, coding conventions, safety boundaries, and the checks that define a finished change.
Unlike a task prompt, AGENTS.md is durable and versioned with the code. Unlike a skill, it is always-on guidance rather than a procedure loaded for one recognizable workflow. That makes it the right home for facts such as “generated clients are never edited directly” or “changes under this service must run this test command.”
OpenAI Codex supports layered discovery. It can read personal guidance from the Codex home directory, then combine project files from the repository root toward the current working directory. A closer file takes precedence when guidance conflicts, and AGENTS.override.md can replace AGENTS.md within the same directory. This lets a monorepo define broad rules once while giving a mobile app, infrastructure tree, or service a narrower local contract.
Useful instructions are concrete and observable: exact paths, copyable commands, explicit do-not rules, and change-specific verification. Generic requests to “follow best practices” or “test thoroughly” consume context without telling the agent what action to take.
The full AGENTS.md guide includes a starter template, discovery order, scoping examples, and a verification workflow.
Frequently asked questions
- What does AGENTS.md do?
- It gives coding agents durable repository context before they work: important paths, setup and verification commands, engineering constraints, and definitions of done. Because the file is committed with the code, the team can review and update the instructions like any other project artifact.
- Is AGENTS.md only for OpenAI Codex?
- No. Codex has documented support for layered AGENTS.md files, but AGENTS.md is an open convention used by multiple coding agents. Exact discovery and precedence rules can differ by tool, so keep portable instructions plain and verify behavior in each client.
Related
- AGENTS.md for Codex: Project Instructions That Actually WorkWrite an effective AGENTS.md for OpenAI Codex — what belongs in it, how nested overrides work, and how to verify the instructions Codex loaded.
- OpenAI Codex: A Practical Guide for DevelopersLearn how OpenAI Codex works across the terminal, IDE, desktop app, and cloud — then set up a safe, repeatable workflow for real repositories.
- Agent SkillsAgent Skills are reusable procedures packaged as folders with a SKILL.md file — loaded by an AI agent on demand when a task matches, now an open standard.
- System PromptThe system prompt is the standing instruction layer an LLM receives before user input — defining its role, rules, tools, and tone for the whole conversation.
- Context EngineeringTreating the context window as a finite budget — what to load, what to leave out, and when to reset.