Skip to content
AGENTS.md

Rules for coding agents

AGENTS.md is a Markdown file you commit so a coding agent starts every task with the same limits. These pages are starters for common stacks. Edit the commands so they match your repository, then commit the file. They are not a listing of someone else's rule collection.

13 startersOne file, several agents
Who reads the file

Where each agent looks

Checked against the vendor docs. A nested AGENTS.md covers that directory and the folders under it.

  • Codex

    Reads AGENTS.md from the repository root down to the working directory. A closer file is applied later, so it overrides earlier guidance. The combined text stops at 32 KiB unless you raise the cap.

    Vendor docs
  • Cursor

    Reads AGENTS.md at the project root and in subdirectories. A nested file covers that directory and its children, and the more specific file takes precedence.

    Vendor docs
  • Claude Code

    From v2.1.277, reads AGENTS.md when the working directory has no CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md above it. If one of those exists, Claude reads that file unless it imports AGENTS.md.

    Vendor docs
  • Gemini CLI

    Reads GEMINI.md by default. It reads AGENTS.md when you list that filename in context.fileName.

    Vendor docs
Three different things

Rules, skills, and MCP servers

AGENTS.md

Instructions that load with the repository. They say how to work in this codebase: which commands to run, and what to leave alone.

Agent Skills

A SKILL.md folder the agent loads when a task matches. Browse skills.

MCP servers

A separate program that exposes tools. Browse MCP servers.

Start here

Start here

A short file that works in any repository before you add stack-specific rules.

Languages

Languages

Checks, module boundaries, and commands for the languages the directory already lists.

Frameworks

Frameworks

App Router and React habits that keep an agent inside the files you asked it to change.

Data and runtime

Data and runtime

Postgres changes and containers, where a casual command can touch shared state.

Habits

Habits

Tests, secrets, and pull requests. Paste one of these next to a language file.

FAQ

Questions about AGENTS.md

What is an AGENTS.md file?

A plain Markdown file of instructions for a coding agent. You commit it to the repository. Codex and Cursor read it on their own. Claude Code reads it when the repo has no CLAUDE.md. Gemini CLI reads it after you list the filename in its settings. The short version of each vendor's behavior is on this page.

How is AGENTS.md different from an Agent Skill or an MCP server?

AGENTS.md is always in context for that repository. An Agent Skill is a folder the agent loads when the task matches its description. An MCP server is a separate program that exposes tools. Browse skills and browse MCP servers.

Should I commit one of these files unchanged?

Edit the commands first. Each page names checks that are common for that stack, and your repository may call them something else. Delete any section that does not apply, and add the files the agent must not touch.

Can a monorepo have more than one AGENTS.md?

Yes. Put the shared limits at the root and a shorter file in the package it covers. Codex and Cursor both apply the closer file on top of the parent. Keep the combined text under Codex's default 32 KiB cap, or raise that cap on purpose.