Lv.1 0 XP

D3 + D4: Prompt Layering Strategy — What Goes Where

Core 7 min +40 XP
💡
THE ANALOGY

A law firm's instruction hierarchy. The law firm's style guide (CLAUDE.md) applies to all attorneys. A partner's standing instructions (user-level CLAUDE.md) apply to their team. A case brief (session system prompt) applies to this case. A specific question in a meeting (user message) applies right now. Each layer is right for different types of instructions.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Putting task-specific instructions in CLAUDE.md or putting team conventions in the session prompt. The exam tests that you know which instruction types belong at which layer.

KEY POINTS
1 User-level CLAUDE.md: personal preferences, machine-specific config — never committed to git.
2 Project-level CLAUDE.md: team conventions, architecture rules, testing standards — committed, shared.
3 Session system prompt: task-specific context, what this agent does, what tools it has — set at runtime.
4 Path-specific rules: file-type conventions — conditional, fine-grained.
5 Never duplicate: if a rule is in CLAUDE.md, don't repeat it in the session prompt — maintain one source of truth.