Skip to content
AI Dev Toolkit.
Esc
  • AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.Tool
  • LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.Tool
  • AI Model ComparisonCompare prices, context windows and features across models.Tool
  • AI Model Pricing PagesSpecs, real costs and cheaper alternatives for popular models.Tool
  • Context Window CheckerSee whether your text fits each model’s context window.Tool
  • Subscription vs API CalculatorFind out whether a chat plan or the API is cheaper for you.Tool
  • GPU / VRAM CalculatorCheck how much VRAM a local model needs and which GPUs fit.Tool
  • Prompt Caching CalculatorEstimate savings from prompt caching.Tool

AI glossary · Agents and tools

What is CLAUDE.md (and AGENTS.md)?

Also called: AGENTS.md, CLAUDE.local.md, project instructions file

Definition

CLAUDE.md is a Markdown file of project instructions that Claude Code loads into context at the start of every session, and AGENTS.md is the open, tool-neutral equivalent read by many coding agents.

Explained

How it works

Claude Code reads CLAUDE.md files from several places: ./CLAUDE.md or ./.claude/CLAUDE.md for the project (committed and shared), ./CLAUDE.local.md for your own uncommitted notes, ~/.claude/CLAUDE.md for every project, and an organisation-wide managed file. Files in your working folder and the folders above it load at launch; files in subfolders load when Claude works there. An @path line imports another file, up to four hops deep.

AGENTS.md, which its site calls “a README for agents”, does the same job for Codex, Cursor, Gemini CLI and others. Since v2.1.277, Claude Code reads AGENTS.md when there’s no CLAUDE.md or CLAUDE.local.md in your working folder or above it. To use both, the documented pattern is a CLAUDE.md that imports it with an @AGENTS.md line.

Claude treats these files as context, not enforced configuration. Anthropic suggests staying under 200 lines per file, because longer files use more context and are followed less reliably.

Example

A short CLAUDE.md and its recurring cost

This file is 126 tokens on OpenAI’s o200k_base tokenizer (Claude’s own tokenizer counts differently). It holds only what Claude can’t work out from the code: the commands, two architecture rules and a security rule.

Because it sits in the context, it goes out with every request: a 40-request session sends it 40 times, about 5,040 tokens, usually at the discounted prompt caching rate. Every line you add is paid for on every turn of every session, which is the best argument for keeping it short.

CLAUDE.md
# Acme web app

Next.js app with a Postgres database. Package manager: pnpm.

## Commands
- `pnpm dev`: start the app on http://localhost:3000
- `pnpm test`: unit tests (Vitest); run them before every commit
- `pnpm lint --fix`: lint and format

## Rules
- Server-only code lives in `src/server/`; never import it from client components.
- Change the database with a new file in `db/migrations/`; never edit an old migration.
- Never commit `.env` files or print secrets in logs.

Cost and quality

Why it matters

A good CLAUDE.md saves the turns Claude would spend rediscovering your build commands and conventions, and stops repeated mistakes. A bloated one costs tokens on every request and dilutes the rules that matter. For rules that must always hold, use a hook instead.

Don’t mix up

Common confusions

Does Claude Code read AGENTS.md?
Yes, from v2.1.277, but by default only when there’s no CLAUDE.md or CLAUDE.local.md in your folder or above it. Importing it from a CLAUDE.md with an @AGENTS.md line also works in sessions that can’t read AGENTS.md directly.
CLAUDE.md vs auto memory
You write CLAUDE.md. Auto memory is notes Claude writes for itself in a MEMORY.md file, of which the first 200 lines or 25 KB load each session.
CLAUDE.md vs system prompt
The system prompt is set by the app. CLAUDE.md is your project’s file that Claude Code adds to the context alongside it.

Go deeper

Try it and read more

Related

All 40 terms in the AI glossary

Written by Tahir Nazir. Checked .

How this was checked: Example file measured with gpt-tokenizer 4.0.0 (o200k_base). Locations, load order, imports, the 200-line guidance, AGENTS.md rules (v2.1.277) and auto memory limits checked against Claude Code’s memory docs; the AGENTS.md description and supporting tools against agents.md, on 2026-10-11.