---
id: "concept-five-layer-hierarchy"
type: "concept"
source_timestamps: ["§3.2"]
tags: ["context-engineering", "architecture", "token-budget"]
related: ["concept-icm", "concept-stage-contracts", "concept-context-scoping", "claim-token-efficiency"]
definition: "ICM's context model: Layer 0 global identity, Layer 1 workspace routing, Layer 2 stage contract (structural); Layer 3 reference material, Layer 4 working artifacts (content)."
sources: ["paper"]
sourceVaultSlug: "icm-paper-folder-architecture-2026Jun02"
originDay: 2
---
# The Five-Layer Context Hierarchy

## The five layers

Context is delivered in five tiers, each with a token budget and a diagnostic question.

| Layer | File | Question | Budget |
|---|---|---|---|
| **L0** | `CLAUDE.md` | *Where am I?* | ~800 tokens |
| **L1** | `CONTEXT.md` (root) | *Where do I go?* | ~300 tokens |
| **L2** | `CONTEXT.md` (stage) | *What do I do?* | 200–500 tokens |
| **L3** | `references/` | *What rules apply?* | 500–2k tokens |
| **L4** | `output/` | *What am I working with?* | per-run |

- **Layers 0–2 are structural/routing** (~1.5k tokens total).
- **Layers 3–4 are content**: L3 is the *factory* (stable recipe), L4 is the *product* (ingredients of this run).

## Why the split matters

The distinction (Table 2 in [[entity-icm-paper]]) tells the agent how to treat each file:
- **Layer 3** as constraints to internalize.
- **Layer 4** as input to process.

Most of a well-scoped stage's context is task-relevant, which is why a stage lands at 2–8k tokens rather than 40k — see [[claim-token-efficiency]]. Separating these is the implementation discipline captured in [[action-separate-l3-l4]].

## Validation status

The partitioning into *global info + task contract + references + current artifacts* aligns with current prompt-architecture best practices and with Liu et al.'s "Lost in the Middle" — see [[prereq-llm-context-windows]]. However, the specific token counts are *representative*, not from a controlled A/B test, as the authors acknowledge. Whether the hierarchy holds across non-Claude models is the subject of [[question-cross-model]].

## On-disk realization

The layers are mapped onto folders by [[framework-icm-architecture]]; the resulting routing-vs-content split is what enables [[concept-context-scoping]].


## Related across days
- [[concept-icm-d1]]
- [[framework-icm-architecture]]
- [[synthesis-five-layer-fills-the-gap]]
- [[action-separate-l3-l4]]
