Session 3
Project rules: AGENTS.md
Goal. Give Codex standing instructions for your project with an AGENTS.md file.
- 1Codex reads AGENTS.md before doing any work. Put working agreements in it: "Always run
npm testafter changing JavaScript", "Run the linter before opening a PR", and your project conventions. - 2Files layer by location — a global
~/.codex/AGENTS.mdplus per-project files from the Git root down to your current folder; files closer to your working directory override broader ones. - 3AGENTS.md is an open standard used by other agents too, so the same file can guide multiple tools.
You'll see. Codex automatically running your test and lint steps and following your conventions without being reminded each session.
Cost. One-time setup — the rules ride along every session at negligible cost and save you repeating yourself.
Takeaway. Write the project's rules once in AGENTS.md and Codex applies them on every task, in every session.