AI GLOSSARY · AGENTS AND AGENT TOOLING

CLAUDE.md

Markdown version · Wikidata Q140169835

Definition

CLAUDE.md is a Markdown file of persistent instructions that Anthropic's Claude Code reads at the start of every session, such as build commands, conventions and project layout. Claude treats it as context, not enforced configuration.

Also called: claude md, claude md file, claude.md file.

In plain language

CLAUDE.md is a plain text note you leave in your project for Claude Code, Anthropic's coding tool. It might say how to run the tests and which style to follow. Claude Code starts each session with no memory of the last one, so it reads this note first instead of you retyping the rules. Think of the sheet of house rules you would give a new colleague on day one. The limit is that Claude reads the note as guidance, not as a lock: Anthropic's documentation says the file is context, not enforced configuration, and that shorter, more specific instructions are followed more consistently. A rule that must hold every time belongs somewhere that can enforce it.

Technical definition

Claude Code loads CLAUDE.md and CLAUDE.local.md files from the working directory and every directory above it, concatenates them into context ordered from the filesystem root down, and loads files in subdirectories on demand once Claude touches a file there. Other scopes are ~/.claude/CLAUDE.md for personal rules and a managed file for an organisation. The @path syntax imports other files, and .claude/rules/ holds topic files that can be scoped to file paths. The memory documentation says to target under 200 lines per file, and that /init generates a starting file. Because the text is only context, a rule with no exceptions belongs in a hook or permission setting.

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 examples: four stack templates, rules, imports

    What you see
    Complete CLAUDE.md examples for TypeScript, Python, Go and monorepo projects, plus .claude/rules, @imports and AGENTS.md, checked against the Claude Code docs.
    Why it exercises the concept
    It shows what a working file looks like in several stacks, so the definition above becomes a concrete file you can copy and trim.
  2. Guide · Illustrative, not executed

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

    What you see
    A comparison of which coding agents read each file, how Claude Code and Codex load them, and how to keep one source of truth.
    Why it exercises the concept
    It covers the most common practical question about CLAUDE.md: what to do when a repository also uses AGENTS.md.
  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
    Instruction files where every line is project-specific, verified against the repo, and worth loading on every session.
    Why it exercises the concept
    It applies the size and specificity advice from the Claude Code docs to the file you actually write.
  4. Coding tool · Illustrative, not executed

    Claude Code

    What to try
    /init
    What you see
    Per the Claude Code docs, Claude analyses the codebase and creates a starting CLAUDE.md with build commands, test instructions and conventions it finds. If one exists, /init suggests improvements instead of overwriting it.
    Why it exercises the concept
    Claude Code is the tool that reads the file, and /init is the documented way to create the first draft.

How it shows up when you use agents

CLAUDE.md is where a Claude Code project keeps the facts the agent cannot read from the code: how to build, how to test, which conventions apply. Claude Code loads it into context at launch, so every line costs some of the context window on every task. The file is one kind of agent instruction file, and its text sits alongside the system prompt the model already has.

What breaks when it is misunderstood:

  • Long files. The Claude Code docs say longer files consume more context and reduce adherence, and suggest moving task-specific procedures to a skill or a path-scoped rule. An agent skill loads when needed.
  • Hard rules. A line such as "never touch the migrations folder" is still only context. The docs say rules that cannot have exceptions belong in a hook, so see agent hooks.
  • Wrong scope. Personal preferences go in CLAUDE.local.md or the home-directory file, not the shared project file.

A sensible next step: run /init in a repository, cut the draft to what the code does not already show, then use /context all to verify which files loaded at launch and /memory to open and edit them, per the memory docs. If your team also uses AGENTS.md, the CLAUDE.md vs AGENTS.md guide shows how to share one file.

Common confusions

  • CLAUDE.md versus auto memory. You write CLAUDE.md. Auto memory is notes Claude writes itself from your corrections. Both load at the start of a session.
  • CLAUDE.md versus a skill. CLAUDE.md loads every session. A skill loads when invoked or judged relevant, so long procedures suit it better.
  • CLAUDE.md versus AGENTS.md. CLAUDE.md is Claude Code's file. AGENTS.md is an open format other agents read. By default Claude Code reads AGENTS.md only when no CLAUDE.md applies.
  • Myth: a CLAUDE.md rule is a guarantee. The documentation calls the file context, not enforced configuration. Use a hook or permission rule to block an action.

Terms that mention CLAUDE.md

12 terms mention this one

Guides that mention CLAUDE.md

Show all 12 guides

More in Agents and agent tooling

Next steps

  1. CLAUDE.md examples: four stack templates, rules, imports The long-form guide.
  2. agent-instruction-files A skill that exercises it.
  3. AGENTS.md Related term.
  4. Agent instruction file 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-24. Last verified .

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

Change log (2)
  • : First version.
  • : Verifier pass: applied defect-list corrections.