from line 68
6868
6969Some features can seem similar. For a deeper walkthrough of choosing between them, see [Steering Claude Code: when to use CLAUDE.md, skills, hooks, and subagents](https://claude.com/blog/steering-claude-code-skills-hooks-rules-subagents-and-more) on the blog. Here's how to tell them apart.
7070
71**Skill vs Subagent**
71> [tab] Skill vs Subagent
72>
73> Skills and subagents solve different problems:
74>
75> * **Skills** are reusable content you can load into any context
76> * **Subagents** are isolated workers that run separately from your main conversation
77>
78> | Aspect | Skill | Subagent |
79> | - | - | - |
80> | **What it is** | Reusable instructions, knowledge, or workflows | Isolated worker with its own context |
81> | **Key benefit** | Share content across contexts | Context isolation. Work happens separately, only summary returns |
82> | **[Context window](https://code.claude.com/docs/en/context-window.md) impact** | Adds to your main window | Uses a separate window with its own input and output tokens |
83> | **Best for** | Reference material, invocable workflows | Tasks that read many files, parallel work, specialized workers |
84>
85> **Skills can be reference or action.** Reference skills provide knowledge Claude uses throughout your session (like your API style guide). Action skills tell Claude to do something specific (like `/deploy` that runs your deployment workflow).
86>
87> **Use a subagent** when you need context isolation or when your context window is getting full. The subagent might read dozens of files or run extensive searches, but your main conversation only receives a summary. Since subagent work doesn't consume your main context, this is also useful when you don't need the intermediate work to remain visible. Custom subagents can have their own instructions and can preload skills.
88>
89> **They can combine.** A subagent can preload specific skills (`skills:` field). A skill can run in isolated context using `context: fork`. See [Skills](https://code.claude.com/docs/en/skills.md) for details.
7290
73Skills and subagents solve different problems:
91> [tab] CLAUDE.md vs Skill
92>
93> Both store instructions, but they load differently and serve different purposes.
94>
95> | Aspect | CLAUDE.md | Skill |
96> | - | - | - |
97> | **Loads** | Every session, automatically | On demand |
98> | **Can include files** | Yes, with `@path` imports | Yes, with `@path` imports |
99> | **Can trigger workflows** | No | Yes, with `/<name>` |
100> | **Best for** | "Always do X" rules | Reference material, invocable workflows |
101>
102> **Put it in CLAUDE.md** if Claude should always know it: coding conventions, build commands, project structure, "never do X" rules.
103>
104> **Put it in a skill** if it's reference material Claude needs sometimes (API docs, style guides) or a workflow you trigger with `/<name>` (deploy, review, release).
105>
106> **Rule of thumb:** Keep CLAUDE.md under 200 lines. If it's growing, move reference content to skills or split into [`.claude/rules/`](https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/) files.
74107
75* **Skills** are reusable content you can load into any context
76* **Subagents** are isolated workers that run separately from your main conversation
108> [tab] CLAUDE.md vs Output style
109>
110> Both give Claude standing instructions. CLAUDE.md carries what Claude should know, and an output style sets how Claude responds.
111>
112> | Aspect | CLAUDE.md | Output style |
113> | - | - | - |
114> | **Holds** | Facts and rules about your project | A role, tone, and response format |
115> | **Switching** | Always loaded | One active at a time; [switch styles](https://code.claude.com/docs/en/output-styles.md#change-your-output-style) whenever you want |
116> | **Best for** | Build commands, conventions, "never do X" rules | Shorter responses, explanations alongside code, a non-engineering role |
117>
118> **Put it in CLAUDE.md** if it's true of the project whatever style you're in: coding conventions, build commands, project structure.
119>
120> **Use an output style** if it's about the response itself and you might want it off again: length, format, how much Claude explains, or a different role such as a writing assistant. Claude Code includes [built-in styles](https://code.claude.com/docs/en/output-styles.md#built-in-output-styles), and you can write your own.
121>
122> **They combine.** CLAUDE.md stays loaded whichever style you pick. Claude follows both as instructions, so neither is enforced. For anything that has to happen every time, use a [hook](https://code.claude.com/docs/en/hooks-guide.md).
77123
78| Aspect | Skill | Subagent |
79| - | - | - |
80| **What it is** | Reusable instructions, knowledge, or workflows | Isolated worker with its own context |
81| **Key benefit** | Share content across contexts | Context isolation. Work happens separately, only summary returns |
82| **[Context window](https://code.claude.com/docs/en/context-window.md) impact** | Adds to your main window | Uses a separate window with its own input and output tokens |
83| **Best for** | Reference material, invocable workflows | Tasks that read many files, parallel work, specialized workers |
124> [tab] CLAUDE.md vs Rules vs Skills
125>
126> All three store instructions, but they load differently:
127>
128> | Aspect | CLAUDE.md | `.claude/rules/` | Skill |
129> | - | - | - | - |
130> | **Loads** | Every session | Every session, or when matching files are opened | On demand, when invoked or relevant |
131> | **Scope** | Whole project | Can be scoped to file paths | Task-specific |
132> | **Best for** | Core conventions and build commands | Language-specific or directory-specific guidelines | Reference material, repeatable workflows |
133>
134> **Use CLAUDE.md** for instructions every session needs: build commands, test conventions, project architecture.
135>
136> **Use rules** to keep CLAUDE.md focused. Rules with [`paths` frontmatter](https://code.claude.com/docs/en/memory#path-specific-rules) only load when Claude works with matching files, saving context.
137>
138> **Use skills** for content Claude only needs sometimes, like API documentation or a deployment checklist you trigger with `/<name>`.
84139
85**Skills can be reference or action.** Reference skills provide knowledge Claude uses throughout your session (like your API style guide). Action skills tell Claude to do something specific (like `/deploy` that runs your deployment workflow).
140> [tab] Subagent vs Dynamic workflow
141>
142> Both do work outside your main conversation. With subagents, Claude decides turn by turn what runs next. In a workflow, the script decides:
143>
144> * **Subagents** are workers Claude spawns, each returning a summary to the conversation that spawned it
145> * **[Dynamic workflows](https://code.claude.com/docs/en/workflows.md)** are scripts Claude writes that run many subagents in the background and return one result
146>
147> **Use a subagent** when you need a quick, focused worker: research a question, verify a claim, review a file. The subagent does the work and returns a summary, so your main conversation stays clean. Subagents that Claude [named](https://code.claude.com/docs/en/sub-agents.md#subagent-names) when it spawned them can also [message each other](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup).
148>
149> **Use a dynamic workflow** when a job [outgrows a handful of subagents](https://code.claude.com/docs/en/workflows.md#when-to-use-a-workflow), or when you want the findings cross-checked before you see them, such as a codebase-wide audit, a large migration, or a plan drafted from several angles. To start one, [ask for a workflow in your prompt](https://code.claude.com/docs/en/workflows.md#ask-for-a-workflow-in-your-prompt).
150>
151> **To pass a finding from one of your sessions to another**, ask the first session's Claude to send it. Claude delivers it with [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md). [Run agents in parallel](https://code.claude.com/docs/en/agents.md) compares the other ways to run more than one Claude at once, including sessions you hand off and check back on later.
86152
87**Use a subagent** when you need context isolation or when your context window is getting full. The subagent might read dozens of files or run extensive searches, but your main conversation only receives a summary. Since subagent work doesn't consume your main context, this is also useful when you don't need the intermediate work to remain visible. Custom subagents can have their own instructions and can preload skills.
153> [tab] MCP vs Skill
154>
155> MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.
156>
157> | Aspect | MCP | Skill |
158> | - | - | - |
159> | **What it is** | Protocol for connecting to external services | Knowledge, workflows, and reference material |
160> | **Provides** | Tools and data access | Knowledge, workflows, reference material |
161> | **Examples** | Slack integration, database queries, browser control | Code review checklist, deploy workflow, API style guide |
162>
163> These solve different problems and work well together:
164>
165> **MCP** gives Claude purpose-built tools for an external system, with the connection and authentication handled by the server.
166>
167> **Skills** give Claude knowledge about how to use those tools effectively, plus workflows you can trigger with `/<name>`. A skill might include your team's database schema and query patterns, or a `/post-to-slack` workflow with your team's message formatting rules.
88168
89**They can combine.** A subagent can preload specific skills (`skills:` field). A skill can run in isolated context using `context: fork`. See [Skills](https://code.claude.com/docs/en/skills.md) for details.
169> [tab] Hook vs Skill
170>
171> Claude Code runs a hook at a lifecycle event; it loads a skill into context for Claude to apply.
172>
173> | Aspect | Hook | Skill |
174> | - | - | - |
175> | **Runs** | A shell command, HTTP request, MCP tool call, LLM prompt, or subagent | Instructions Claude reads and follows |
176> | **Triggered by** | [Lifecycle events](https://code.claude.com/docs/en/hooks.md#hook-events) such as `PostToolUse` or `SessionStart` | You typing `/<name>`, or Claude matching the description to your task |
177> | **Determinism** | Fires on its event without Claude deciding | Claude interprets the instructions; outcome can vary |
178> | **Context cost** | Zero unless the hook returns output | Description loads each session; full content loads when used |
179> | **Best for** | Linting after edits, blocking unsafe commands, logging, notifications | Workflows that need reasoning, reference material, multi-step tasks |
180>
181> **Use a hook** when the action must happen the same way every time and doesn't need Claude to think. For example: format on save, reject `rm -rf /`, post a Slack message when a session ends.
182>
183> **Use a skill** when Claude should decide how to apply the steps, or when the content is knowledge rather than a script. For example: a `/release` checklist, your API style guide, a debugging playbook.
184>
185> **Put guardrails in hooks.** An instruction like "never edit `.env`" in CLAUDE.md or a skill is a request, not a guarantee. A `PreToolUse` hook that blocks the edit is enforcement. If a rule must hold every time, make it a hook rather than a prompt instruction.
186>
187> **Hook output lands in context.** A `PostToolUse` hook that runs your linter feeds results back as text Claude reads; a `/fix-lint` skill tells Claude how to resolve them.
90188
91**CLAUDE.md vs Skill**
92
93Both store instructions, but they load differently and serve different purposes.
94
95| Aspect | CLAUDE.md | Skill |
96| - | - | - |
97| **Loads** | Every session, automatically | On demand |
98| **Can include files** | Yes, with `@path` imports | Yes, with `@path` imports |
99| **Can trigger workflows** | No | Yes, with `/<name>` |
100| **Best for** | "Always do X" rules | Reference material, invocable workflows |
101
102**Put it in CLAUDE.md** if Claude should always know it: coding conventions, build commands, project structure, "never do X" rules.
103
104**Put it in a skill** if it's reference material Claude needs sometimes (API docs, style guides) or a workflow you trigger with `/<name>` (deploy, review, release).
105
106**Rule of thumb:** Keep CLAUDE.md under 200 lines. If it's growing, move reference content to skills or split into [`.claude/rules/`](https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/) files.
107
108**CLAUDE.md vs Output style**
109
110Both give Claude standing instructions. CLAUDE.md carries what Claude should know, and an output style sets how Claude responds.
111
112| Aspect | CLAUDE.md | Output style |
113| - | - | - |
114| **Holds** | Facts and rules about your project | A role, tone, and response format |
115| **Switching** | Always loaded | One active at a time; [switch styles](https://code.claude.com/docs/en/output-styles.md#change-your-output-style) whenever you want |
116| **Best for** | Build commands, conventions, "never do X" rules | Shorter responses, explanations alongside code, a non-engineering role |
117
118**Put it in CLAUDE.md** if it's true of the project whatever style you're in: coding conventions, build commands, project structure.
119
120**Use an output style** if it's about the response itself and you might want it off again: length, format, how much Claude explains, or a different role such as a writing assistant. Claude Code includes [built-in styles](https://code.claude.com/docs/en/output-styles.md#built-in-output-styles), and you can write your own.
121
122**They combine.** CLAUDE.md stays loaded whichever style you pick. Claude follows both as instructions, so neither is enforced. For anything that has to happen every time, use a [hook](https://code.claude.com/docs/en/hooks-guide.md).
123
124**CLAUDE.md vs Rules vs Skills**
125
126All three store instructions, but they load differently:
127
128| Aspect | CLAUDE.md | `.claude/rules/` | Skill |
129| - | - | - | - |
130| **Loads** | Every session | Every session, or when matching files are opened | On demand, when invoked or relevant |
131| **Scope** | Whole project | Can be scoped to file paths | Task-specific |
132| **Best for** | Core conventions and build commands | Language-specific or directory-specific guidelines | Reference material, repeatable workflows |
133
134**Use CLAUDE.md** for instructions every session needs: build commands, test conventions, project architecture.
135
136**Use rules** to keep CLAUDE.md focused. Rules with [`paths` frontmatter](https://code.claude.com/docs/en/memory#path-specific-rules) only load when Claude works with matching files, saving context.
137
138**Use skills** for content Claude only needs sometimes, like API documentation or a deployment checklist you trigger with `/<name>`.
139
140**Subagent vs Dynamic workflow**
141
142Both do work outside your main conversation. With subagents, Claude decides turn by turn what runs next. In a workflow, the script decides:
143
144* **Subagents** are workers Claude spawns, each returning a summary to the conversation that spawned it
145* **[Dynamic workflows](https://code.claude.com/docs/en/workflows.md)** are scripts Claude writes that run many subagents in the background and return one result
146
147**Use a subagent** when you need a quick, focused worker: research a question, verify a claim, review a file. The subagent does the work and returns a summary, so your main conversation stays clean. Subagents that Claude [named](https://code.claude.com/docs/en/sub-agents.md#subagent-names) when it spawned them can also [message each other](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup).
148
149**Use a dynamic workflow** when a job [outgrows a handful of subagents](https://code.claude.com/docs/en/workflows.md#when-to-use-a-workflow), or when you want the findings cross-checked before you see them, such as a codebase-wide audit, a large migration, or a plan drafted from several angles. To start one, [ask for a workflow in your prompt](https://code.claude.com/docs/en/workflows.md#ask-for-a-workflow-in-your-prompt).
150
151**To pass a finding from one of your sessions to another**, ask the first session's Claude to send it. Claude delivers it with [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md). [Run agents in parallel](https://code.claude.com/docs/en/agents.md) compares the other ways to run more than one Claude at once, including sessions you hand off and check back on later.
152
153**MCP vs Skill**
154
155MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.
156
157| Aspect | MCP | Skill |
158| - | - | - |
159| **What it is** | Protocol for connecting to external services | Knowledge, workflows, and reference material |
160| **Provides** | Tools and data access | Knowledge, workflows, reference material |
161| **Examples** | Slack integration, database queries, browser control | Code review checklist, deploy workflow, API style guide |
162
163These solve different problems and work well together:
164
165**MCP** gives Claude purpose-built tools for an external system, with the connection and authentication handled by the server.
166
167**Skills** give Claude knowledge about how to use those tools effectively, plus workflows you can trigger with `/<name>`. A skill might include your team's database schema and query patterns, or a `/post-to-slack` workflow with your team's message formatting rules.
168
169**Hook vs Skill**
170
171Claude Code runs a hook at a lifecycle event; it loads a skill into context for Claude to apply.
172
173| Aspect | Hook | Skill |
174| - | - | - |
175| **Runs** | A shell command, HTTP request, MCP tool call, LLM prompt, or subagent | Instructions Claude reads and follows |
176| **Triggered by** | [Lifecycle events](https://code.claude.com/docs/en/hooks.md#hook-events) such as `PostToolUse` or `SessionStart` | You typing `/<name>`, or Claude matching the description to your task |
177| **Determinism** | Fires on its event without Claude deciding | Claude interprets the instructions; outcome can vary |
178| **Context cost** | Zero unless the hook returns output | Description loads each session; full content loads when used |
179| **Best for** | Linting after edits, blocking unsafe commands, logging, notifications | Workflows that need reasoning, reference material, multi-step tasks |
180
181**Use a hook** when the action must happen the same way every time and doesn't need Claude to think. For example: format on save, reject `rm -rf /`, post a Slack message when a session ends.
182
183**Use a skill** when Claude should decide how to apply the steps, or when the content is knowledge rather than a script. For example: a `/release` checklist, your API style guide, a debugging playbook.
184
185**Put guardrails in hooks.** An instruction like "never edit `.env`" in CLAUDE.md or a skill is a request, not a guarantee. A `PreToolUse` hook that blocks the edit is enforcement. If a rule must hold every time, make it a hook rather than a prompt instruction.
186
187**Hook output lands in context.** A `PostToolUse` hook that runs your linter feeds results back as text Claude reads; a `/fix-lint` skill tells Claude how to resolve them.
188
189189### Understand how features layer
190190
191191Features can be defined at multiple levels: user-wide, per-project, via plugins, or through managed policies. You can also nest CLAUDE.md files in subdirectories or place skills in specific packages of a monorepo. When the same feature exists at multiple levels, here's how they layer:
from line 234
234234
235235
236236
237**CLAUDE.md**
238
239**When:** Session start
240
241**What loads:** Full content of each CLAUDE.md file that loads at session start (managed, user, and project levels).
242
243**Inheritance:** Claude reads CLAUDE.md files from your working directory up to the root, and discovers nested ones in subdirectories as it accesses those files. See [How CLAUDE.md files load](https://code.claude.com/docs/en/memory.md#how-claude-md-files-load) for details. If a nested CLAUDE.md is over its [per-file size limit](https://code.claude.com/docs/en/memory.md#claude-ignores-the-end-of-my-subdirectory-claude-md), Claude receives only the start of the file.
244
245> [!TIP]
237> [tab] CLAUDE.md
246238>
247> Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on demand. To get [trim proposals for a checked-in CLAUDE.md](https://code.claude.com/docs/en/memory.md#my-claude-md-is-too-large), run `/doctor`.
239> **When:** Session start
240>
241> **What loads:** Full content of each CLAUDE.md file that loads at session start (managed, user, and project levels).
242>
243> **Inheritance:** Claude reads CLAUDE.md files from your working directory up to the root, and discovers nested ones in subdirectories as it accesses those files. See [How CLAUDE.md files load](https://code.claude.com/docs/en/memory.md#how-claude-md-files-load) for details. If a nested CLAUDE.md is over its [per-file size limit](https://code.claude.com/docs/en/memory.md#claude-ignores-the-end-of-my-subdirectory-claude-md), Claude receives only the start of the file.
244>
245> > [!TIP]
246> >
247> > Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on demand. To get [trim proposals for a checked-in CLAUDE.md](https://code.claude.com/docs/en/memory.md#my-claude-md-is-too-large), run `/doctor`.
248248
249**Skills**
250
251Skills are extra capabilities in Claude's toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](https://code.claude.com/docs/en/commands.md) like `/code-review`, `/batch`, and `/debug` that work without setup. You can also create your own.
252
253**When:** Depends on the skill's configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.
254
255**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.
256
257**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`.
258
259**Context cost:** Low until used. User-only skills have zero cost until invoked.
260
261**In subagents:** The full content of skills listed in a subagent's `skills` field [loads into its context at launch](https://code.claude.com/docs/en/sub-agents.md#preload-skills-into-subagents), rather than on demand. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool.
262
263> [!TIP]
249> [tab] Skills
264250>
265> Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures they run only when you name them.
251> Skills are extra capabilities in Claude's toolkit. They can be reference material (like an API style guide) or invocable workflows you trigger with `/<name>` (like `/deploy`). Claude Code includes [bundled skills](https://code.claude.com/docs/en/commands.md) like `/code-review`, `/batch`, and `/debug` that work without setup. You can also create your own.
252>
253> **When:** Depends on the skill's configuration. By default, descriptions load at session start and full content loads when used. For user-only skills (`disable-model-invocation: true`), nothing loads until you invoke them.
254>
255> **What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.
256>
257> **How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`.
258>
259> **Context cost:** Low until used. User-only skills have zero cost until invoked.
260>
261> **In subagents:** The full content of skills listed in a subagent's `skills` field [loads into its context at launch](https://code.claude.com/docs/en/sub-agents.md#preload-skills-into-subagents), rather than on demand. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool.
262>
263> > [!TIP]
264> >
265> > Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures they run only when you name them.
266266
267**MCP servers**
268
269**When:** Session start.
270
271**What loads:** Tool names and server instructions from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.
272
273**Context cost:** [Tool search](https://code.claude.com/docs/en/mcp.md#scale-with-mcp-tool-search) is on by default, so idle MCP tools consume minimal context.
274
275> [!TIP]
267> [tab] MCP servers
276268>
277> Run `/mcp` to see each server's connection status. Run `/context all` to see how many tokens each loaded MCP tool uses. Claude Code [reconnects to remote servers automatically](https://code.claude.com/docs/en/mcp.md#automatic-reconnection) if they drop, and you can disconnect servers you're not actively using.
269> **When:** Session start.
270>
271> **What loads:** Tool names and server instructions from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.
272>
273> **Context cost:** [Tool search](https://code.claude.com/docs/en/mcp.md#scale-with-mcp-tool-search) is on by default, so idle MCP tools consume minimal context.
274>
275> > [!TIP]
276> >
277> > Run `/mcp` to see each server's connection status. Run `/context all` to see how many tokens each loaded MCP tool uses. Claude Code [reconnects to remote servers automatically](https://code.claude.com/docs/en/mcp.md#automatic-reconnection) if they drop, and you can disconnect servers you're not actively using.
278278
279**Code intelligence**
280
281**When:** After file edits, and on demand when Claude navigates code.
282
283**What loads:** Type errors and warnings after each file edit. Definition, reference, and type information when Claude looks up a symbol.
284
285**Context cost:** Low. Symbol lookups often replace broad file reads, so net context use can go down.
286
287> [!TIP]
279> [tab] Code intelligence
288280>
289> The LSP tool is inactive until you install a [code intelligence plugin](https://code.claude.com/docs/en/plugins/code-intelligence.md) for your language.
281> **When:** After file edits, and on demand when Claude navigates code.
282>
283> **What loads:** Type errors and warnings after each file edit. Definition, reference, and type information when Claude looks up a symbol.
284>
285> **Context cost:** Low. Symbol lookups often replace broad file reads, so net context use can go down.
286>
287> > [!TIP]
288> >
289> > The LSP tool is inactive until you install a [code intelligence plugin](https://code.claude.com/docs/en/plugins/code-intelligence.md) for your language.
290290
291**Subagents**
292
293**When:** On demand, when you or Claude spawns one for a task.
294
295**What loads:** Fresh, isolated context containing:
296
297* The agent's own system prompt, not the Claude Code system prompt
298* Full content of skills listed in the agent's `skills:` field
299* CLAUDE.md and git status. The built-in Explore and Plan agents [start with neither](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup), and an agent whose definition sets [`omitClaudeMd`](https://code.claude.com/docs/en/sub-agents#supported-frontmatter-fields) starts without the user, project, and local CLAUDE.md files.
300* Whatever context the lead agent passes in the prompt
301
302For a [fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), Claude Code loads the parent's conversation so far, system prompt, and tools instead.
303
304**Context cost:** Isolated from main session.
305
306> [!TIP]
291> [tab] Subagents
307292>
308> Use subagents for work that doesn't need your full conversation context. Their isolation prevents bloating your main session.
293> **When:** On demand, when you or Claude spawns one for a task.
294>
295> **What loads:** Fresh, isolated context containing:
296>
297> * The agent's own system prompt, not the Claude Code system prompt
298> * Full content of skills listed in the agent's `skills:` field
299> * CLAUDE.md and git status. The built-in Explore and Plan agents [start with neither](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup), and an agent whose definition sets [`omitClaudeMd`](https://code.claude.com/docs/en/sub-agents#supported-frontmatter-fields) starts without the user, project, and local CLAUDE.md files.
300> * Whatever context the lead agent passes in the prompt
301>
302> For a [fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), Claude Code loads the parent's conversation so far, system prompt, and tools instead.
303>
304> **Context cost:** Isolated from main session.
305>
306> > [!TIP]
307> >
308> > Use subagents for work that doesn't need your full conversation context. Their isolation prevents bloating your main session.
309309
310**Hooks**
311
312**When:** On trigger. Claude Code runs hooks at specific lifecycle events like tool execution, session boundaries, prompt submission, permission requests, and compaction. See [Hooks](https://code.claude.com/docs/en/hooks.md) for the full list.
313
314**What loads:** Nothing by default. Hooks execute outside the main conversation.
315
316**Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.
317
318> [!TIP]
310> [tab] Hooks
319311>
320> Hooks are ideal for side effects (linting, logging) that don't need to affect Claude's context.
312> **When:** On trigger. Claude Code runs hooks at specific lifecycle events like tool execution, session boundaries, prompt submission, permission requests, and compaction. See [Hooks](https://code.claude.com/docs/en/hooks.md) for the full list.
313>
314> **What loads:** Nothing by default. Hooks execute outside the main conversation.
315>
316> **Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.
317>
318> > [!TIP]
319> >
320> > Hooks are ideal for side effects (linting, logging) that don't need to affect Claude's context.
321321
322322## Learn more
323323
324324Each feature has its own guide with setup instructions, examples, and configuration options.
325325
326> **[CLAUDE.md](https://code.claude.com/docs/en/memory.md)**
326> [card] [CLAUDE.md](https://code.claude.com/docs/en/memory.md)
327327>
328328> Store project context, conventions, and instructions
329329
330> **[Skills](https://code.claude.com/docs/en/skills.md)**
330> [card] [Skills](https://code.claude.com/docs/en/skills.md)
331331>
332332> Give Claude domain expertise and reusable workflows
333333
334> **[Subagents](https://code.claude.com/docs/en/sub-agents.md)**
334> [card] [Subagents](https://code.claude.com/docs/en/sub-agents.md)
335335>
336336> Offload work to isolated context
337337
338> **[Dynamic workflows](https://code.claude.com/docs/en/workflows.md)**
338> [card] [Dynamic workflows](https://code.claude.com/docs/en/workflows.md)
339339>
340340> Run many subagents from one script
341341
342> **[Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md)**
342> [card] [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md)
343343>
344344> Let Claude message your other sessions
345345
346> **[MCP](https://code.claude.com/docs/en/mcp.md)**
346> [card] [MCP](https://code.claude.com/docs/en/mcp.md)
347347>
348348> Connect Claude to external services
349349
350> **[Hooks](https://code.claude.com/docs/en/hooks-guide.md)**
350> [card] [Hooks](https://code.claude.com/docs/en/hooks-guide.md)
351351>
352352> Automate actions with hooks
353353
354> **[Plugins](https://code.claude.com/docs/en/plugins/overview.md)**
354> [card] [Plugins](https://code.claude.com/docs/en/plugins/overview.md)
355355>
356356> Bundle and share feature sets
357357
358> **[Marketplaces](https://code.claude.com/docs/en/plugins/create-marketplace.md)**
358> [card] [Marketplaces](https://code.claude.com/docs/en/plugins/create-marketplace.md)
359359>
360360> Host and distribute plugin collections
361361