Key takeaways
- AGENTS.md is a plain Markdown file in your repository that tells AI coding agents how to set up, test and change your project. Think of it as a README for agents.
- It has no required fields or schema. Codex, Cursor, GitHub Copilot's coding agent, Gemini CLI, Jules, Junie, Zed, Windsurf and many others support it.
- Keep it short and specific: commands, conventions, boundaries and how to check work. Use nested files for subprojects.
Every coding agent needs the same basics before it can help: how to install dependencies, how to run tests, and what the house rules are. For a while, each tool had its own file for this, such as .cursorrules or CLAUDE.md. AGENTS.md is the shared alternative.
Where AGENTS.md came from
OpenAI released AGENTS.md as an open format in August 2025, developed together with teams behind Amp, Jules, Cursor and Factory. In December 2025, it was contributed to the Agentic AI Foundation under the Linux Foundation, which now stewards it alongside the Model Context Protocol. The official site says it's used by more than 60,000 open-source projects.
How agents use it
- You place
AGENTS.mdin the root of your repository. - Agents read it automatically when they start working.
- If you list test or lint commands, agents will try to run them and fix failures before finishing.
- In a monorepo, you can add more AGENTS.md files in subfolders. The file closest to the code being edited takes precedence.
- Your direct instructions in chat override anything in AGENTS.md.
What to put in it
The format is just Markdown, so use any headings that make sense. The sections that help agents most:
- Project overview: one or two lines on what the app is and its stack.
- Setup commands: exactly how to install and run it locally.
- Testing and checks: the commands that must pass before work is done.
- Code style and conventions: naming, folder structure, patterns to follow and avoid.
- Boundaries: files and actions that are off-limits.
- Git and PR rules: branch naming, commit message format, what to include in a PR description.
A template you can copy
# AGENTS.md
## Project
Laravel 12 blog CMS with Filament admin. PHP 8.3, MariaDB, Tailwind, Vite.
## Setup
- composer install
- npm install
- cp .env.example .env && php artisan key:generate
- php artisan migrate --seed
## Checks (run before finishing)
- php artisan test --filter=<RelatedTest>
- vendor/bin/pint --test
- vendor/bin/phpstan analyse
- npm run build
## Conventions
- Business logic lives in app/Actions, not controllers.
- Use Form Requests for validation.
- Store money as integer paise, never floats.
- New features need a Pest feature test.
## Boundaries
- Never read or edit .env or any credentials file.
- Don't change files outside the task.
- Don't run destructive database commands against non-test databases.
- Don't push; leave changes as a local commit.
## Git
- Work on the dev branch.
- Commit messages: short imperative summary, then a blank line and details.
Replace the details with your own stack. The more specific the commands, the better the results.
Monorepos and subprojects
For a repository with several apps, put a short AGENTS.md in the root with shared rules, and a more specific one in each package:
/AGENTS.md shared rules
/apps/api/AGENTS.md API-specific commands and conventions
/apps/web/AGENTS.md frontend-specific commands
When an agent edits a file in apps/web, the nearest file wins.
Moving from other rule files
If you already have a tool-specific file, you don't need to maintain two copies. The official site suggests renaming the old file to AGENTS.md and adding a symbolic link with the old name:
mv AGENT.md AGENTS.md && ln -s AGENTS.md AGENT.md
Some tools need a small setting. For Aider, add read: AGENTS.md to .aider.conf.yml. For Gemini CLI, set the context file name to AGENTS.md in .gemini/settings.json.
If you use Laravel, Laravel Boost can write its framework guidelines into AGENTS.md inside a managed block, leaving your own notes untouched.
Common mistakes
- Writing an essay. Agents read the whole file every time. Long, vague text wastes context and dilutes the rules that matter.
- Copying the README. AGENTS.md should hold what agents need and humans don't, not repeat the project description.
- Vague rules. "Write clean code" doesn't help. "Use Form Requests for validation" does.
- Out-of-date commands. If a listed command fails, agents lose time or give up. Update the file when your tooling changes.
- Secrets. Never put API keys, passwords or private URLs in it. The file is usually committed and readable by anyone with repo access.
Does it actually help?
Research and team reports vary. The clearest benefit is consistency: agents stop asking the same setup questions and follow the same checks every time. It works best combined with a clear task brief for each job. My guide on briefing an AI coding agent safely covers that side.
Frequently asked questions
What is AGENTS.md?
It's a plain Markdown file in your repository that gives AI coding agents project-specific instructions, like setup commands, tests and conventions. It's often called a README for agents.
Which AI coding agents support AGENTS.md?
The official list includes OpenAI Codex, Cursor, GitHub Copilot's coding agent, Gemini CLI, Google Jules, JetBrains Junie, Zed, Windsurf, Devin, Aider, goose and others.
Does AGENTS.md have required sections?
No. It's standard Markdown with no required fields. Use whatever headings fit your project.
What happens if there are multiple AGENTS.md files?
The file closest to the code being edited takes precedence, and your direct chat instructions override all of them.
Sources: agents.md (official site and FAQ); Agentic AI Foundation blog; InfoQ on AGENTS.md's release (August 2025); Laravel Boost documentation. Tool support lists change; check each agent's docs.
Originally published on PromptPost.
Top comments (0)