AGENTS.md Is Not a README: Why AI Coding Tools Need a Rulebook, Not a Welcome Mat
Teams burning through token budgets and fighting agent misbehavior are usually missing a maintained AGENTS.md. Without it, every session starts from zero, context windows fill with repeated corrections, and agents guess wrong on conventions that were never written down. A concise, team-shared rule file cuts rework and makes AI coding costs predictable.
AGENTS.md functions as a machine-readable rulebook that AI coding agents load at session start. It specifies build commands, test procedures, naming conventions, forbidden actions, and cross-file change requirements. Tools like Codex, Cursor, and Claude Code all support it, though Claude Code layers its own CLAUDE.md on top and can import AGENTS.md via an @ reference.
Running `/init` scans the project and generates a starter AGENTS.md, but it only captures surface-level structure. It cannot know team conventions, historical pitfalls, or recurring mistakes. The real value comes from ongoing maintenance: every time a developer repeats the same correction in a prompt, that rule should be promoted into AGENTS.md. Claude Code users get an intermediate step through Memory, a local draft notebook that holds temporary lessons before they graduate to the shared rule file.
A 2025 study on LLM instruction-following confirms that agents degrade when overloaded with rules. Effective AGENTS.md files are short, specific, and actionable — "run pnpm lint after changing frontend components" works; "keep code elegant" does not. The file is not a real-time config; changes require a new session to take effect, and Codex enforces a default 32 KiB total size limit across all loaded rule files.
Most teams treat AGENTS.md as a one-time generated artifact, but its real function is as a living sink for recurring prompt corrections — a cache that prevents context-window bloat.
The 32 KiB size limit in Codex is a forcing function for discipline: rules that cannot survive truncation were probably too vague to be useful anyway.
Claude Code's Memory-to-AGENTS.md pipeline is an under-documented workflow that mirrors a personal kanban for agent rules — draft locally, promote when stable.
AGENTS.md and CLAUDE.md solve the same problem through competing formats, but the @ reference syntax in Claude Code makes the format war irrelevant for teams willing to maintain one canonical rule file.
Vague rules fail not because agents ignore them, but because they lack a verifiable condition — an agent cannot check whether code is 'elegant,' but it can check whether it ran pnpm lint.
The instruction-following degradation curve means a 50-line AGENTS.md with sharp rules will outperform a 500-line one filled with aspirations.