BASE

AGENTS.md

AGENTS.md

Documentation · Free

AGENTS.md is an open file format for coding agent instructions and repository context. It is a convenient place for build commands, architecture rules, and change verification methods.

Resource illustration: AGENTS.md

Open resource ↗

What you can use for free

The format and materials are free; no separate server, API, or subscription is required.

Paid features and costs

The coding agent itself may have its own cost.

Access and limitations

The format and materials are free; no separate server, API, or subscription is required. The coding agent itself may have its own cost.

Use cases

  • Store rules and commands for Codex
  • Standardize work by several agents in a repository

Example workflow

A possible workflow; this is not a report of hands-on testing.

Example workflow with AGENTS.md: Store rules and commands for Codex.

Before you start

  • A recurring project task to document for a person or an agent.
  • Existing rules, files, and the validation methods actually used.

Steps

  1. For the task “Save rules and commands for Codex,” study the format and identify which information is needed at the start of a task and which is needed only on request. Create AGENTS.md at the repository root: briefly describe the project, setup, build and test commands, code style, and important constraints.
  2. Write a short description using your project as an example; link it to current sources. For a monorepo, place differing package rules in nested AGENTS.md files next to the corresponding workspace; explicitly specify the directory from which commands should run.
  3. Test the document on a real task and correct ambiguous instructions or ones that conflict with the project. Match the listed tests to package scripts or CI and ensure the agent actually sees the required instructions; update the document alongside project changes.

Check your result

  • The rules match the current files; links work and do not lead to an outdated copy.
  • A format description is not presented as an installed tool; its usefulness is established through a specific workflow.

Choosing AGENTS.md

Store rules and commands for Codex

Choose this when

  • Store rules and commands for Codex
  • Standardize work by several agents in a repository

Requirements

  • AGENTS.md is ordinary Markdown without mandatory fields. Create it at your repository root and check how the selected agent and its version read this file; for large projects, add narrower instructions in the relevant directories. Record real project commands rather than commands for the format's demonstration Next.js site.

Things to consider

  • Costs and limits of free use: The coding agent itself may have its own cost.
  • Terms of use: The official website and example repository uses MIT: use, modification, and distribution, including commercial use, are permitted with copyright and permission notices retained in copies or substantial portions. Materials are provided without warranties. This does not assign MIT to your own project instructions; creating such a Markdown file requires no service purchase.
  • AGENTS.md is a repository instruction file; it is not a separate plugin or MCP.

Frequently asked questions

What can you use for free in AGENTS.md?

The format and materials are free; no separate server, API, or subscription is required.

What additional costs might arise with AGENTS.md?

The coding agent itself may have its own cost.

What terms of use matter for AGENTS.md?

The official website and example repository uses MIT: use, modification, and distribution, including commercial use, are permitted with copyright and permission notices retained in copies or substantial portions. Materials are provided without warranties. This does not assign MIT to your own project instructions; creating such a Markdown file requires no service purchase.

How do you get started with AGENTS.md?

For the task “Save rules and commands for Codex,” study the format and identify which information is needed at the start of a task and which is needed only on request. Create AGENTS.md at the repository root: briefly describe the project, setup, build and test commands, code style, and important constraints. Write a short description using your project as an example; link it to current sources. For a monorepo, place differing package rules in nested AGENTS.md files next to the corresponding workspace; explicitly specify the directory from which commands should run. Test the document on a real task and correct ambiguous instructions or ones that conflict with the project. Match the listed tests to package scripts or CI and ensure the agent actually sees the required instructions; update the document alongside project changes.

What should you consider when choosing AGENTS.md?

Codex is listed among compatible agents.

Where should rules for different project areas be stored?

The official site describes nested AGENTS.md files: instructions closer to the changed file refine the rules for their part of the repository. The file can include setup, build, and test commands.

How does AGENTS.md differ from a README and MCP server?

A README explains the project to people; AGENTS.md adds context for a coding agent: commands, conventions, checks, and constraints. It is a text file, not a process, API, or MCP tool. It can complement the README and documentation without requiring a separate server.

Are pnpm and Next.js needed to use the format?

No: those README dependencies are for running the official site from its source. The format itself is ordinary Markdown; project tools and the selected coding agent have their own requirements.

How can AGENTS.md be connected to Aider and Gemini CLI?

The site shows read: AGENTS.md in .aider.conf.yml for Aider, and context.fileName: AGENTS.md in .gemini/settings.json for Gemini CLI. These are published configuration examples; before applying them, check your agent version's configuration format. Other agents may read rules differently and apply different scopes.

How should conflicting instructions be resolved?

The format's site describes precedence for the AGENTS.md closest to the changed file and the user's explicit request. A possible arrangement is shared rules at the root, package differences in a nested file, and the specific task in chat. The actual agent also has its own system rules and access policy; a project document does not guarantee overriding them.

License

The official website and example repository uses MIT: use, modification, and distribution, including commercial use, are permitted with copyright and permission notices retained in copies or substantial portions. Materials are provided without warranties. This does not assign MIT to your own project instructions; creating such a Markdown file requires no service purchase.

MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.

License terms

Usage details

Codex is listed among compatible agents. AGENTS.md is a repository instruction file, rather than a separate plugin or MCP.

Technologies and topics

  • AGENTS.md

Sources

Other resources