Claude Code’s Five-Layer Setup Explained: What Each Layer Costs and Risks

Viral posts stack Claude Code into five layers: CLAUDE.md, skills, hooks, subagents and plugins. We read Anthropic's docs and put each layer's context cost, enforcement and risk in one table, with a guide to which layers your project actually needs.

Christopher Ort
By i10X News Desk · Reviewed by Christopher Ort · 5 min read
Share
A laptop next to a stack of five tinted transparent sheets on a developer's desk.
Image: AI-generated, i10X
On this page
  1. The five layers in one table
  2. Layer 1: CLAUDE.md, the always-on rules
  3. Layer 2: skills, cheap until used
  4. Layer 3: hooks, the only layer that is not a suggestion
  5. Layer 4: subagents, clean context at a price
  6. Layer 5: plugins, where the risk sits
  7. Which layers you actually need

Developers on X are sharing “five-layer” setups for Claude Code: a CLAUDE.md rules file at the bottom, then skills, hooks, subagents and plugins stacked on top, plus dozens of GitHub repositories that package all of it. The layers are real, and Anthropic documents each one in its Claude Code documentation. What the viral diagrams leave out is that every layer has a different price: some sit in Claude’s context window in every session, some only load when needed, and one of them runs code on your machine with your permissions. We went through Anthropic’s docs page by page and put the cost and the risk of each layer in one table, so you can decide which layers your project actually needs.

The five layers in one table

LayerWhere it livesWhen it loadsContext costEnforced?Watch out for
CLAUDE.md./CLAUDE.md or .claude/CLAUDE.md (project), ~/.claude/CLAUDE.md (you)Files above the working folder at launch, subfolder files on demandEvery line, every session; target under 200 linesNo, guidance the model can ignoreContradicting rules, imports that still load in full
SkillsSKILL.md folders, for example .claude/skills/Description always, full text only when usedLow: description capped at 1,536 characters, listing about 1% of the context windowNoToo many skills push descriptions out of the listing
Hooks~/.claude/settings.json or .claude/settings.jsonAt fixed events: session start, prompt, before and after tool callsNoneYes, a PreToolUse hook can block a tool callThey run commands on your machine automatically
Subagents~/.claude/agents/ or .claude/agents/Description always, the agent runs in its own context when calledDescription in main context; work happens in a separate windowPartly, via tool limits per agentExtra requests count toward the same usage limits
PluginsInstalled from a marketplace (manifest in .claude-plugin/plugin.json)Their skills, agents, hooks and MCP servers load while enabledSum of what they containWhatever hooks they shipCan run code with your user privileges

Sources: Anthropic Claude Code documentation (memory, skills, hooks, subagents, plugins), read November 30, 2026. Compilation: i10x.

Layer 1: CLAUDE.md, the always-on rules

CLAUDE.md is the project’s standing brief: build commands, coding standards, naming rules. Claude Code loads the files above your working directory at launch, so every line is paid for in every session. Anthropic’s guidance is to stay under 200 lines per file, because longer files consume more context and, in Anthropic’s words, “reduce adherence”. Splitting a long file with @imports does not help, since imported files load together with the file that imports them. What does help is moving rules that apply only to part of the codebase into .claude/rules/ with a path scope, which loads them only when Claude touches matching files.

One more trap: if two rules contradict each other, Claude may pick one arbitrarily. We have reported before how stale CLAUDE.md files override the actual code. Run /context all to see which memory files really loaded.

Layer 2: skills, cheap until used

Skills are folders with a SKILL.md file. Only the name and description sit in context; the full instructions load when Claude decides the skill fits or you call it. That makes skills the cheapest place for long procedures. Two limits matter: each description is cut at 1,536 characters in the listing, and the whole listing gets a budget of about 1% of the model’s context window. When you install too many skills, Claude Code drops the descriptions of the ones you use least, which removes the keywords Claude needs to pick them, and it only notes this in the debug log. /doctor shows what the listing costs.

Layer 3: hooks, the only layer that is not a suggestion

