Everything Claude Code loads,
and what wins when they disagree.
Claude Code's configuration is not one system. It is seven independent subsystems that happen to share a .claude/ directory, with different file formats, different discovery rules, and sometimes opposite precedence rules. This is the map.
$ claude # session start, in order settings managed → cli → local → project → user override agents managed → cli → project → user → plugin shadow skills enterprise → personal → project shadow, reversed memory /etc → ~ → /work → ./ → ./local additive, nobody wins rules unscoped now, paths: globs on demand additive hooks every matching hook, every source all of them run # when something looks wrong > /context
Prose, config, and code
Every mechanism falls into one of three families, and the family decides what happens when two pieces of configuration disagree.
CLAUDE.md · rules · skills · output styles
Text concatenated into the prompt. Conflicts resolved by the model, non-deterministically.
settings.json · agent frontmatter · permissions
Structured values. Conflicts resolved by a defined precedence order.
hooks
Shell commands that run and can block. Not a conflict at all: it fires or it does not.
If something absolutely must happen every time, it belongs in a hook, not in CLAUDE.md.
Not every layer costs the same
CLAUDE.md is the most expensive place to put anything, because it is paid for on every single turn whether relevant or not. This table is the reason "put everything in CLAUDE.md" stops working at scale.
See the full breakdown →- CLAUDE.mdFull text, every turn
- Rule without paths:Full text, every turn
- Rule with paths:Zero until a matching file is touched
- SkillOne description line
- Skill, model-invocation offZero
- SubagentOne description line; work runs elsewhere
- HookZero, it runs outside the model
Sixteen sections
Read it in order the first time. After that, the two pages you will come back to areconflicting rules andrecipes.
Foundations
The mental model
Seven subsystems sharing one directory. Prose is a request, config is a rule, hooks are enforcement.
What loads at session start
The exact boot sequence, what loads lazily, and the three commands that show you the truth.
Memory files
The CLAUDE.md family: four scopes, discovery order, imports, size discipline, and exclusion.
Rules
Path-scoped instructions that cost nothing until Claude touches a matching file.
Settings and env
The one subsystem with real precedence, and the env block that wires up your toolchain.
Extending
Skills
Progressive disclosure, dynamic context injection, and why a 400-line reference can be free.
Agents, subagents and forks
Separate context windows. One definition, three placements, and when each one earns its keep.
Plugins
The box that holds skills, agents, hooks and MCP servers, with collision-proof namespacing.
Output styles
Changing how Claude communicates, and the one frontmatter field that silently breaks it.
Hooks
The enforcement layer. Shell commands that fire outside the model and can block a tool call.
Resolving
In practice
Worked example: a polyglot repository
A complete configuration for a monorepo with Java, Go, Python and TypeScript.
Recipes
Twelve worked setups: incident triage, migration guards, review agents, monorepo scoping and more.
Gotchas and anti-patterns
The failure modes that cost the most time, grouped by the subsystem that causes them.
Cheat sheet
File map, commands, flags, and the five things worth committing to memory.
The five things worth memorising
- 01
Memory files are additive, not hierarchical. Contradictions are resolved by the model, unpredictably. Remove them rather than ranking them.
Read why → - 02
Skills: personal beats project. Agents: project beats personal. Opposite directions, no mnemonic.
Read why → - 03
CLAUDE.md is the most expensive place to put anything. Path-scoped rules and skills are nearly free until used.
Read why → - 04
Prose is a request; config is a rule; hooks are enforcement. Match the mechanism to how badly you need it to hold.
Read why → - 05
/context before theorising. Most "Claude ignored my instruction" reports are "the instruction was never loaded".
Read why →