AI GLOSSARY · CODING AGENTS AND CODING TOOLS

Agent instruction file

Markdown version

Definition

An agent instruction file is a plain text file kept in a project, such as CLAUDE.md, AGENTS.md or a Cursor rule, that a coding agent reads at the start of work to learn the project's commands and conventions.

Also called: instruction file, agent instruction files, coding agent instructions.

In plain language

An agent instruction file is a note you leave for an AI coding tool, like the sheet of house rules you would hand a new contractor on day one. It says how to build and test the project and which style to follow. The tool reads it when a session starts, so you do not retype the rules in every message. Different tools look for different names: Claude Code reads CLAUDE.md, many others read AGENTS.md, and Cursor has its own rule files. The main limit is that the file is advice, not enforcement. The agent can still miss a line, and a long file makes that more likely. It also takes space in every session, which costs tokens, the units of text AI services charge for.

Technical definition

These files are Markdown text that the agent harness (the program that runs the model and its tools) inserts into the model's context at session start or when work reaches a matching folder or file. Claude Code loads CLAUDE.md files from the working directory and the directories above it, and reads AGENTS.md directly only when no CLAUDE.md applies, from version 2.1.277 as its memory page documents. AGENTS.md is an open format with no required fields, where the nearest file in the directory tree takes priority. Cursor project rules are .mdc files in .cursor/rules. None of these is enforced configuration: the model receives the text as context, so hard blocks need other controls such as hooks or permission settings.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Guide · Illustrative, not executed

    CLAUDE.md vs AGENTS.md: Which Agents Read Which File

    What you see
    A table of how Claude Code and Codex each find their instruction file, the one-line CLAUDE.md containing @AGENTS.md so both tools share one set of rules, and a list of pitfalls such as a CLAUDE.local.md stopping AGENTS.md from being read.
    Why it exercises the concept
    It shows one idea, a file of standing instructions, implemented by two tools with different loading rules, which is where most confusion about these files comes from.
  2. Guide · Illustrative, not executed

    Cursor Rules Explained: Rule Types and When to Use a Skill

    What you see
    The four places Cursor takes instructions from, the .mdc frontmatter keys description, globs and alwaysApply, and a decision rule for choosing AGENTS.md or a Cursor rule.
    Why it exercises the concept
    It covers the third common variant, rule files that load for every chat or only for matching files, so the reader sees that scope is part of the design.
  3. Skill by Skill Almanac · Illustrative, not executed

    agent-instruction-files 46/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    An instruction file in which each line is specific to the project, checked against the repository, and short enough to be worth loading in every session.
    Why it exercises the concept
    It targets a common failure of these files: lines that restate what the code already shows add tokens without changing the agent's behaviour.
  4. Skill by Skill Almanac · Illustrative, not executed

    rules-to-skills-migration 45/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    Editor rule files moved into AGENTS.md plus portable skills, with a record of how each rule was switched on.
    Why it exercises the concept
    It handles the next step when an instruction file grows: procedures that matter only sometimes move out into skills, which load on demand.

How it shows up when you use agents

Each Claude Code session begins with a fresh context window, according to its memory page. The instruction file is how a coding agent learns your build command, your test command and your conventions without being told again. In Claude Code the file is CLAUDE.md. Codex, Cursor and many other tools read AGENTS.md, and Cursor also has its own rule files. The guide CLAUDE.md vs AGENTS.md shows how the two fit together.

What breaks when this is misunderstood: people treat the file as a guarantee. The Claude Code memory page says the agent treats these files as context, not enforced configuration, and that shorter, more specific instructions are followed more consistently. A long file of generic advice is read every session and can bury the one line that matters. Copies of the same rule in two files drift apart, and a stray CLAUDE.local.md can stop AGENTS.md from loading at all.

Next action: open your instruction file and delete every line the code already shows. Keep the commands and the rules a newcomer could not guess. Move step-by-step procedures into an agent skill, which loads only when needed. Then start a fresh session and ask a question whose answer exists only in the file, to confirm it loaded.

Common confusions

  • CLAUDE.md versus AGENTS.md. CLAUDE.md is the file Claude Code reads first. AGENTS.md is an open format that many other agents read. According to the Claude Code docs, Claude reads a root AGENTS.md only when no CLAUDE.md applies, so a one-line CLAUDE.md that imports it is the usual way to share rules.
  • Instruction file versus system prompt. The system prompt is set by the tool's maker. The instruction file is added by you, in your project.
  • Instruction file versus skill. An instruction file loads in every session. A skill loads when the task calls for it, so it suits long procedures.
  • Myth. The agent obeys the file every time. The file is text the model reads, and the Claude Code docs say it is not enforced configuration.
Show all 17 related terms

Terms that mention Agent instruction file

31 terms mention this one

Guides that mention Agent instruction file

Show all 15 guides

More in Coding agents and coding tools

Next steps

  1. CLAUDE.md vs AGENTS.md: Which Agents Read Which File The long-form guide.
  2. agent-instruction-files A skill that exercises it.
  3. Coding agent Related term.
  4. Cursor rules Related term.
  5. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.

Review record

Last verified

Drafted by claude-sonnet-5-5; sources and example targets checked by claude-haiku-5-5 source check; claude-sonnet-5-5 editor pass on 2026-11-23. Last verified .

This entry is still in review, so it is not listed in search engines yet.

Change log (2)
  • : First version.
  • : Verifier pass: narrowed context-window claim to Claude Code memory page.