Everything in CLAUDE.md and skills is text the model can ignore. Hooks are not. They are shell commands, HTTP calls or prompts that Claude Code itself runs at fixed points: when a session starts, when you submit a prompt, before and after every tool call. A PreToolUse hook can block a tool call outright, Anthropic’s example blocks rm -rf. So the rule of thumb is simple: if breaking a rule would be expensive, enforce it with a hook, not a sentence. Hooks live in ~/.claude/settings.json for you, or in .claude/settings.json for the whole team, and they cost no context.

Layer 4: subagents, clean context at a price

A subagent is a worker with its own context window, its own system prompt and its own tool permissions. It does the noisy work, such as searching a large codebase or reading logs, and hands back only a summary, which keeps your main conversation clean. But its requests count toward the same usage limits, and its description sits in context like a skill’s (Claude Code warns once your custom descriptions pass 15,000 tokens). A recent study we covered found that parallel coding subagents add 1 to 5 points at up to 3.8 times the cost. Use them for isolation, not as a default.

Layer 5: plugins, where the risk sits

A plugin is a bundle of the other layers (skills, subagents, hooks, MCP servers) installed as one unit from a marketplace. That is convenient, and it is also the layer to be careful with. Anthropic’s plugin overview is blunt: whatever the marketplace tier, “a plugin you install can run code with your user privileges”. And a plugin enabled at project scope is switched on for everyone who clones the repository and installs it.

Anthropic separates official marketplaces (such as claude-plugins-official), community ones and everything else, which counts as third-party, including the roughly 25 repositories currently making the rounds on X. Read the hooks file of any third-party plugin before you install it.

Which layers you actually need

  • Solo project, small codebase: a short CLAUDE.md is enough. Add a hook if there is one thing Claude must never do.
  • Team repository: CLAUDE.md under 200 lines, path-scoped rules for subfolders, team hooks for tests and formatting in .claude/settings.json.
  • Repeated long procedures (release, migration, review checklist): turn them into skills instead of growing CLAUDE.md.
  • Large codebases or log-heavy work: one or two subagents for search and analysis, with read-only tools.
  • Plugins: only from official marketplaces, or after reading the code. Prefer user or local scope until the team agrees.

What is still open: Anthropic changes these limits often (even the way /context counts skills changed in a recent version), so check /doctor and /context after updates rather than trusting a diagram from last month.

Christopher Ort

Christopher Ort

Christopher Ort is the editor of i10X News at i10x.ai. He has worked hands-on with AI tools, models and agent workflows for years and leads i10X’s coverage of AI launches, funding and research. He is the author of “The Style Penalty”, an SSRN study on how frontier AI models judge AI-written CVs, covered by heise online and t3n.

Timeline

What happened before

  1. Release

    Claude Haiku 5.5

    1M context · $0.1 / $0.5 per 1M tokens

    support.claude.com (source, opens in a new tab)
  2. Release

    Claude Sonnet 5.5

    1M context · $2 / $10 per 1M tokens

    support.claude.com (source, opens in a new tab)
  3. Release

    Claude Opus 5.5

    1M context · $4 / $20 per 1M tokens

    First model of the Claude 5.5 family; performs at the level of Claude Fable 5.1 on most work and costs 40% less to run than Opus 5.

    anthropic.com (source, opens in a new tab)
  4. Release

    Claude Fable 5.1 & Mythos 5.1

    1M context · $10 / $50 per 1M tokens

    Anthropic's most advanced models for coding and knowledge work. Price/context shown for Claude Fable 5.1 (models overview).

    support.claude.com (source, opens in a new tab)
  5. Release

    Claude Opus 5

    1M context · $5 / $25 per 1M tokens

    support.claude.com (source, opens in a new tab)
Full Claude timeline ›

Editor's picks

  1. China Adds Export Licenses for Legged Robots: Which Robot Dogs Qualify From Dec 29
  2. Nuvacore Raises $200M+ at $2.2B for an AI Data Center CPU It Has Not Built Yet
  3. EU Industrial AI Blueprint: What Snabe’s Report Would Change for Companies
  4. AWS Quick Docs, Sheets and Slides Are Included, but Agent Hours Are Metered
  5. Qwen-Audio-3.1-Live: Alibaba’s Voice Agent Model Bills Every Second, Even Silence