AGENTS.md is a Markdown file placed in the repository that explains to code agents how to work on that project. It gathers what a new person on the team would need to know: how to install, run tests, which code style to follow.
Think of it as a README, but written for the AI to read before touching the code.
How it works
When a compatible agent opens the project, it looks for the file and loads the content as context. That way you do not need to repeat the same instructions in every conversation.
The format is free, it is just Markdown. A good file usually has:
- commands to install dependencies, run and test;
- folder structure and the role of each one;
- code and commit conventions;
- rules like "never change file X";
- warnings about known pitfalls of the project.
The shorter and more specific, the better. Huge instructions take up context and can be ignored.
Practical example
You have a Node.js project and you want the agent to always run tests before finishing. Create at the root:
# Instruções do projeto
## Comandos
- Instalar: npm install
- Testar: npm test
- Lint: npm run lint
## Regras
- Rode npm test antes de finalizar qualquer tarefa.
- Use TypeScript estrito.
- Não edite arquivos em /dist.Ready. On the next task, the agent already knows how to validate its own work.
What it's for
- Consistency: every agent follows the same rules.
- Less rework: you do not explain the project every time.
- Onboarding: it also serves as quick documentation for people.
- Security: limits what the agent should avoid.
In teams that use several agents at the same time, like in an orchestrated squad on bridgecode, a common instructions file helps everyone work the same way.
Difference between AGENTS.md and CLAUDE.md
CLAUDE.md is the equivalent file used by Claude Code. The idea is the same: persistent instructions for the agent. AGENTS.md aims to be a more neutral name, read by different tools. Check your tool's documentation for which name it reads.
A good habit is to review the file from time to time. If the agent always makes the same mistake, add a line explaining the right way. If a rule is outdated, remove it.