Instruction files are guidance you write once and every session reads, such as AGENTS.md, CLAUDE.md or Cursor rules. Notes a harness saves on its own are on the Memories page.
What gets loaded
| Question | Claude Codechecked at 2.1.299 |
|---|---|
| Which files it reads | Claude Code reads
|
| Where it looks, and when nested files load | At launch it loads the managed file (macOS Directories added with Subdirectory files and path-scoped rules don't appear under Memory files in |
| When several apply, which wins | Every applicable file is concatenated into context; nothing overrides anything. Order is managed, user, then project files from the filesystem root down to your working directory, with CLAUDE.md content is sent as a user message after the system prompt, and Claude treats it as guidance, not enforced configuration; use hooks or permissions for hard rules. |
| Size limits | Earlier documentation recorded a 4 MiB full-file loading limit and a recommended length of about 200 lines. In 2.1.309, oversized nested CLAUDE.md files instead load only their beginning, preventing repeated compaction; the release note does not specify the retained prefix size. Keep startup/root-file handling separate from this nested-file exception. Large combined instruction/import warnings scale with context size; paths lists retain their independently documented pattern budget. A paths list remains capped at 1,000 brace-expanded patterns / 4 MiB; patterns beyond the budget are used unexpanded, per the earlier documentation audit. The 200-line / 25KB truncation applies only to auto memory's |
Writing them
| Question | Claude Codechecked at 2.1.299 |
|---|---|
| One file for several harnesses | Yes. With the default Project instructions mode Direct AGENTS.md reading needs v2.1.277+ and the built-in plugin enabled; before v2.1.281 it didn't work on Bedrock/Vertex/Foundry or with telemetry off. Before v2.1.285 the plugin ID was Other tools' files such as |
| Rules for some paths, or only on request | Yes: a If the frontmatter YAML doesn't parse, the rule loads unconditionally; Path-scoped rules that live in a symlinked directory outside the project don't load even after external imports are approved; only unscoped ones do. Path-scoped rules are summarized away by compaction and reload on the next matching file access. |
| Include other files | Yes: write Imports organize content but don't save context: imported files load in full at launch. An external import inside a directly-read AGENTS.md loads only if external imports were already approved for the project, with no prompt. |
| Add instructions from config or flags | Use
In resumed conversations the recorded system prompt is reused; pass |
| Generate a starter file |
|
Control
| Question | Claude Codechecked at 2.1.299 |
|---|---|
| See what loaded, and apply edits | Run
Changing the Project instructions mode applies from your next message. |
| Turn them off or skip some | To skip instruction files for a run, use
The built-in Explore and Plan subagents skip CLAUDE.md at startup. |
| Enforce instructions for an organisation | Partly Admins can deploy a managed A user can still start with Instructions are guidance, not enforcement; use managed In |
Notes and sources
Claude Code, 10 sources
- User and managed CLAUDE.md and .claude/rules do not suppress AGENTS.md fallback.
- Direct AGENTS.md loads do not fire InstructionsLoaded hooks; imports through CLAUDE.md do.
- Instructions provide context, not enforced operation policy.
- 2026-10-24: the earlier blanket statement that every oversized CLAUDE.md is skipped is superseded for nested files by 2.1.309 publisher notes. Current docs retrieval was blocked (HTTP 403); no new truncation byte count is asserted.
- 2.1.311 publisher fixes stale CLAUDE.md after automatic compaction and startup/file-operation freezes with very long list items. Earlier nested-file truncation evidence remains separately scoped; no new byte budget or runtime proof.
- 2.1.312 publisher fixes Claude overwriting a very large CLAUDE.md, rules file or @-included file in a subdirectory after seeing only its start; Write now asks Claude to read it all or edit in place. This does not change which instruction files load or how much of them.