72 72
73Some 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.73Some 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.
74 74
75**Skill vs Subagent**75> [tab] Skill vs Subagent
76 76>
77Skills and subagents solve different problems:77> Skills and subagents solve different problems:
78 78>
79* **Skills** are reusable content you can load into any context79> * **Skills** are reusable content you can load into any context
80* **Subagents** are isolated workers that run separately from your main conversation80> * **Subagents** are isolated workers that run separately from your main conversation
81 81>
82| Aspect | Skill | Subagent |82> | Aspect | Skill | Subagent |
83| - | - | - |83> | - | - | - |
84| **What it is** | Reusable instructions, knowledge, or workflows | Isolated worker with its own context |84> | **What it is** | Reusable instructions, knowledge, or workflows | Isolated worker with its own context |
85| **Key benefit** | Share content across contexts | Context isolation. Work happens separately, only summary returns |85> | **Key benefit** | Share content across contexts | Context isolation. Work happens separately, only summary returns |
86| **[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 |86> | **[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 |
87| **Best for** | Reference material, invocable workflows | Tasks that read many files, parallel work, specialized workers |87> | **Best for** | Reference material, invocable workflows | Tasks that read many files, parallel work, specialized workers |
88 88>
89**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).89> **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).
90 90>
91**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.91> **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.
92 92>
93**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.93> **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.
94
95**CLAUDE.md vs Skill**
96
97Both store instructions, but they load differently and serve different purposes.
98
99| Aspect | CLAUDE.md | Skill |
100| - | - | - |
101| **Loads** | Every session, automatically | On demand |
102| **Can include files** | Yes, with `@path` imports | Yes, with `@path` imports |
103| **Can trigger workflows** | No | Yes, with `/<name>` |
104| **Best for** | "Always do X" rules | Reference material, invocable workflows |
105
106**Put it in CLAUDE.md** if Claude should always know it: coding conventions, build commands, project structure, "never do X" rules.
107
108**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).
109
110**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.
111
112**CLAUDE.md vs Output style**
113
114Both give Claude standing instructions. CLAUDE.md carries what Claude should know, and an output style sets how Claude responds.
115
116| Aspect | CLAUDE.md | Output style |
117| - | - | - |
118| **Holds** | Facts and rules about your project | A role, tone, and response format |
119| **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 |
120| **Best for** | Build commands, conventions, "never do X" rules | Shorter responses, explanations alongside code, a non-engineering role |
121
122**Put it in CLAUDE.md** if it's true of the project whatever style you're in: coding conventions, build commands, project structure.
123
124**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.
125
126**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).
127
128**CLAUDE.md vs Rules vs Skills**
129
130All three store instructions, but they load differently:
131
132| Aspect | CLAUDE.md | `.claude/rules/` | Skill |
133| - | - | - | - |
134| **Loads** | Every session | Every session, or when matching files are opened | On demand, when invoked or relevant |
135| **Scope** | Whole project | Can be scoped to file paths | Task-specific |
136| **Best for** | Core conventions and build commands | Language-specific or directory-specific guidelines | Reference material, repeatable workflows |
137
138**Use CLAUDE.md** for instructions every session needs: build commands, test conventions, project architecture.
139
140**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.
141
142**Use skills** for content Claude only needs sometimes, like API documentation or a deployment checklist you trigger with `/<name>`.
143
144**Subagent vs Dynamic workflow**
145
146Both do work outside your main conversation. With subagents, Claude decides turn by turn what runs next. In a workflow, the script decides:
147
148* **Subagents** are workers Claude spawns, each returning a summary to the conversation that spawned it
149* **[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
150
151**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).
152
153**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).
154
155**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.
156
157**MCP vs Skill**
158
159MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.
160
161| Aspect | MCP | Skill |
162| - | - | - |
163| **What it is** | Protocol for connecting to external services | Knowledge, workflows, and reference material |
164| **Provides** | Tools and data access | Knowledge, workflows, reference material |
165| **Examples** | Slack integration, database queries, browser control | Code review checklist, deploy workflow, API style guide |
166
167These solve different problems and work well together:
168
169**MCP** gives Claude purpose-built tools for an external system, with the connection and authentication handled by the server.
170
171**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.
172
173**Hook vs Skill**
174 94
175Claude Code runs a hook at a lifecycle event; it loads a skill into context for Claude to apply.95> [tab] CLAUDE.md vs Skill
96>
97> Both store instructions, but they load differently and serve different purposes.
98>
99> | Aspect | CLAUDE.md | Skill |
100> | - | - | - |
101> | **Loads** | Every session, automatically | On demand |
102> | **Can include files** | Yes, with `@path` imports | Yes, with `@path` imports |
103> | **Can trigger workflows** | No | Yes, with `/<name>` |
104> | **Best for** | "Always do X" rules | Reference material, invocable workflows |
105>
106> **Put it in CLAUDE.md** if Claude should always know it: coding conventions, build commands, project structure, "never do X" rules.
107>
108> **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).
109>
110> **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.
176 111
177| Aspect | Hook | Skill |112> [tab] CLAUDE.md vs Output style
178| - | - | - |113>
179| **Runs** | A shell command, HTTP request, MCP tool call, LLM prompt, or subagent | Instructions Claude reads and follows |114> Both give Claude standing instructions. CLAUDE.md carries what Claude should know, and an output style sets how Claude responds.
180| **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 |115>
181| **Determinism** | Fires on its event without Claude deciding | Claude interprets the instructions; outcome can vary |116> | Aspect | CLAUDE.md | Output style |
182| **Context cost** | Zero unless the hook returns output | Description loads each session; full content loads when used |117> | - | - | - |
183| **Best for** | Linting after edits, blocking unsafe commands, logging, notifications | Workflows that need reasoning, reference material, multi-step tasks |118> | **Holds** | Facts and rules about your project | A role, tone, and response format |
119> | **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 |
120> | **Best for** | Build commands, conventions, "never do X" rules | Shorter responses, explanations alongside code, a non-engineering role |
121>
122> **Put it in CLAUDE.md** if it's true of the project whatever style you're in: coding conventions, build commands, project structure.
123>
124> **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.
125>
126> **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).
184 127
185**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.128> [tab] CLAUDE.md vs Rules vs Skills
129>
130> All three store instructions, but they load differently:
131>
132> | Aspect | CLAUDE.md | `.claude/rules/` | Skill |
133> | - | - | - | - |
134> | **Loads** | Every session | Every session, or when matching files are opened | On demand, when invoked or relevant |
135> | **Scope** | Whole project | Can be scoped to file paths | Task-specific |
136> | **Best for** | Core conventions and build commands | Language-specific or directory-specific guidelines | Reference material, repeatable workflows |
137>
138> **Use CLAUDE.md** for instructions every session needs: build commands, test conventions, project architecture.
139>
140> **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.
141>
142> **Use skills** for content Claude only needs sometimes, like API documentation or a deployment checklist you trigger with `/<name>`.
186 143
187**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.144> [tab] Subagent vs Dynamic workflow
145>
146> Both do work outside your main conversation. With subagents, Claude decides turn by turn what runs next. In a workflow, the script decides:
147>
148> * **Subagents** are workers Claude spawns, each returning a summary to the conversation that spawned it
149> * **[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
150>
151> **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).
152>
153> **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).
154>
155> **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.
188 156
189**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.157> [tab] MCP vs Skill
158>
159> MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.
160>
161> | Aspect | MCP | Skill |
162> | - | - | - |
163> | **What it is** | Protocol for connecting to external services | Knowledge, workflows, and reference material |
164> | **Provides** | Tools and data access | Knowledge, workflows, reference material |
165> | **Examples** | Slack integration, database queries, browser control | Code review checklist, deploy workflow, API style guide |
166>
167> These solve different problems and work well together:
168>
169> **MCP** gives Claude purpose-built tools for an external system, with the connection and authentication handled by the server.
170>
171> **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.
190 172
191**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.173> [tab] Hook vs Skill
174>
175> Claude Code runs a hook at a lifecycle event; it loads a skill into context for Claude to apply.
176>
177> | Aspect | Hook | Skill |
178> | - | - | - |
179> | **Runs** | A shell command, HTTP request, MCP tool call, LLM prompt, or subagent | Instructions Claude reads and follows |
180> | **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 |
181> | **Determinism** | Fires on its event without Claude deciding | Claude interprets the instructions; outcome can vary |
182> | **Context cost** | Zero unless the hook returns output | Description loads each session; full content loads when used |
183> | **Best for** | Linting after edits, blocking unsafe commands, logging, notifications | Workflows that need reasoning, reference material, multi-step tasks |
184>
185> **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.
186>
187> **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.
188>
189> **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.
190>
191> **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.
192 192
193### Understand how features layer193### Understand how features layer
194 194
238 238
239239
240 240
241**CLAUDE.md**241> [tab] CLAUDE.md
242
243**When:** Session start
244
245**What loads:** Full content of each CLAUDE.md file that loads at session start (managed, user, and project levels).
246
247**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.
248
249> [!TIP]
250>242>
251> 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`.243> **When:** Session start
252
253**Skills**
254
255Skills 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.
256
257**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.
258
259**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.
260
261**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>`.
262
263**Context cost:** Low until used. User-only skills have zero cost until invoked.
264
265**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.
266
267> [!TIP]
268>244>
269> Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures they run only when you name them.245> **What loads:** Full content of each CLAUDE.md file that loads at session start (managed, user, and project levels).
270
271**MCP servers**
272
273**When:** Session start.
274
275**What loads:** Tool names and server instructions from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.
276
277**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.
278
279> [!TIP]
280>246>
281> 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.247> **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.
282
283**Code intelligence**
284
285**When:** After file edits, and on demand when Claude navigates code.
286
287**What loads:** Type errors and warnings after each file edit. Definition, reference, and type information when Claude looks up a symbol.
288
289**Context cost:** Low. Symbol lookups often replace broad file reads, so net context use can go down.
290
291> [!TIP]
292>248>
293> 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.249> > [!TIP]
294 250> >
295**Subagents**251> > 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`.
296
297**When:** On demand, when you or Claude spawns one for a task.
298
299**What loads:** Fresh, isolated context containing:
300
301* The agent's own system prompt, not the Claude Code system prompt
302* Full content of skills listed in the agent's `skills:` field
303* 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.
304* Whatever context the lead agent passes in the prompt
305
306For 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.
307
308**Context cost:** Isolated from main session.
309 252
310> [!TIP]253> [tab] Skills
311>254>
312> Use subagents for work that doesn't need your full conversation context. Their isolation prevents bloating your main session.255> 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.
313 256>
314**Hooks**257> **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.
258>
259> **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.
260>
261> **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>`.
262>
263> **Context cost:** Low until used. User-only skills have zero cost until invoked.
264>
265> **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.
266>
267> > [!TIP]
268> >
269> > Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures they run only when you name them.
315 270
316**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.271> [tab] MCP servers
272>
273> **When:** Session start.
274>
275> **What loads:** Tool names and server instructions from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.
276>
277> **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.
278>
279> > [!TIP]
280> >
281> > 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.
317 282
318**What loads:** Nothing by default. Hooks execute outside the main conversation.283> [tab] Code intelligence
284>
285> **When:** After file edits, and on demand when Claude navigates code.
286>
287> **What loads:** Type errors and warnings after each file edit. Definition, reference, and type information when Claude looks up a symbol.
288>
289> **Context cost:** Low. Symbol lookups often replace broad file reads, so net context use can go down.
290>
291> > [!TIP]
292> >
293> > 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.
319 294
320**Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.295> [tab] Subagents
296>
297> **When:** On demand, when you or Claude spawns one for a task.
298>
299> **What loads:** Fresh, isolated context containing:
300>
301> * The agent's own system prompt, not the Claude Code system prompt
302> * Full content of skills listed in the agent's `skills:` field
303> * 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.
304> * Whatever context the lead agent passes in the prompt
305>
306> 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.
307>
308> **Context cost:** Isolated from main session.
309>
310> > [!TIP]
311> >
312> > Use subagents for work that doesn't need your full conversation context. Their isolation prevents bloating your main session.
321 313
322> [!TIP]314> [tab] Hooks
315>
316> **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.
317>
318> **What loads:** Nothing by default. Hooks execute outside the main conversation.
319>
320> **Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.
323>321>
324> Hooks are ideal for side effects (linting, logging) that don't need to affect Claude's context.322> > [!TIP]
323> >
324> > Hooks are ideal for side effects (linting, logging) that don't need to affect Claude's context.
325 325
326## Learn more326## Learn more
327 327
328Each feature has its own guide with setup instructions, examples, and configuration options.328Each feature has its own guide with setup instructions, examples, and configuration options.
329 329
330> **[CLAUDE.md](https://code.claude.com/docs/en/memory.md)**330> [card] [CLAUDE.md](https://code.claude.com/docs/en/memory.md)
331>331>
332> Store project context, conventions, and instructions332> Store project context, conventions, and instructions
333 333
334> **[Skills](https://code.claude.com/docs/en/skills.md)**334> [card] [Skills](https://code.claude.com/docs/en/skills.md)
335>335>
336> Give Claude domain expertise and reusable workflows336> Give Claude domain expertise and reusable workflows
337 337
338> **[Subagents](https://code.claude.com/docs/en/sub-agents.md)**338> [card] [Subagents](https://code.claude.com/docs/en/sub-agents.md)
339>339>
340> Offload work to isolated context340> Offload work to isolated context
341 341
342> **[Dynamic workflows](https://code.claude.com/docs/en/workflows.md)**342> [card] [Dynamic workflows](https://code.claude.com/docs/en/workflows.md)
343>343>
344> Run many subagents from one script344> Run many subagents from one script
345 345
346> **[Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md)**346> [card] [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md)
347>347>
348> Let Claude message your other sessions348> Let Claude message your other sessions
349 349
350> **[MCP](https://code.claude.com/docs/en/mcp.md)**350> [card] [MCP](https://code.claude.com/docs/en/mcp.md)
351>351>
352> Connect Claude to external services352> Connect Claude to external services
353 353
354> **[Hooks](https://code.claude.com/docs/en/hooks-guide.md)**354> [card] [Hooks](https://code.claude.com/docs/en/hooks-guide.md)
355>355>
356> Automate actions with hooks356> Automate actions with hooks
357 357
358> **[Plugins](https://code.claude.com/docs/en/plugins/overview.md)**358> [card] [Plugins](https://code.claude.com/docs/en/plugins/overview.md)
359>359>
360> Bundle and share feature sets360> Bundle and share feature sets
361 361
362> **[Marketplaces](https://code.claude.com/docs/en/plugins/create-marketplace.md)**362> [card] [Marketplaces](https://code.claude.com/docs/en/plugins/create-marketplace.md)
363>363>
364> Host and distribute plugin collections364> Host and distribute plugin collections