Skip to content

AI Glossary · Concepts

What is Agent Instruction File?

Agent Instruction File

An agent instruction file is a plain-text file kept in a code repository that tells AI coding agents how to work on that project: how to build and test it, which conventions to follow and what to avoid. AGENTS.md is the open, cross-tool format; CLAUDE.md, Cursor rules and Copilot instruction files do the same job for specific tools.

Also known as: agent instructions file, agent rules file

· Updated · Chain of Thought

AI CodingContext Management

  • 2 explainers
  • 1 episode
  • 5 sources

A new engineer joining a project reads the README, asks where the tests live and learns the team’s habits over a few weeks. A coding agent starts every session with none of that. An instruction file closes part of the gap. A typical one says: install with npm ci, run npm test before every commit, never edit generated files, use the existing logging helper, and open pull requests as drafts.

The file becomes part of the agent’s context at the start of a task, a little like a project-level system prompt. Because it lives in the repository, it is reviewed and versioned like code, and every developer’s agent gets the same instructions. Large repositories can nest files so each package carries its own rules.

The names vary by tool. AGENTS.md is read by several agents, including OpenAI Codex, Cursor and GitHub Copilot’s agents. Claude Code reads CLAUDE.md; Cursor also has its own rules directory; Copilot has a repository-wide instructions file. Many teams keep one source file and point the others at it, so the instructions don’t drift apart.

An instruction file is guidance, not enforcement. Agents can miss or misread it, especially when it is long or contradictory (see instruction adherence). Rules that must hold, such as “don’t push to main”, belong in permissions, sandboxing and CI checks as well. Keep the file short and specific, and move reusable procedures into agent skills that load only when needed. This is one of the simplest forms of context engineering.

Sources

Go deeper

From the conversation