When to Choose Each Option
Clear guidance based on your specific situation and needs.
Our Recommendation
For telling an AI coding agent how to work in your repo, AGENTS.md is the clear 2026 standard — now stewarded by the Linux Foundation's Agentic AI Foundation, present in 60,000+ open-source repositories, and supported by 28+ tools including Codex, Cursor, GitHub Copilot, Aider, Zed and Sourcegraph Amp (shipped first-party in Next.js 16.3). The research backs the practice: a 2026 arXiv study of 10 repositories and 124 real GitHub pull requests found that a well-structured AGENTS.md cut median agent runtime by ~29% and output token consumption by ~17% while keeping task completion comparable. README.md still owns human onboarding and remains the universal fallback that agents read when no AGENTS.md exists. Best practice: keep both. Put human docs, install steps and badges in README; put build/test commands, conventions, do-not-touch paths and agent rules in AGENTS.md. Don't cram agent instructions into the README, where they dilute human docs and get ignored — and keep AGENTS.md short (the spec emphasizes 100–300 words of high-signal instructions over long prose).
- Choose AGENTS.md when...
- You want AI agents to follow specific build, test and style conventions
- You work in a monorepo and need nested, per-package agent rules
- Your team uses Codex, Cursor, Copilot or Claude Code daily
- You want agent instructions separated from human-facing marketing/docs
- Choose README.md (for AI Agents) when...
- The project is tiny and a single human-readable file is enough
- You need the universal file every human and tool reads on GitHub/npm
- Your agents/tooling predate AGENTS.md and only look for README
- You are documenting for people first, agents second