Editor's note: This is an AI-assisted English adaptation of a research note on Claude Code v2.1.220. The original note described internal message formats and file-loading behavior. This article distinguishes those observations from what current public docs say, particularly about AGENTS.md, imports, and size limits.

Suppose the only line in your project’s CLAUDE.md is:

Use pnpm, not npm.

Then you ask Claude Code to add Lodash. Where does that instruction come from, which other files join it, and what happens if you change it halfway through the session?

Part 1 covered how the agent assembles a request. This time, follow one instruction through that assembly.

1. Project context is not the core system prompt

The older note described project instructions arriving in an application-generated message before the first real user message. Its example included a <system-reminder> wrapper, an internal isMeta flag, and separate sections for instructions and the date. Think of the wrapper as a way for the application to supply context, not as an API role, a security boundary, or a promise about an exact message index. Part 2 separates those internal records from the public message format.

The lasting point is the separation. The Claude Code caching guide distinguishes core system instructions and tools from project context and conversation history. Different repositories need different project instructions. Keeping them after the more stable prefix makes it possible to reuse that earlier prefix when later context changes, provided the other cache conditions still match. Part 3 explains why this ordering matters.

2. Four instruction scopes, plus auto memory

The Claude Code memory guide distinguishes four places for standing instructions. Auto memory is a fifth source of context, but it serves a different purpose.

Source Typical entry point What belongs there
Managed The organization’s managed CLAUDE.md Organization-wide standards
User ~/.claude/CLAUDE.md Personal preferences that apply across projects
Project CLAUDE.md, .claude/CLAUDE.md, and project rules Shared conventions such as “use pnpm”
Local CLAUDE.local.md Uncommitted personal preferences for this project
Auto memory MEMORY.md in the repository’s auto-memory directory Notes Claude saved for future sessions

Working directory matters. If you start under apps/web/, Claude Code discovers instruction files there and in ancestor directories; current docs describe ordering from outer directories toward the working directory. It does not simply select one file at a Git root. Instructions discovered at different levels are combined, not merged as a configuration object where one setting replaces another. Don’t rely on the model resolving contradictory prose the way a settings parser resolves conflicting keys.

Instruction files deeper than your starting directory load when you work in those directories. A gitignored local file can also differ between worktrees. If what Claude sees is unclear, inspect the session with /context all rather than inferring the result from the tree. The CLI reference documents --bare for scripts that intentionally skip the standard discovery of these customizations.

3. Use imports to organize, and scoped rules to load less

A CLAUDE.md file can bring another file into context with an @path import:

Use pnpm, not npm. @docs/testing.md 

Relative paths start from the file containing the import, not from your shell’s working directory. The parser ignores paths mentioned inside inline code or fenced blocks. The current guide documents four recursive import hops: five files in a chain can include the starting file, without making five imports. The historic note’s depth counter and the documentation are not necessarily contradicting each other. Project imports resolving outside the working directory are subject to approval. Review what an import contains before enabling it, especially if it points outside the repository.

Imports shorten the main file, not the context: the imported text still loads alongside it. Use a rule with paths when a convention should apply only to particular files. For example, .claude/rules/ui-tests.md might contain:

--- paths: - "apps/web/**/*.test.tsx" --- Use the existing render helper for component tests. 

A rule with no paths is normally loaded at launch in its scope; this one enters context when Claude works with a matching file. For a project rule, the patterns are relative to the directory containing its .claude folder. A Python file needn’t bring the component-test rule into context.

Keep three different limits separate. The guide recommends short instruction files, gives a size cutoff for files loaded at launch, and documents separate per-file limits for on-demand instructions. Its glob brace-expansion budget is about matching patterns, not how much instruction text goes to the model. The old note’s 40,000-character diagnostic is not a universal ceiling on all five sources.

4. Memory and tasks persist, but serve different jobs

CLAUDE.md is where you put directions you want followed. Auto memory is where Claude can save useful discoveries and preferences. With auto memory enabled, the current implementation loads at startup up to the first 200 lines or 25 KB of MEMORY.md, whichever comes first. Topic files can hold more detail for later reads. Open /memory to inspect or edit what was saved, or to change whether auto memory is enabled. The old note also cataloged internal memory types and an experimental log format; those details aren’t necessary to maintain the index.

The interactive-mode guide describes a separate task checklist for multi-step work. Where the Task tools are available, a named list can be shared across sessions with CLAUDE_CODE_TASK_LIST_ID. This is explicit progress state, not a standing instruction loaded with CLAUDE.md and not the same as a background job. The distinction is useful: rules say how to work, memory records what was learned, and tasks show what remains.

5. AGENTS.md can now load directly

The old note was right about its own version, not about current releases. The memory guide documents direct AGENTS.md loading from Claude Code v2.1.277, subject to session support. By default it acts as a fallback when there are no applicable project or local CLAUDE.md files on the startup path. A user or managed CLAUDE.md does not turn off that fallback. The Project instructions setting in /config can tell supported sessions to load both file families.

For a project that must work with older Claude Code versions, importing @AGENTS.md from a project CLAUDE.md remains an explicit way to keep one source of shared instructions. Keep Claude-specific instructions in the importing file. Verify which files actually loaded instead of assuming every agent handles them the same way.

6. Back to the pnpm rule

At startup, Claude Code reads the applicable project instruction. When you ask to add Lodash, “use pnpm” is part of the context Claude has available. Asking for Axios on the next turn does not require rewriting the project context from scratch.

Changing the project-root file on disk is different. Don’t expect the copy already in context to be updated on the next message. Reload it through /compact, /clear, or a new session. As Part 4 covered, compaction carries a summary forward and reloads root instructions; nested and path-scoped instructions return on demand. If the rule must apply across the whole project, put it at the project root. If it applies to one subtree, don’t make every other task carry it.

Next: what a subagent inherits, and what stays in its own context.