An instruction hierarchy organizes persistent agent instructions by scope and priority, shaping the context loaded for a session. It sits at the boundary between memory and perception: stored instructions influence what the agent sees in its current cycle. section 3.1.3
Priority describes position and intent; it is not enforcement. A lower-level rule can contradict a higher-level rule, and the model may see both. Controls that must be enforced need a separate mechanism. section 3.1.3
Table 3.2 Claude Code's five-level configured instruction hierarchy
|
Level
|
Source
|
Scope
|
Loading strategy
|
|
Enterprise
|
Enterprise CLAUDE.md
|
Organization-wide
|
Always loaded (P0)
|
|
User
|
~/.claude/CLAUDE.md
|
Personal
|
Always loaded
|
|
Project
|
./CLAUDE.md
|
Team-shared
|
Always loaded
|
|
Rules
|
.claude/rules/*.md
|
Modular
|
Loaded at launch, or on demand for path-scoped rules
|
|
Local
|
./CLAUDE.local.md
|
Individual, not committed
|
Loaded with project instructions
|
Compare the five configured Claude Code instruction levels by scope and loading strategy. Rules may load at launch or on demand when path-scoped. section 3.1.3
The hierarchy can implement context triage: enterprise instructions carry security rules, while user instructions carry personal preferences. Triage also covers information outside the configured hierarchy, including the current task, tool results, error traces, and on-demand files. section 3.2.3
Table 3.3 Claude Code's triage implementation
|
Triage tier
|
Claude Code implementation
|
Why this priority
|
|
P0
|
Enterprise CLAUDE.md + system prompt
|
Security policies: never optional
|
|
P0
|
User's current message + selected code
|
The task itself
|
|
P1
|
Project CLAUDE.md + active rules
|
Team conventions: the review is wrong without them
|
|
P1
|
Most recent tool results, error traces
|
Current state of the world
|
|
P2
|
Earlier conversation history
|
Background: useful but summarizable
|
|
P2
|
User CLAUDE.md (personal preferences)
|
Nice to have, not critical
|
|
P3
|
Repository files, documentation, web
|
Load on demand via Read, Grep, Glob
|
See how triage priorities distinguish essential policies and task information from summarizable history and on-demand content. section 3.2.3
Protect failure evidence while a decision is active if losing it could cause the agent to repeat a failed or unsafe action. The system designer defines that protected class and its release condition; the agent may promote additional evidence but should not silently demote it. section 3.2.3
Other loading mechanisms complement the hierarchy. An auto-memory index loads selected content at session start, with detailed files available on demand. Skills expose a listing first and load full instructions when used. Sub-agents normally receive project memory but not the parent’s conversation history or accumulated tool results; built-in Explore and Plan agents skip project memory for speed. section 3.1.3
