An AGENTS.md example for Codex and Cursor

An AGENTS.md example for Codex and Cursor: the same short, every-session guide as a CLAUDE.md, in the file those tools read. Fill in your stack, commands and rules, drop it in the repo root, and commit it so every session starts the same way.

When to use this

Use it when you work with Codex or Cursor, which read AGENTS.md rather than CLAUDE.md. If you also use Claude Code, keep a CLAUDE.md too and keep the two in sync. The generator can write both at once.

The template AGENTS.md

# [Project] — AGENTS.md

Codex and Cursor read AGENTS.md at the project root. Keep it short; it loads every session.

## Stack
[Language and framework]. [Package manager].

## Commands
- Install: `[install command]`
- Build: `[build command]`
- Test: `[test command]`
- Lint: `[lint command]`

## How to work here
- Read the task, then the files it touches, before editing.
- Run the test and lint commands before you report a task done.
- Make the smallest change that solves the task, and say what you changed.

## Conventions
- Match the style of the file you are editing.
- Prefer existing helpers and components over new dependencies.

## Do not
- Do not edit generated files, lockfiles or anything under vendor.
- Do not commit secrets.
- Do not change CI config unless the task is about CI.

Why each section is there

  • Stack and commands tell the agent what it's in and the exact lines to run.
  • How to work here sets the loop: read first, test before done, smallest change.
  • Conventions keep new code matching the code already there.
  • Do not fences off generated files, secrets and CI.

Generate a CLAUDE.md and AGENTS.md together with the CLAUDE.md generator. For how agents use these files, read working with agents.

FAQ

Is AGENTS.md the same as CLAUDE.md?

Nearly. Same content, different filename. Claude Code reads CLAUDE.md; Codex and Cursor read AGENTS.md. If you use all three, keep both files and keep them in sync.

Where does it go?

In the project root, committed. Each tool loads it at the start of a session, so the rules travel with the repo.