AGENTS.md
A repository-level instructions file read by Codex CLI, Cursor, and other tools to load project conventions for AI agents. Proposed as a cross-tool standard.
What is AGENTS.md?
AGENTS.md is a repository-level instructions file for AI coding agents. It gives tools like Codex CLI and Cursor a predictable place to read project conventions, setup notes, and working rules, and it is often discussed as a cross-tool standard. (github.com)
Understanding AGENTS.md
In practice, AGENTS.md acts like a README for agents. Instead of forcing a model to infer your stack, naming conventions, test commands, or pull request expectations from scattered docs, you put that guidance in one file the agent can load before it edits code. OpenAI’s Codex documentation describes AGENTS.md as scoped to the directory tree rooted at the folder that contains it, with deeper files taking precedence when instructions conflict. (github.com)
Cursor’s CLI docs also say it reads AGENTS.md at the project root and applies it alongside other rule sources, which is why the file has become attractive for teams that want portable agent instructions across tools. In that sense, AGENTS.md sits between human-facing documentation and machine-readable policy, helping the agent stay aligned with repository-specific workflow without hard-coding behavior into prompts. (docs.cursor.com)
Key aspects of AGENTS.md include:
- Repository scope: It is usually checked at the project root, so agents can pick up shared instructions before making changes.
- Plain Markdown: The format stays simple and readable, which makes it easy for humans to maintain.
- Tool portability: Multiple coding tools can read the same file, reducing tool-specific duplication.
- Behavior guidance: It can cover tests, commands, file paths, naming, and review expectations.
- Nested precedence: More specific instructions can override broader ones when tools support hierarchical lookup.
Advantages of AGENTS.md
- Consistent agent behavior: Agents get the same baseline context each time they enter the repo.
- Less prompt repetition: Teams do not need to restate common instructions in every session.
- Faster onboarding: New contributors and agents can learn repo conventions from one file.
- Better workflow fit: Commands, tests, and style rules can reflect the actual project setup.
- Cross-tool reuse: One file can support multiple coding assistants when they recognize the format.
Challenges in AGENTS.md
- Instruction bloat: Too many rules can make the file harder for agents to follow well.
- Tool differences: Support and precedence can vary across editors and CLIs.
- Stale guidance: Repo instructions can drift if commands or conventions change.
- Ambiguous scope: Teams may not clearly separate global guidance from folder-specific guidance.
- Overfitting: A file that is too prescriptive can reduce flexibility for unusual tasks.
Example of AGENTS.md in action
Scenario: a team adds AGENTS.md at the repo root with the right test command, code style rules, and a note to check the CI workflow before changing backend code.
A coding agent opens the project, reads AGENTS.md, and learns to run the monorepo test command instead of guessing. When it edits an API route, it also follows the repo’s naming rules and updates the relevant tests before finishing the task.
That is the real value of AGENTS.md, it turns project knowledge into reusable instructions that both humans and agents can share.
How PromptLayer helps with AGENTS.md
PromptLayer helps teams manage the prompts and workflows that sit around agent behavior, including the instructions, evaluations, and observability you need to keep AI systems consistent. If AGENTS.md is your repository’s operating manual, PromptLayer gives you a place to track how those instructions influence outputs over time, then refine them with more confidence.
Ready to try it yourself? Sign up for PromptLayer and start managing your prompts in minutes.