Skip to main content

AGENTS.md

Connect docs via MCP

Is AGENTS.md required?

No. AGENTS.md is optional. There is no schema, no validation, and no enforcement. Coding agents that support the standard read the file if present. Agents that don't support it ignore the file. AGENTS.md adds value only when it tells agents something they couldn't infer from the repository itself.

Where do I put AGENTS.md?

Place AGENTS.md at the root of your repository. In a monorepo, add nested AGENTS.md files inside subprojects whose conventions differ from the root. Agents follow a "nearest file wins" rule, walking from the working directory up to the repo root.

How long does AGENTS.md need to be?

Under 300 lines is the practitioner consensus. Some teams keep theirs under 60. Length past 300 lines consumes token budget without improving agent output, and published research shows it can degrade performance.

Difference between AGENTS.md and CLAUDE.md

AGENTS.md is the open, multi-tool community standard supported by a broad set of coding agents. CLAUDE.md is Anthropic's per-tool format used by Claude Code. Most teams use AGENTS.md as the source of truth and reference it from CLAUDE.md.

Can I autogenerate AGENTS.md from my codebase?

Not recommended. Write the file by hand and keep it specific.

See also