Blog

What Is AGENTS.md?

Explanation of AGENTS.md, why AI coding assistants read it, what a good file looks like, and common mistakes teams make.

Last updated: March 15, 2026

TL;DR

  • AGENTS.md is a repository-level instruction file read by many AI coding agents.
  • It encodes coding conventions, testing rules, and workflow expectations for a project.
  • A consistent AGENTS.md standard improves agent behavior across repositories.

What is AGENTS.md?

AGENTS.md is a plain-text instruction file stored in a repository that explains how AI coding agents should work in that project. Tools like Cursor, Windsurf, and other AI-assisted editors read AGENTS.md to understand coding style, testing requirements, and project-specific rules.

The file sits alongside code and documentation, so it travels with the repository and can be versioned, reviewed, and rolled back like any other configuration.

Why do AI coding assistants use AGENTS.md?

General-purpose models do not know your local conventions by default. By reading AGENTS.md on startup or when analyzing a project, AI coding assistants can align their suggestions with your preferred patterns and safety constraints.

This reduces repeated prompt boilerplate and makes behavior more predictable. It also gives teams a concrete artifact they can inspect when they want to know "what have we told the agent to do here?"

What does an example AGENTS.md look like?

A simple AGENTS.md file defines coding conventions, testing expectations, and workflows in direct, imperative language. The example below is intentionally short but shows the basic structure.

# AGENTS.md

## Repository context
- This is a TypeScript monorepo using Next.js and Prisma.
- Treat instruction files as production configuration.

## Coding conventions
- Prefer explicit types in public interfaces.
- Keep business logic out of React components.
- Write idempotent database migrations.

## Testing expectations
- Add or update tests for any non-trivial behavior change.
- Keep unit tests fast and deterministic.
- Prefer integration tests around critical workflows.

## Workflow
- Explain trade-offs when proposing significant design changes.
- Call out security or data-handling implications explicitly.

Teams often extend this template with language about observability, performance budgets, or domain-specific rules. The key is to keep instructions concrete and stable rather than mixing them with transient project notes.

For guidance on managing AGENTS.md across many repositories, see How to Manage AGENTS.md Across Repositories.

What are best practices for AGENTS.md?

  • Keep instructions concise and concrete rather than aspirational.
  • Use sections for context, coding conventions, testing, and workflows.
  • Review AGENTS.md changes like code, with clear ownership and approval.
  • Link to authoritative docs instead of duplicating long explanations.
  • Document which tools read AGENTS.md in your environment.

What are common mistakes in AGENTS.md files?

Common issues include treating AGENTS.md as a chat-style note to a single tool, embedding time-sensitive information that quickly goes stale, and copy-pasting the same file into many repos without a plan to update it later.

Teams also sometimes overload AGENTS.md with generic best practices instead of focusing on the specifics that change agent behavior in that repository. A smaller, well-governed file is easier for both humans and agents to use.

FAQ

Where should AGENTS.md live in a repository?

Most teams place AGENTS.md at the repository root so it is easy for tools and humans to discover. Some tools also read instruction files from well-known subpaths; consult each tool’s documentation for details.

How often should AGENTS.md be updated?

Update AGENTS.md when your coding standards, testing requirements, or workflows change in ways that affect how agents should behave. Treat updates like any other configuration change: small, reviewable, and tested where possible.

Next step

Bring instruction files back under review before drift becomes debt.

Run the scanner, then try the demo or see pricing.