AGENTS.md and CLAUDE.md
Files in a repository with the rules a coding agent reads at the start of every session.
AGENTS.md and CLAUDE.md are files in a repository with the rules a coding agent reads at the start of every session. They hold what a new colleague would need: how to build and test, conventions, what not to touch, where things live.
AGENTS.md is the cross-tool convention; its site reports use in over 60,000 open-source projects and stewardship by the Agentic AI Foundation under the Linux Foundation. CLAUDE.md is read by Claude Code, which can also load AGENTS.md, as its memory documentation explains. Files can sit in subdirectories, and the one nearest to the edited code takes precedence. They are loaded every time, so length costs tokens and attention: a long file dilutes the rules that matter, see context rot. They are the prose layer of the agent harness.
A rule written in prose is a request. A rule the agent must never break belongs in a hook or a CI check. Longer procedures needed only for some tasks fit better in Agent Skills, which load on demand. When subagents or an agent team work in one repository, the same file gives all of them the same rules.
Sources
- AGENTS.md: AGENTS.md agents.md
- Claude Code Docs: How Claude remembers your project code.claude.com
Related terms
- Agent Skills: Folders with instructions, scripts and references that an agent loads only when the task needs them.
- Hooks: Scripts the harness runs automatically at fixed points, such as before a tool call or after an edit.
- Context engineering: Deciding what goes into the model’s context, in what order and when, across a whole task.
- Agent harness (harness engineering): Everything around the model that makes it an agent: the loop, tools, permissions, instructions, saved state, checks and session handoff.
- Coding agent: An agent that reads a repository, edits files, runs commands and tests, and opens pull requests.
- Subagent: A separate agent run with its own fresh context, started by a main agent for one subtask.
- Context rot: Model quality drops as the context fills with old, irrelevant or conflicting material.
- Slash commands (custom commands): Saved prompts stored as files in a repository and run in a coding agent by typing a short command such as /review or /plan.
- Agent-ready codebase: A repository a coding agent can work in reliably: one fast command to check everything, types, clear module borders, examples to copy and written rules.
- AI code attribution (provenance): Recording which code was written by an AI agent, under whose direction and with which tool, in commits, pull requests and audit logs.
