SpyBara
Go Premium

Documentation 2026-05-11 23:00 UTC to 2026-05-12 22:57 UTC

35 files changed +689 −456. View all changes and history on the product overview
2026
Sun 31 06:39 Sat 30 06:23 Fri 29 06:38 Thu 28 06:37 Wed 27 06:42 Tue 26 06:33 Sun 24 06:25 Sat 23 06:18 Fri 22 06:33 Thu 21 06:36 Wed 20 06:35 Tue 19 06:34 Mon 18 23:59 Sun 17 01:01 Fri 15 22:58 Thu 14 17:02 Wed 13 23:01 Tue 12 22:57 Mon 11 23:00 Sun 10 23:03 Sat 9 04:57 Fri 8 22:00 Thu 7 22:59 Tue 5 23:00 Mon 4 22:58 Sat 2 18:14 Fri 1 18:19
Details

204Here's how each component affects context in the SDK:204Here's how each component affects context in the SDK:

205 205 

206| Source | When it loads | Impact |206| Source | When it loads | Impact |

207| :----------------------- | :------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------- |207| :----------------------- | :------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

208| **System prompt** | Every request | Small fixed cost, always present |208| **System prompt** | Every request | Small fixed cost, always present |

209| **CLAUDE.md files** | Session start, via [`settingSources`](/en/agent-sdk/claude-code-features) | Full content in every request (but prompt-cached, so only the first request pays full cost) |209| **CLAUDE.md files** | Session start, via [`settingSources`](/en/agent-sdk/claude-code-features) | Full content in every request (but prompt-cached, so only the first request pays full cost) |

210| **Tool definitions** | Every request | Each tool adds its schema; use [MCP tool search](/en/agent-sdk/mcp#mcp-tool-search) to load tools on-demand instead of all at once |210| **Tool definitions** | Every request; MCP schemas deferred by default | Built-in tool schemas load every request. [Tool search](/en/agent-sdk/mcp#mcp-tool-search) defers MCP tool schemas by default, falling back to upfront loading on Vertex AI or a non-first-party `ANTHROPIC_BASE_URL`. See [Configure tool search](/en/agent-sdk/tool-search#configure-tool-search) for the full matrix |

211| **Conversation history** | Accumulates over turns | Grows with each turn: prompts, responses, tool inputs, tool outputs |211| **Conversation history** | Accumulates over turns | Grows with each turn: prompts, responses, tool inputs, tool outputs |

212| **Skill descriptions** | Session start, via setting sources | Short summaries; full content loads only when invoked |212| **Skill descriptions** | Session start, via setting sources | Short summaries; full content loads only when invoked |

213 213 


244A few strategies for long-running agents:244A few strategies for long-running agents:

245 245 

246* **Use subagents for subtasks.** Each subagent starts with a fresh conversation (no prior message history, though it does load its own system prompt and project-level context like CLAUDE.md). It does not see the parent's turns, and only its final response returns to the parent as a tool result. The main agent's context grows by that summary, not by the full subtask transcript. See [What subagents inherit](/en/agent-sdk/subagents#what-subagents-inherit) for details.246* **Use subagents for subtasks.** Each subagent starts with a fresh conversation (no prior message history, though it does load its own system prompt and project-level context like CLAUDE.md). It does not see the parent's turns, and only its final response returns to the parent as a tool result. The main agent's context grows by that summary, not by the full subtask transcript. See [What subagents inherit](/en/agent-sdk/subagents#what-subagents-inherit) for details.

247* **Be selective with tools.** Every tool definition takes context space. Use the `tools` field on [`AgentDefinition`](/en/agent-sdk/subagents#agentdefinition-configuration) to scope subagents to the minimum set they need, and use [MCP tool search](/en/agent-sdk/mcp#mcp-tool-search) to load tools on demand instead of preloading all of them.247* **Be selective with tools.** Every tool definition takes context space. Use the `tools` field on [`AgentDefinition`](/en/agent-sdk/subagents#agentdefinition-configuration) to scope subagents to the minimum set they need.

248* **Watch MCP server costs.** Each MCP server adds all its tool schemas to every request. A few servers with many tools can consume significant context before the agent does any work. The `ToolSearch` tool can help by loading tools on-demand instead of preloading all of them. See [MCP tool search](/en/agent-sdk/mcp#mcp-tool-search) for configuration.248* **Watch MCP server costs.** [MCP tool search](/en/agent-sdk/mcp#mcp-tool-search) defers MCP tool schemas by default and loads them on demand. When tool search is off, on Vertex AI, or behind a non-first-party `ANTHROPIC_BASE_URL`, each MCP server adds all its tool schemas to every request, so a few servers with many tools can consume significant context before the agent does any work.

249* **Use lower effort for routine tasks.** Set [effort](#effort-level) to `"low"` for agents that only need to read files or list directories. This reduces token usage and cost.249* **Use lower effort for routine tasks.** Set [effort](#effort-level) to `"low"` for agents that only need to read files or list directories. This reduces token usage and cost.

250 250 

251For a detailed breakdown of per-feature context costs, see [Understand context costs](/en/features-overview#understand-context-costs).251For a detailed breakdown of per-feature context costs, see [Understand context costs](/en/features-overview#understand-context-costs).

Details

4 4 

5# Modifying system prompts5# Modifying system prompts

6 6 

7> Learn how to customize Claude's behavior by modifying system prompts using three approaches - output styles, systemPrompt with append, and custom system prompts.7> Choose between the `claude_code` preset and a custom system prompt, and customize behavior with CLAUDE.md, output styles, append, or a fully custom prompt.

8 8 

9System prompts define Claude's behavior, capabilities, and response style. The Claude Agent SDK provides three ways to customize system prompts: using output styles (persistent, file-based configurations), appending to Claude Code's prompt, or using a fully custom prompt.9System prompts define Claude's behavior, capabilities, and response style. Start from the `claude_code` preset for CLI or IDE-like coding tools where a human watches and steers the work. Write your own prompt for agents with a different surface, identity, or permission model.

10 10 

11## Understanding system prompts11This page covers:

12 12 

13A system prompt is the initial instruction set that shapes how Claude behaves throughout a conversation.13* [How system prompts work](#how-system-prompts-work), with a decision table for choosing between the preset, the preset with `append`, and a custom prompt

14* [Customize agent behavior](#customize-agent-behavior) with CLAUDE.md files, output styles, `append`, or a custom string

15* [Compare the four approaches](#compare-the-four-approaches) by persistence, scope, and what they preserve

16* [Combine approaches](#combine-approaches) to layer customization methods together

14 17 

15<Note>18## How system prompts work

16 **Default behavior:** The Agent SDK uses a **minimal system prompt** by default. It contains only essential tool instructions but omits Claude Code's coding guidelines, response style, and project context. To include the full Claude Code system prompt, specify `systemPrompt: { type: "preset", preset: "claude_code" }` in TypeScript or `system_prompt={"type": "preset", "preset": "claude_code"}` in Python.

17</Note>

18 

19Claude Code's system prompt includes:

20 

21* Tool usage instructions and available tools

22* Code style and formatting guidelines

23* Response tone and verbosity settings

24* Security and safety instructions

25* Context about the current working directory and environment

26 

27## Methods of modification

28 

29### Method 1: CLAUDE.md files (project-level instructions)

30 19 

31CLAUDE.md files provide project-specific context and instructions that are automatically read by the Agent SDK when it runs in a directory. They serve as persistent "memory" for your project.20A system prompt is the initial instruction set that shapes how Claude behaves throughout a conversation. The Agent SDK has three starting points for it:

32 21 

33#### How CLAUDE.md works with the SDK22* **Minimal default**: when you don't set `systemPrompt` in TypeScript or `system_prompt` in Python, the SDK uses a minimal prompt that covers tool calling but omits Claude Code's coding guidelines, response style, and project context. This differs from `claude -p`, which uses the full Claude Code prompt by default. If you're migrating from the CLI and want matching behavior, set the `claude_code` preset.

23* **`claude_code` preset**: the full system prompt that the Claude Code CLI uses, with tool usage instructions, code style and formatting guidelines, response tone and verbosity rules, security and safety instructions, and context about the working directory and environment. Set `systemPrompt: { type: "preset", preset: "claude_code" }` in TypeScript or `system_prompt={"type": "preset", "preset": "claude_code"}` in Python, optionally with `append` to add your own instructions on the end.

24* **Custom string**: a prompt you write yourself. The SDK sends only what you provide.

34 25 

35**Location and discovery:**26### Decide on a starting point

36 27 

37* **Project-level:** `CLAUDE.md` or `.claude/CLAUDE.md` in your working directory28The deciding factor is how closely your agent resembles Claude Code: a coding agent operating in a repository, with a human watching streaming output and steering the work. The further your product is from that, the more you'll want to write your own prompt.

38* **User-level:** `~/.claude/CLAUDE.md` for global instructions across all projects

39 29 

40CLAUDE.md files are read when the corresponding setting source is enabled: `'project'` for project-level CLAUDE.md and `'user'` for `~/.claude/CLAUDE.md`. With default `query()` options both sources are enabled, so CLAUDE.md loads automatically. If you set `settingSources` (TypeScript) or `setting_sources` (Python) explicitly, include the sources you need. CLAUDE.md loading is controlled by setting sources, not by the `claude_code` preset.30| You're building | Use | What you get |

31| :----------------------------------------------------------------------------------------------------------- | :--------------------------------- | :---------------------------------------------------------------------------------------------------------------------------- |

32| A CLI or IDE-like coding tool where a human watches and steers, and Claude Code's defaults are what you want | `claude_code` preset | The full Claude Code prompt: tool guidance, safety rules, terminal-friendly responses, repo-convention awareness |

33| The same kind of tool, plus product-specific rules like coding standards, output format, or domain context | `claude_code` preset with `append` | Everything above, with your instructions added after the preset. Nothing is removed, so this is the lowest-risk customization |

34| An agent with a different surface, identity, or permission model, or a non-coding agent | Custom prompt string | Only what you write. You take responsibility for replacing the tool guidance and safety instructions your agent still needs |

35| A thin tool-calling loop with no agent persona, where you supply all behavior in the user prompt | No `systemPrompt` option | The minimal default: tool-calling support and nothing else |

41 36 

42**Content format:**37"Different from Claude Code" usually means one of the following:

43CLAUDE.md files use plain markdown and can contain:

44 38 

45* Coding guidelines and standards39* **Different surface**: the output isn't read in a terminal by the person who triggered it. Chat UIs, structured-output consumers, and non-coding automation each need a prompt that matches how their output is rendered and reviewed. Unattended coding automation, like a CI job that fixes lint errors or reviews diffs, still fits the preset because the work itself is what the preset is written for.

46* Project-specific context40* **Different identity**: the agent shouldn't present itself as Claude Code. A support bot, a data-analysis assistant, or any domain-specific agent needs its own name, scope, and persona.

47* Common commands or workflows41* **Different permission model**: the agent runs autonomously without a human approving each step, or operates on a narrow set of resources. Claude Code's prompt assumes a human is in the loop with access to a full toolset.

48* API conventions42* **Non-coding tasks**: most of Claude Code's prompt is coding guidance. For research, content, or operations agents, that guidance competes with the instructions you actually need.

49* Testing requirements

50 43 

51#### Example CLAUDE.md44The [comparison table](#compare-the-four-approaches) shows what each customization method preserves.

52 45 

53```markdown theme={null}46## Customize agent behavior

54# Project Guidelines

55 47 

56## Code Style48Output styles, `append`, and a custom prompt string each change the system prompt directly. CLAUDE.md takes a different path: the SDK reads it and injects its content into the conversation as project context, not into the system prompt, so it shapes behavior alongside whichever system prompt you choose. [Skills](/en/agent-sdk/skills), [hooks](/en/agent-sdk/hooks), and [permissions](/en/agent-sdk/permissions) also shape behavior outside the system prompt and are covered on their own pages.

57 49 

58- Use TypeScript strict mode50### CLAUDE.md files for project-level instructions

59- Prefer functional components in React

60- Always include JSDoc comments for public APIs

61 51 

62## Testing52CLAUDE.md files give Claude persistent project context and instructions. The SDK injects their content into the conversation, not into the system prompt, so they work with any system prompt configuration. For what to put in CLAUDE.md, where to place it, and how to write effective instructions, see [How Claude remembers your project](/en/memory). This section covers what's specific to the SDK: how CLAUDE.md loads.

63 53 

64- Run `npm test` before committing54The SDK reads CLAUDE.md when the matching setting source is enabled: `'project'` loads `CLAUDE.md` or `.claude/CLAUDE.md` from the working directory, and `'user'` loads `~/.claude/CLAUDE.md`. Default `query()` options enable both sources, so CLAUDE.md loads automatically. If you set `settingSources` in TypeScript or `setting_sources` in Python explicitly, include the sources you need. CLAUDE.md loading is controlled by setting sources, not by the `claude_code` preset.

65- Maintain >80% code coverage

66- Use jest for unit tests, playwright for E2E

67 55 

68## Commands56#### Load CLAUDE.md with the SDK

69 57 

70- Build: `npm run build`58To load CLAUDE.md, set `settingSources` to include the level your CLAUDE.md lives at. The example below loads a project-level CLAUDE.md alongside the `claude_code` preset, so Claude has both the full coding-agent prompt and your project's conventions:

71- Dev server: `npm run dev`

72- Type check: `npm run typecheck`

73```

74 

75#### Using CLAUDE.md with the SDK

76 59 

77<CodeGroup>60<CodeGroup>

78 ```typescript TypeScript theme={null}61 ```typescript TypeScript theme={null}


117 ```100 ```

118</CodeGroup>101</CodeGroup>

119 102 

120#### When to use CLAUDE.md103CLAUDE.md is persistent across all sessions in a project, shared with your team through git, and discovered automatically without code changes. It is not loaded if you pass an empty `settingSources` array.

121 

122**Best for:**

123 

124* **Team-shared context** - Guidelines everyone should follow

125* **Project conventions** - Coding standards, file structure, naming patterns

126* **Common commands** - Build, test, deploy commands specific to your project

127* **Long-term memory** - Context that should persist across all sessions

128* **Version-controlled instructions** - Commit to git so the team stays in sync

129 

130**Key characteristics:**

131 104 

132* ✅ Persistent across all sessions in a project105### Output styles for persistent configurations

133* ✅ Shared with team via git

134* ✅ Automatic discovery (no code changes needed)

135* ⚠️ Not loaded if you pass `settingSources: []`

136 

137### Method 2: Output styles (persistent configurations)

138 106 

139Output styles are saved configurations that modify Claude's system prompt. They're stored as markdown files and can be reused across sessions and projects.107Output styles are saved configurations that modify Claude's system prompt. They're stored as markdown files and can be reused across sessions and projects.

140 108 

141#### Creating an output style109#### Create an output style

142 

143<CodeGroup>

144 ```typescript TypeScript theme={null}

145 import { writeFile, mkdir } from "fs/promises";

146 import { join } from "path";

147 import { homedir } from "os";

148 

149 async function createOutputStyle(name: string, description: string, prompt: string) {

150 // User-level: ~/.claude/output-styles

151 // Project-level: .claude/output-styles

152 const outputStylesDir = join(homedir(), ".claude", "output-styles");

153 

154 await mkdir(outputStylesDir, { recursive: true });

155 

156 const content = `---

157 name: ${name}

158 description: ${description}

159 ---

160 

161 ${prompt}`;

162 

163 const filePath = join(outputStylesDir, `${name.toLowerCase().replace(/\s+/g, "-")}.md`);

164 await writeFile(filePath, content, "utf-8");

165 }

166 

167 // Example: Create a code review specialist

168 await createOutputStyle(

169 "Code Reviewer",

170 "Thorough code review assistant",

171 `You are an expert code reviewer.

172 

173 For every code submission:

174 1. Check for bugs and security issues

175 2. Evaluate performance

176 3. Suggest improvements

177 4. Rate code quality (1-10)`

178 );

179 ```

180 

181 ```python Python theme={null}

182 from pathlib import Path

183 

184 

185 async def create_output_style(name: str, description: str, prompt: str):

186 # User-level: ~/.claude/output-styles

187 # Project-level: .claude/output-styles

188 output_styles_dir = Path.home() / ".claude" / "output-styles"

189 

190 output_styles_dir.mkdir(parents=True, exist_ok=True)

191 110 

192 content = f"""---111An output style is a markdown file with a `name` and `description` in its frontmatter, followed by the prompt content. Save it to `~/.claude/output-styles/` for a user-level style available in every project, or `.claude/output-styles/` in your repository for a project-level style you can commit and share with your team.

193 name: {name}

194 description: {description}

195 ---

196 112 

197 {prompt}"""113The example below defines a code-review persona. Save it as `~/.claude/output-styles/code-reviewer.md` to make it available across projects:

198 114 

199 file_name = name.lower().replace(" ", "-") + ".md"115```markdown ~/.claude/output-styles/code-reviewer.md theme={null}

200 file_path = output_styles_dir / file_name116---

201 file_path.write_text(content, encoding="utf-8")117name: Code Reviewer

118description: Thorough code review assistant

119---

202 120 

121You are an expert code reviewer.

203 122 

204 # Example: Create a code review specialist123For every code submission:

205 await create_output_style(1241. Check for bugs and security issues

206 "Code Reviewer",1252. Evaluate performance

207 "Thorough code review assistant",1263. Suggest improvements

208 """You are an expert code reviewer.1274. Rate code quality (1-10)

209 128```

210 For every code submission:

211 1. Check for bugs and security issues

212 2. Evaluate performance

213 3. Suggest improvements

214 4. Rate code quality (1-10)""",

215 )

216 ```

217</CodeGroup>

218 129 

219#### Using output styles130#### Activate an output style

220 131 

221Once created, activate output styles via:132Once created, activate output styles via:

222 133 

223* **CLI**: `/config`, then select Output style134* **CLI**: run `/config` and select an output style

224* **Settings**: set `outputStyle` in `.claude/settings.local.json`135* **Settings**: set `outputStyle` in `.claude/settings.local.json`

225* **Create new**: add a Markdown file at `~/.claude/output-styles/` or `.claude/output-styles/`; see [Create a custom output style](/en/output-styles#create-a-custom-output-style) for the format136* **TypeScript SDK**: set `options.outputStyle` to the style's name

137 

138The Python SDK does not have an option to select an output style programmatically. For code-only deployments where you can't write to `.claude/settings.local.json`, use `append` or a custom prompt string instead.

226 139 

227**Note for SDK users:** Output styles are loaded when you include `settingSources: ['user']` or `settingSources: ['project']` (TypeScript) / `setting_sources=["user"]` or `setting_sources=["project"]` (Python) in your options.140**Note for SDK users:** Output styles are loaded when you include `settingSources: ['user']` or `settingSources: ['project']` (TypeScript) / `setting_sources=["user"]` or `setting_sources=["project"]` (Python) in your options.

228 141 

229### Method 3: Using `systemPrompt` with append142### Append to the `claude_code` preset

230 143 

231You can use the Claude Code preset with an `append` property to add your custom instructions while preserving all built-in functionality.144You can use the Claude Code preset with an `append` property to add your custom instructions while preserving all built-in functionality.

232 145 


254 ```167 ```

255 168 

256 ```python Python theme={null}169 ```python Python theme={null}

257 from claude_agent_sdk import query, ClaudeAgentOptions170 from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage

258 171 

259 messages = []172 messages = []

260 173 


269 ),182 ),

270 ):183 ):

271 messages.append(message)184 messages.append(message)

272 if message.type == "assistant":185 if isinstance(message, AssistantMessage):

273 print(message.message.content)186 print(message.content)

274 ```187 ```

275</CodeGroup>188</CodeGroup>

276 189 

277#### Improve prompt caching across users and machines190#### Improve prompt caching across users and machines

278 191 

279By default, two sessions that use the same `claude_code` preset and `append` text still cannot share a prompt cache entry if they run from different working directories. This is because the preset embeds per-session context in the system prompt ahead of your `append` text: the working directory, platform and OS version, current date, git status, and auto-memory paths. Any difference in that context produces a different system prompt and a cache miss.192By default, two sessions that use the same `claude_code` preset and `append` text still cannot share a prompt cache entry if they run from different working directories. This is because the preset embeds per-session context in the system prompt ahead of your `append` text: the working directory, whether it's a git repository, the platform, the active shell, the OS version, and auto-memory paths. Any difference in that context produces a different system prompt and a cache miss. CLAUDE.md content doesn't affect the system prompt cache because the SDK injects it into the conversation, not the system prompt.

280 193 

281To make the system prompt identical across sessions, set `excludeDynamicSections: true` in TypeScript or `"exclude_dynamic_sections": True` in Python. The per-session context moves into the first user message, leaving only the static preset and your `append` text in the system prompt so identical configurations share a cache entry across users and machines.194To make the system prompt identical across sessions, set `excludeDynamicSections: true` in TypeScript or `"exclude_dynamic_sections": True` in Python. The per-session context moves into the first user message, leaving only the static preset and your `append` text in the system prompt so identical configurations share a cache entry across users and machines.

282 195 


323 ```236 ```

324</CodeGroup>237</CodeGroup>

325 238 

326**Tradeoffs:** the working directory, git status, and memory location still reach Claude, but as part of the first user message rather than the system prompt. Instructions in the user message carry marginally less weight than the same text in the system prompt, so Claude may rely on them less strongly when reasoning about the current directory or auto-memory paths. Enable this option when cross-session cache reuse matters more than maximally authoritative environment context.239**Tradeoffs:** the working directory, the git-repo flag, the platform, the active shell, the OS version, and auto-memory paths still reach Claude, but as part of the first user message rather than the system prompt. Instructions in the user message carry marginally less weight than the same text in the system prompt, so Claude may rely on them less strongly when reasoning about the current directory or auto-memory paths. Enable this option when cross-session cache reuse matters more than maximally authoritative environment context.

327 240 

328For the equivalent flag in non-interactive CLI mode, see [`--exclude-dynamic-system-prompt-sections`](/en/cli-reference).241For the equivalent flag in non-interactive CLI mode, see [`--exclude-dynamic-system-prompt-sections`](/en/cli-reference).

329 242 

330### Method 4: Custom system prompts243### Custom system prompts

331 244 

332You can provide a custom string as `systemPrompt` to replace the default entirely with your own instructions.245You can provide a custom string as `systemPrompt` to replace the default entirely with your own instructions.

333 246 


359 ```272 ```

360 273 

361 ```python Python theme={null}274 ```python Python theme={null}

362 from claude_agent_sdk import query, ClaudeAgentOptions275 from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage

363 276 

364 custom_prompt = """You are a Python coding specialist.277 custom_prompt = """You are a Python coding specialist.

365 Follow these guidelines:278 Follow these guidelines:


376 options=ClaudeAgentOptions(system_prompt=custom_prompt),289 options=ClaudeAgentOptions(system_prompt=custom_prompt),

377 ):290 ):

378 messages.append(message)291 messages.append(message)

379 if message.type == "assistant":292 if isinstance(message, AssistantMessage):

380 print(message.message.content)293 print(message.content)

381 ```294 ```

382</CodeGroup>295</CodeGroup>

383 296 

384## Comparison of all four approaches297## Compare the four approaches

298 

299The four customization methods differ in where they live, how they're shared, and what they preserve from the `claude_code` preset.

385 300 

386| Feature | CLAUDE.md | Output Styles | `systemPrompt` with append | Custom `systemPrompt` |301| Feature | CLAUDE.md | Output Styles | `systemPrompt` with append | Custom `systemPrompt` |

387| ----------------------- | ---------------- | --------------- | -------------------------- | ---------------------- |302| ----------------------- | ---------------- | --------------- | -------------------------- | ---------------------- |


395| **Version control** | With project | Yes | With code | With code |310| **Version control** | With project | Yes | With code | With code |

396| **Scope** | Project-specific | User or project | Code session | Code session |311| **Scope** | Project-specific | User or project | Code session | Code session |

397 312 

398**Note:** "With append" means using `systemPrompt: { type: "preset", preset: "claude_code", append: "..." }` in TypeScript or `system_prompt={"type": "preset", "preset": "claude_code", "append": "..."}` in Python.313"With append" means using `systemPrompt: { type: "preset", preset: "claude_code", append: "..." }` in TypeScript or `system_prompt={"type": "preset", "preset": "claude_code", "append": "..."}` in Python. CLAUDE.md doesn't change the system prompt itself: the SDK injects its content into the conversation as project context.

399 314 

400## Use cases and best practices315## Use cases and best practices

401 316 

402### When to use CLAUDE.md317### When to use CLAUDE.md

403 318 

404**Best for:**319Use CLAUDE.md for instructions that should apply to every session in a project, regardless of which system prompt the session uses: coding standards, common commands, architecture context, and team conventions. CLAUDE.md is committed to your repository, so it stays in sync with the code it describes. See [When to add to CLAUDE.md](/en/memory#when-to-add-to-claude-md) for full guidance.

405 

406* Project-specific coding standards and conventions

407* Documenting project structure and architecture

408* Listing common commands (build, test, deploy)

409* Team-shared context that should be version controlled

410* Instructions that apply to all SDK usage in a project

411 

412**Examples:**

413 320 

414* "All API endpoints should use async/await patterns"321CLAUDE.md files load when the `project` setting source is enabled, which it is for default `query()` options. If you set `settingSources` in TypeScript or `setting_sources` in Python explicitly, include `'project'` to keep loading project-level CLAUDE.md.

415* "Run `npm run lint:fix` before committing"

416* "Database migrations are in the `migrations/` directory"

417 

418CLAUDE.md files load when the `project` setting source is enabled, which it is for default `query()` options. If you set `settingSources` (TypeScript) or `setting_sources` (Python) explicitly, include `'project'` to keep loading project-level CLAUDE.md.

419 322 

420### When to use output styles323### When to use output styles

421 324 

325Output styles are for personas you want to reuse across the CLI and SDK without changing application code. Because they live as files in `.claude/output-styles`, the same persona is available from `/config` in the CLI and from any SDK session that loads the matching setting source.

326 

422**Best for:**327**Best for:**

423 328 

424* Persistent behavior changes across sessions329* Persistent behavior changes across sessions

425* Team-shared configurations330* Team-shared configurations

426* Specialized assistants (code reviewer, data scientist, DevOps)331* Specialized assistants like a code reviewer, data scientist, or DevOps assistant

427* Complex prompt modifications that need versioning332* Complex prompt modifications that need versioning

428 333 

429**Examples:**334**Examples:**


434 339 

435### When to use `systemPrompt` with append340### When to use `systemPrompt` with append

436 341 

342Use `append` when the `claude_code` preset already fits your product and you only need to layer in extra instructions. You keep the preset's tool guidance, safety rules, and coding conventions without reimplementing them.

343 

437**Best for:**344**Best for:**

438 345 

439* Adding specific coding standards or preferences346* Adding specific coding standards or preferences


444 351 

445### When to use custom `systemPrompt`352### When to use custom `systemPrompt`

446 353 

354Use a custom prompt when your agent's surface, identity, or permission model differs from Claude Code's, as described in [Decide on a starting point](#decide-on-a-starting-point). You define the full instruction set, including any tool guidance and safety rules your agent needs.

355 

447**Best for:**356**Best for:**

448 357 

449* Complete control over Claude's behavior358* Complete control over Claude's behavior


452* Situations where default tools aren't needed361* Situations where default tools aren't needed

453* Building specialized agents with unique behavior362* Building specialized agents with unique behavior

454 363 

455## Combining approaches364## Combine approaches

365 

366These methods compose. A persistent output style or CLAUDE.md sets the long-lived behavior, and `append` layers session-specific instructions on top without touching the saved configuration.

456 367 

457You can combine these methods for maximum flexibility:368### Combine an output style with session-specific additions

458 369 

459### Example: Output style with session-specific additions370The example below assumes a Code Reviewer output style is already active. The `append` block layers session-specific focus areas on top of the persona, so a single review session can prioritize OAuth and token storage without changing the saved output style:

460 371 

461<CodeGroup>372<CodeGroup>

462 ```typescript TypeScript theme={null}373 ```typescript TypeScript theme={null}


513 424 

514## See also425## See also

515 426 

516* [Output styles](/en/output-styles) - Complete output styles documentation427* [Output styles](/en/output-styles): create, manage, and share output styles for the CLI, including the file format and storage locations

517* [TypeScript SDK guide](/en/agent-sdk/typescript) - Complete SDK usage guide428* [How Claude remembers your project](/en/memory): what to put in CLAUDE.md, where to place it, and how to write effective project instructions

518* [Configuration guide](/en/settings) - General configuration options429* [TypeScript SDK reference](/en/agent-sdk/typescript): the full `Options` type, including `systemPrompt`, `settingSources`, and `outputStyle`

430* [Python SDK reference](/en/agent-sdk/python): the full `ClaudeAgentOptions` type, including `system_prompt` and `setting_sources`

431* [Settings](/en/settings): the `settings.json` reference, including where output styles and other configuration are stored

Details

890```890```

891 891 

892| Field | Required | Description |892| Field | Required | Description |

893| :------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |893| :------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

894| `type` | Yes | Must be `"preset"` to use a preset system prompt |894| `type` | Yes | Must be `"preset"` to use a preset system prompt |

895| `preset` | Yes | Must be `"claude_code"` to use Claude Code's system prompt |895| `preset` | Yes | Must be `"claude_code"` to use Claude Code's system prompt |

896| `append` | No | Additional instructions to append to the preset system prompt |896| `append` | No | Additional instructions to append to the preset system prompt |

897| `exclude_dynamic_sections` | No | Move per-session context such as working directory, git status, and memory paths from the system prompt into the first user message. Improves prompt-cache reuse across users and machines. See [Modify system prompts](/en/agent-sdk/modifying-system-prompts#improve-prompt-caching-across-users-and-machines) |897| `exclude_dynamic_sections` | No | Move per-session context such as working directory, the git-repo flag, and auto-memory paths from the system prompt into the first user message. Improves prompt-cache reuse across users and machines. See [Modify system prompts](/en/agent-sdk/modifying-system-prompts#improve-prompt-caching-across-users-and-machines) |

898 898 

899### `SettingSource`899### `SettingSource`

900 900 


2645 2645 

2646**Tool name:** `TodoWrite`2646**Tool name:** `TodoWrite`

2647 2647 

2648<Note>

2649 `TodoWrite` is deprecated and will be removed in a future release. Use `TaskCreate`, `TaskGet`, `TaskUpdate`, and `TaskList` instead. Set `CLAUDE_CODE_ENABLE_TASKS=1` to opt in. See [Migrate to Task tools](/en/agent-sdk/todo-tracking#migrate-to-task-tools) for how monitoring code changes.

2650</Note>

2651 

2648**Input:**2652**Input:**

2649 2653 

2650```python theme={null}2654```python theme={null}


2668}2672}

2669```2673```

2670 2674 

2675### TaskCreate

2676 

2677**Tool name:** `TaskCreate`

2678 

2679**Input:**

2680 

2681```python theme={null}

2682{

2683 "subject": str, # Short task title

2684 "description": str, # Detailed task body

2685 "activeForm": str | None, # Present-tense label shown while in progress

2686 "metadata": dict | None, # Arbitrary caller metadata

2687}

2688```

2689 

2690**Output:**

2691 

2692```python theme={null}

2693{

2694 "task": {"id": str, "subject": str}, # Created task with assigned ID

2695}

2696```

2697 

2698### TaskUpdate

2699 

2700**Tool name:** `TaskUpdate`

2701 

2702**Input:**

2703 

2704```python theme={null}

2705{

2706 "taskId": str, # ID of the task to patch

2707 "status": Literal["pending", "in_progress", "completed", "deleted"] | None,

2708 "subject": str | None,

2709 "description": str | None,

2710 "activeForm": str | None,

2711 "addBlocks": list[str] | None, # Task IDs this task now blocks

2712 "addBlockedBy": list[str] | None, # Task IDs that now block this task

2713 "owner": str | None,

2714 "metadata": dict | None,

2715}

2716```

2717 

2718**Output:**

2719 

2720```python theme={null}

2721{

2722 "success": bool,

2723 "taskId": str,

2724 "updatedFields": list[str], # Names of fields that changed

2725 "error": str | None,

2726 "statusChange": {"from": str, "to": str} | None,

2727}

2728```

2729 

2730### TaskGet

2731 

2732**Tool name:** `TaskGet`

2733 

2734**Input:**

2735 

2736```python theme={null}

2737{

2738 "taskId": str, # ID of the task to read

2739}

2740```

2741 

2742**Output:**

2743 

2744```python theme={null}

2745{

2746 "task": {

2747 "id": str,

2748 "subject": str,

2749 "description": str,

2750 "status": Literal["pending", "in_progress", "completed"],

2751 "blocks": list[str],

2752 "blockedBy": list[str],

2753 } | None, # None when the ID is not found

2754}

2755```

2756 

2757### TaskList

2758 

2759**Tool name:** `TaskList`

2760 

2761**Input:**

2762 

2763```python theme={null}

2764{}

2765```

2766 

2767**Output:**

2768 

2769```python theme={null}

2770{

2771 "tasks": [

2772 {

2773 "id": str,

2774 "subject": str,

2775 "status": Literal["pending", "in_progress", "completed"],

2776 "owner": str | None,

2777 "blockedBy": list[str],

2778 }

2779 ],

2780}

2781```

2782 

2671### BashOutput2783### BashOutput

2672 2784 

2673**Tool name:** `BashOutput`2785**Tool name:** `BashOutput`

Details

8 8 

9Todo tracking provides a structured way to manage tasks and display progress to users. The Claude Agent SDK includes built-in todo functionality that helps organize complex workflows and keep users informed about task progression.9Todo tracking provides a structured way to manage tasks and display progress to users. The Claude Agent SDK includes built-in todo functionality that helps organize complex workflows and keep users informed about task progression.

10 10 

11<Note>

12 `TodoWrite` is the current default in the Agent SDK and the examples on this page use it. The replacement Task tools are available now behind `CLAUDE_CODE_ENABLE_TASKS=1` and will become the default in a future release. See [Migrate to Task tools](#migrate-to-task-tools) for how monitoring code changes.

13</Note>

14 

11### Todo Lifecycle15### Todo Lifecycle

12 16 

13Todos follow a predictable lifecycle:17Todos follow a predictable lifecycle:


181 ```185 ```

182</CodeGroup>186</CodeGroup>

183 187 

188## Migrate to Task tools

189 

190The Task tools split the single `TodoWrite` call into `TaskCreate` for each new item and `TaskUpdate` for each status change, with `TaskList` and `TaskGet` available for the model to read back the current list. Your monitoring code still inspects `tool_use` blocks in the assistant stream, but maintains a map keyed by task ID instead of replacing the whole list on every call. To opt in before the Task tools become the default, set `CLAUDE_CODE_ENABLE_TASKS=1` in `options.env`.

191 

192| With `TodoWrite` | With Task tools |

193| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

194| One tool call rewrites the full `todos` array | `TaskCreate` adds one item, `TaskUpdate` patches one item by `taskId` |

195| Match `block.name === "TodoWrite"` | Match `block.name === "TaskCreate"` or `"TaskUpdate"` |

196| Item shape: `{ content, status, activeForm }` | `TaskCreate` input: `{ subject, description, activeForm?, metadata? }`. `TaskUpdate` input: `{ taskId, status?, subject?, description?, activeForm?, addBlocks?, addBlockedBy?, owner?, metadata? }`. `status` is `"pending"`, `"in_progress"`, or `"completed"`; set `status: "deleted"` to delete |

197| Render `block.input.todos` directly | Accumulate items across calls, or read a snapshot from a `TaskList` tool result |

198 

199The assigned task ID is not in the `TaskCreate` input. It comes back in the matching `tool_result` as `{ task: { id, subject } }`, so capture it from the result block to key your map. The following example shows the minimal change to the [Monitoring Todo Changes](#monitoring-todo-changes) loop. To render a complete list, watch for a `TaskList` tool result in the stream or accumulate `TaskCreate` results and `TaskUpdate` inputs into a map:

200 

201<CodeGroup>

202 ```typescript TypeScript theme={null}

203 import { query } from "@anthropic-ai/claude-agent-sdk";

204 

205 for await (const message of query({

206 prompt: "Optimize my React app performance",

207 options: { env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "1" } },

208 })) {

209 if (message.type !== "assistant") continue;

210 for (const block of message.message.content) {

211 if (block.type !== "tool_use") continue;

212 if (block.name === "TaskCreate") {

213 const input = block.input as { subject: string };

214 console.log(`+ ${input.subject}`);

215 } else if (block.name === "TaskUpdate") {

216 const input = block.input as { taskId: string; status?: string };

217 if (input.status) console.log(` ${input.taskId} -> ${input.status}`);

218 }

219 }

220 }

221 ```

222 

223 ```python Python theme={null}

224 from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage, ToolUseBlock

225 

226 async for message in query(

227 prompt="Optimize my React app performance",

228 options=ClaudeAgentOptions(env={"CLAUDE_CODE_ENABLE_TASKS": "1"}),

229 ):

230 if not isinstance(message, AssistantMessage):

231 continue

232 for block in message.content:

233 if not isinstance(block, ToolUseBlock):

234 continue

235 if block.name == "TaskCreate":

236 print(f"+ {block.input['subject']}")

237 elif block.name == "TaskUpdate" and block.input.get("status"):

238 print(f" {block.input['taskId']} -> {block.input['status']}")

239 ```

240</CodeGroup>

241 

184## Related Documentation242## Related Documentation

185 243 

186* [TypeScript SDK Reference](/en/agent-sdk/typescript)244* [TypeScript SDK Reference](/en/agent-sdk/typescript)

Details

327`resolveSettings()` accepts a single options object. All fields are optional.327`resolveSettings()` accepts a single options object. All fields are optional.

328 328 

329| Parameter | Type | Default | Description |329| Parameter | Type | Default | Description |

330| :------------------------------ | :------------------------------------ | :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |330| :------------------------------ | :------------------------------------ | :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

331| `options.cwd` | `string` | `process.cwd()` | Directory to resolve project and local settings relative to |331| `options.cwd` | `string` | `process.cwd()` | Directory to resolve project and local settings relative to |

332| `options.settingSources` | [`SettingSource`](#settingsource)`[]` | All sources | Which filesystem sources to load. Pass `[]` to skip user, project, and local settings. Managed policy settings load in all cases |332| `options.settingSources` | [`SettingSource`](#settingsource)`[]` | All sources | Which filesystem sources to load. Pass `[]` to skip user, project, and local settings. Managed policy settings load in all cases |

333| `options.managedSettings` | `Settings` | `undefined` | Restrictive policy-tier settings merged at the managed-policy precedence level. Non-restrictive keys such as `model` are silently dropped |333| `options.managedSettings` | `Settings` | `undefined` | Restrictive policy-tier settings supplied by the embedding host. Dropped by default when an admin-deployed managed tier is present; merged under that tier when [`parentSettingsBehavior`](/en/settings#available-settings) is `"merge"`. Non-restrictive keys such as `model` are silently dropped so this option can tighten managed policy but not loosen it |

334| `options.serverManagedSettings` | `Settings` | `undefined` | Server-managed settings payload from `/api/claude_code/settings`. Non-restrictive keys pass through unfiltered |334| `options.serverManagedSettings` | `Settings` | `undefined` | Server-managed settings payload from `/api/claude_code/settings`. Non-restrictive keys pass through unfiltered |

335 335 

336#### Return type: `ResolvedSettings`336#### Return type: `ResolvedSettings`


396| `mcpServers` | `Record<string, [`McpServerConfig`](#mcpserverconfig)>` | `{}` | MCP server configurations |396| `mcpServers` | `Record<string, [`McpServerConfig`](#mcpserverconfig)>` | `{}` | MCP server configurations |

397| `model` | `string` | Default from CLI | Claude model to use |397| `model` | `string` | Default from CLI | Claude model to use |

398| `outputFormat` | `{ type: 'json_schema', schema: JSONSchema }` | `undefined` | Define output format for agent results. See [Structured outputs](/en/agent-sdk/structured-outputs) for details |398| `outputFormat` | `{ type: 'json_schema', schema: JSONSchema }` | `undefined` | Define output format for agent results. See [Structured outputs](/en/agent-sdk/structured-outputs) for details |

399| `outputStyle` | `string` | `undefined` | Name of an [output style](/en/output-styles) to activate for the session. The style must exist in a loaded `settingSources` location, such as `.claude/output-styles/`. See [Activate an output style](/en/agent-sdk/modifying-system-prompts#activate-an-output-style) |

399| `pathToClaudeCodeExecutable` | `string` | Auto-resolved from bundled native binary | Path to Claude Code executable. Only needed if optional dependencies were skipped during install or your platform isn't in the supported set |400| `pathToClaudeCodeExecutable` | `string` | Auto-resolved from bundled native binary | Path to Claude Code executable. Only needed if optional dependencies were skipped during install or your platform isn't in the supported set |

400| `permissionMode` | [`PermissionMode`](#permissionmode) | `'default'` | Permission mode for the session |401| `permissionMode` | [`PermissionMode`](#permissionmode) | `'default'` | Permission mode for the session |

401| `permissionPromptToolName` | `string` | `undefined` | MCP tool name for permission prompts |402| `permissionPromptToolName` | `string` | `undefined` | MCP tool name for permission prompts |


1840 1841 

1841Creates and manages a structured task list for tracking progress.1842Creates and manages a structured task list for tracking progress.

1842 1843 

1844<Note>

1845 `TodoWrite` is deprecated and will be removed in a future release. Use `TaskCreate`, `TaskGet`, `TaskUpdate`, and `TaskList` instead. Set `CLAUDE_CODE_ENABLE_TASKS=1` to opt in. See [Migrate to Task tools](/en/agent-sdk/todo-tracking#migrate-to-task-tools) for how monitoring code changes.

1846</Note>

1847 

1848### TaskCreate

1849 

1850**Tool name:** `TaskCreate`

1851 

1852```typescript theme={null}

1853// Not yet exported from the SDK; define locally.

1854type TaskCreateInput = {

1855 subject: string;

1856 description: string;

1857 activeForm?: string;

1858 metadata?: Record<string, unknown>;

1859};

1860```

1861 

1862Creates a single task and returns its assigned ID.

1863 

1864### TaskUpdate

1865 

1866**Tool name:** `TaskUpdate`

1867 

1868```typescript theme={null}

1869// Not yet exported from the SDK; define locally.

1870type TaskUpdateInput = {

1871 taskId: string;

1872 status?: "pending" | "in_progress" | "completed" | "deleted";

1873 subject?: string;

1874 description?: string;

1875 activeForm?: string;

1876 addBlocks?: string[];

1877 addBlockedBy?: string[];

1878 owner?: string;

1879 metadata?: Record<string, unknown>;

1880};

1881```

1882 

1883Patches one task by ID. Set `status` to `"deleted"` to remove it.

1884 

1885### TaskGet

1886 

1887**Tool name:** `TaskGet`

1888 

1889```typescript theme={null}

1890// Not yet exported from the SDK; define locally.

1891type TaskGetInput = {

1892 taskId: string;

1893};

1894```

1895 

1896Returns full details for one task, or `null` when the ID is not found.

1897 

1898### TaskList

1899 

1900**Tool name:** `TaskList`

1901 

1902```typescript theme={null}

1903// Not yet exported from the SDK; define locally.

1904type TaskListInput = {};

1905```

1906 

1907Returns a snapshot of all tasks in the current list.

1908 

1843### ExitPlanMode1909### ExitPlanMode

1844 1910 

1845**Tool name:** `ExitPlanMode`1911**Tool name:** `ExitPlanMode`


2272 2338 

2273Returns the previous and updated task lists.2339Returns the previous and updated task lists.

2274 2340 

2341<Note>

2342 `TodoWrite` is deprecated and will be removed in a future release. Use `TaskCreate`, `TaskGet`, `TaskUpdate`, and `TaskList` instead. Set `CLAUDE_CODE_ENABLE_TASKS=1` to opt in. See [Migrate to Task tools](/en/agent-sdk/todo-tracking#migrate-to-task-tools) for how monitoring code changes.

2343</Note>

2344 

2345### TaskCreate

2346 

2347**Tool name:** `TaskCreate`

2348 

2349```typescript theme={null}

2350// Not yet exported from the SDK; define locally.

2351type TaskCreateOutput = {

2352 task: {

2353 id: string;

2354 subject: string;

2355 };

2356};

2357```

2358 

2359Returns the created task with its assigned ID.

2360 

2361### TaskUpdate

2362 

2363**Tool name:** `TaskUpdate`

2364 

2365```typescript theme={null}

2366// Not yet exported from the SDK; define locally.

2367type TaskUpdateOutput = {

2368 success: boolean;

2369 taskId: string;

2370 updatedFields: string[];

2371 error?: string;

2372 statusChange?: {

2373 from: string;

2374 to: string;

2375 };

2376};

2377```

2378 

2379Returns the update result, including which fields changed.

2380 

2381### TaskGet

2382 

2383**Tool name:** `TaskGet`

2384 

2385```typescript theme={null}

2386// Not yet exported from the SDK; define locally.

2387type TaskGetOutput = {

2388 task: {

2389 id: string;

2390 subject: string;

2391 description: string;

2392 status: "pending" | "in_progress" | "completed";

2393 blocks: string[];

2394 blockedBy: string[];

2395 } | null;

2396};

2397```

2398 

2399Returns the full task record, or `null` when the ID is not found.

2400 

2401### TaskList

2402 

2403**Tool name:** `TaskList`

2404 

2405```typescript theme={null}

2406// Not yet exported from the SDK; define locally.

2407type TaskListOutput = {

2408 tasks: Array<{

2409 id: string;

2410 subject: string;

2411 status: "pending" | "in_progress" | "completed";

2412 owner?: string;

2413 blockedBy: string[];

2414 }>;

2415};

2416```

2417 

2418Returns a snapshot of all tasks in the current list.

2419 

2275### ExitPlanMode2420### ExitPlanMode

2276 2421 

2277**Tool name:** `ExitPlanMode`2422**Tool name:** `ExitPlanMode`

Details

232 232 

233* **Approve**: let the tool execute as Claude requested233* **Approve**: let the tool execute as Claude requested

234* **Approve with changes**: modify the input before execution (e.g., sanitize paths, add constraints)234* **Approve with changes**: modify the input before execution (e.g., sanitize paths, add constraints)

235* **Approve and remember**: echo a suggested permission rule back so matching calls skip the prompt next time

235* **Reject**: block the tool and tell Claude why236* **Reject**: block the tool and tell Claude why

236* **Suggest alternative**: block but guide Claude toward what the user wants instead237* **Suggest alternative**: block but guide Claude toward what the user wants instead

237* **Redirect entirely**: use [streaming input](/en/agent-sdk/streaming-vs-single-mode) to send Claude a completely new instruction238* **Redirect entirely**: use [streaming input](/en/agent-sdk/streaming-vs-single-mode) to send Claude a completely new instruction


297 </CodeGroup>298 </CodeGroup>

298 </Tab>299 </Tab>

299 300 

301 <Tab title="Approve and remember">

302 The user approves and doesn't want to be asked again for this kind of call. The third callback argument carries `suggestions`, an array of ready-made [`PermissionUpdate`](/en/agent-sdk/typescript#permissionupdate) entries. Echo one back in `updatedPermissions` to apply it. A suggestion with the `localSettings` destination writes the rule to `.claude/settings.local.json` so future sessions skip the prompt for matching calls.

303 

304 The Python example requires `claude-agent-sdk` 0.1.80 or later.

305 

306 <CodeGroup>

307 ```python Python theme={null}

308 async def can_use_tool(tool_name, input_data, context):

309 choice = await ask_user(f"Allow {tool_name}?", ["once", "always", "no"])

310 

311 if choice == "always":

312 persist = [

313 s for s in context.suggestions if s.destination == "localSettings"

314 ]

315 return PermissionResultAllow(

316 updated_input=input_data, updated_permissions=persist

317 )

318 if choice == "once":

319 return PermissionResultAllow(updated_input=input_data)

320 return PermissionResultDeny(message="User declined")

321 ```

322 

323 ```typescript TypeScript theme={null}

324 canUseTool: async (toolName, input, { suggestions = [] }) => {

325 const choice = await askUser(`Allow ${toolName}?`, ["once", "always", "no"]);

326 

327 if (choice === "always") {

328 const persist = suggestions.filter(

329 (s) => s.destination === "localSettings"

330 );

331 return {

332 behavior: "allow",

333 updatedInput: input,

334 updatedPermissions: persist

335 };

336 }

337 if (choice === "once") {

338 return { behavior: "allow", updatedInput: input };

339 }

340 return { behavior: "deny", message: "User declined" };

341 };

342 ```

343 </CodeGroup>

344 </Tab>

345 

300 <Tab title="Reject">346 <Tab title="Reject">

301 The user doesn't want this action to happen. Block the tool and provide a message explaining why. Claude sees this message and may try a different approach.347 The user doesn't want this action to happen. Block the tool and provide a message explaining why. Claude sees this message and may try a different approach.

302 348 

agent-teams.md +2 −0

Details

129Use Sonnet for each teammate.129Use Sonnet for each teammate.

130```130```

131 131 

132Teammates don't inherit the lead's `/model` selection by default. To change the model used when the prompt doesn't specify one, set **Default teammate model** in `/config`. Pick **Default (leader's model)** to have teammates follow the lead's current model.

133 

132### Require plan approval for teammates134### Require plan approval for teammates

133 135 

134For complex or risky tasks, you can require teammates to plan before implementing. The teammate works in read-only plan mode until the lead approves their approach:136For complex or risky tasks, you can require teammates to plan before implementing. The teammate works in read-only plan mode until the lead approves their approach:

agent-view.md +11 −2

Details

67 ✽ clawd walk cycle Write assets/sprites/clawd-walk.png 3m67 ✽ clawd walk cycle Write assets/sprites/clawd-walk.png 3m

68 68 

69Ready for review69Ready for review

70 ∙ jump physics github.com/anthropics/example/pull/2048 2h70 ∙ jump physics github.com/anthropics/example/pull/20482h

71 71 

72Needs input72Needs input

73 ✻ power-up design needs input: double jump or wall climb? 1m73 ✻ power-up design needs input: double jump or wall climb? 1m


101 101 

102The one-line summary in each row is generated by your configured [Haiku-class model](/en/model-config) so the row can tell you what the session is doing, what it needs, or what it produced without opening the transcript. While a session is actively working, the summary refreshes at most once every 15 seconds, plus once when each turn ends. Each refresh is one short Haiku-class request through your normal provider, billed and handled under the same [data usage terms](/en/data-usage) as the session itself.102The one-line summary in each row is generated by your configured [Haiku-class model](/en/model-config) so the row can tell you what the session is doing, what it needs, or what it produced without opening the transcript. While a session is actively working, the summary refreshes at most once every 15 seconds, plus once when each turn ends. Each refresh is one short Haiku-class request through your normal provider, billed and handled under the same [data usage terms](/en/data-usage) as the session itself.

103 103 

104When a session opens a pull request, the row shows the PR link and a status indicator for its CI checks. For most tasks this row is where you pick up the result: review and merge the pull request when its checks pass.104When a session opens a pull request, a status dot appears at the right edge of the row, linked to the pull request in terminals that support hyperlinks. When the session has opened more than one pull request, the count appears before the dot and the color reflects whichever one most needs attention.

105 

106| Dot color | Pull request status |

107| :-------- | :-------------------------------------------- |

108| Yellow | Waiting on checks or review, or checks failed |

109| Green | Checks passed and no review is blocking |

110| Purple | Merged |

111| Grey | Draft or closed |

112 

113For most tasks this row is where you pick up the result: review and merge the pull request when the dot turns green.

105 114 

106### Peek and reply115### Peek and reply

107 116 

channels.md +2 −0

Details

267 267 

268If Claude hits a permission prompt while you're away from the terminal, the session pauses until you respond. Channel servers that declare the [permission relay capability](/en/channels-reference#relay-permission-prompts) can forward these prompts to you so you can approve or deny remotely. For unattended use, [`--dangerously-skip-permissions`](/en/permission-modes#skip-all-checks-with-bypasspermissions-mode) bypasses prompts entirely, but only use it in environments you trust.268If Claude hits a permission prompt while you're away from the terminal, the session pauses until you respond. Channel servers that declare the [permission relay capability](/en/channels-reference#relay-permission-prompts) can forward these prompts to you so you can approve or deny remotely. For unattended use, [`--dangerously-skip-permissions`](/en/permission-modes#skip-all-checks-with-bypasspermissions-mode) bypasses prompts entirely, but only use it in environments you trust.

269 269 

270When you run channels in non-interactive mode with `-p`, tools that need terminal input, such as multiple-choice questions and plan mode approval, are disabled so the session never stalls waiting for input.

271 

270## Security272## Security

271 273 

272Every approved channel plugin maintains a sender allowlist: only IDs you've added can push messages, and everyone else is silently dropped.274Every approved channel plugin maintains a sender allowlist: only IDs you've added can push messages, and everyone else is silently dropped.

Details

20* [What you need](#what-you-need): requirements and general steps20* [What you need](#what-you-need): requirements and general steps

21* [Example: build a webhook receiver](#example-build-a-webhook-receiver): a minimal one-way walkthrough21* [Example: build a webhook receiver](#example-build-a-webhook-receiver): a minimal one-way walkthrough

22* [Server options](#server-options): the constructor fields22* [Server options](#server-options): the constructor fields

23* [Notification format](#notification-format): the event payload23* [Notification format](#notification-format): the event payload and delivery behavior

24* [Expose a reply tool](#expose-a-reply-tool): let Claude send messages back24* [Expose a reply tool](#expose-a-reply-tool): let Claude send messages back

25* [Gate inbound messages](#gate-inbound-messages): sender checks to prevent prompt injection25* [Gate inbound messages](#gate-inbound-messages): sender checks to prevent prompt injection

26* [Relay permission prompts](#relay-permission-prompts): forward tool approval prompts to remote channels26* [Relay permission prompts](#relay-permission-prompts): forward tool approval prompts to remote channels


241</channel>241</channel>

242```242```

243 243 

244Notifications are not acknowledged. The `await` on `mcp.notification()` resolves when the message is written to the transport, not when Claude has processed it. If the session hasn't loaded your server as a channel, or the organization policy blocks it, events are dropped silently with no error returned to your server.

245 

246If you need delivery confirmation, track event state in your server and expose a [reply tool](#expose-a-reply-tool) that Claude can call to report status back.

247 

248Events queue into the session and are processed in order. If several notifications arrive while Claude is busy, they're delivered together on the next turn and Claude handles them as a group. To process independent event streams concurrently, run separate sessions.

249 

244## Expose a reply tool250## Expose a reply tool

245 251 

246If your channel is two-way, like a chat bridge rather than an alert forwarder, expose a standard [MCP tool](https://modelcontextprotocol.io/docs/concepts/tools) that Claude can call to send messages back. Nothing about the tool registration is channel-specific. A reply tool has three components:252If your channel is two-way, like a chat bridge rather than an alert forwarder, expose a standard [MCP tool](https://modelcontextprotocol.io/docs/concepts/tools) that Claude can call to send messages back. Nothing about the tool registration is channel-specific. A reply tool has three components:

Details

1497| Path under `~/.claude/` | Contents |1497| Path under `~/.claude/` | Contents |

1498| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |1498| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |

1499| `projects/<project>/<session>.jsonl` | Full conversation transcript: every message, tool call, and tool result |1499| `projects/<project>/<session>.jsonl` | Full conversation transcript: every message, tool call, and tool result |

1500| `projects/<project>/<session>/subagents/` | [Subagent](/en/sub-agents) conversation transcripts, removed with the parent session transcript when it ages out |

1500| `projects/<project>/<session>/tool-results/` | Large tool outputs spilled to separate files |1501| `projects/<project>/<session>/tool-results/` | Large tool outputs spilled to separate files |

1501| `file-history/<session>/` | Pre-edit snapshots of files Claude changed, used for [checkpoint restore](/en/checkpointing) |1502| `file-history/<session>/` | Pre-edit snapshots of files Claude changed, used for [checkpoint restore](/en/checkpointing) |

1502| `plans/` | Plan files written during [plan mode](/en/permission-modes#analyze-before-you-edit-with-plan-mode) |1503| `plans/` | Plan files written during [plan mode](/en/permission-modes#analyze-before-you-edit-with-plan-mode) |


1512The following paths are not covered by automatic cleanup and persist indefinitely.1513The following paths are not covered by automatic cleanup and persist indefinitely.

1513 1514 

1514| Path under `~/.claude/` | Contents |1515| Path under `~/.claude/` | Contents |

1515| ----------------------- | ------------------------------------------------------------------------------------- |1516| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

1516| `history.jsonl` | Every prompt you've typed, with timestamp and project path. Used for up-arrow recall. |1517| `history.jsonl` | Every prompt you've typed, with timestamp and project path. Used for up-arrow recall. |

1517| `stats-cache.json` | Aggregated token and cost counts shown by `/usage` |1518| `stats-cache.json` | Aggregated token and cost counts shown by `/usage` |

1519| `remote-settings.json` | Cached copy of [server-managed settings](/en/server-managed-settings) for your organization. Only present when your organization has configured them. Refreshed on each launch. |

1518| `todos/` | Legacy per-session task lists. No longer written by current versions; safe to delete. |1520| `todos/` | Legacy per-session task lists. No longer written by current versions; safe to delete. |

1519 1521 

1520Other small cache and lock files appear depending on which features you use and are safe to delete.1522Other small cache and lock files appear depending on which features you use and are safe to delete.


1570| `~/.claude/history.jsonl` | Up-arrow prompt recall |1572| `~/.claude/history.jsonl` | Up-arrow prompt recall |

1571| `~/.claude/file-history/` | Checkpoint restore for past sessions |1573| `~/.claude/file-history/` | Checkpoint restore for past sessions |

1572| `~/.claude/stats-cache.json` | Historical totals shown by `/usage` |1574| `~/.claude/stats-cache.json` | Historical totals shown by `/usage` |

1575| `~/.claude/remote-settings.json` | Nothing. Re-fetched on next launch. |

1573| `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/` | Nothing user-facing |1576| `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/` | Nothing user-facing |

1574| `~/.claude/todos/` | Nothing. Legacy directory not written by current versions. |1577| `~/.claude/todos/` | Nothing. Legacy directory not written by current versions. |

1575 1578 

data-usage.md +2 −2

Details

33* **No**: declines without sending anything33* **No**: declines without sending anything

34* **Don't ask again**: declines and stops this follow-up from appearing in future sessions34* **Don't ask again**: declines and stops this follow-up from appearing in future sessions

35 35 

36Nothing is uploaded unless you explicitly select **Yes**. Organizations with [zero data retention](/en/zero-data-retention), or where product feedback is disabled by organization policy, never see this follow-up. Your responses to this survey, including session transcripts submitted after the rating prompt, do not impact your data training preferences and cannot be used to train our AI models.36Nothing is uploaded unless you explicitly select **Yes**. Organizations with [zero data retention](/en/zero-data-retention), or where product feedback is disabled by organization policy, or where `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set, never see this follow-up. Your responses to this survey, including session transcripts submitted after the rating prompt, do not impact your data training preferences and cannot be used to train our AI models.

37 37 

38To disable these surveys, set `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1`. The survey is also disabled when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. To control frequency instead of disabling, set [`feedbackSurveyRate`](/en/settings#available-settings) in your settings file to a probability between `0` and `1`.38To disable these surveys, set `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1`. The survey is also disabled when `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. Organizations that block nonessential traffic but capture survey responses through their own [OpenTelemetry collector](/en/monitoring-usage) can opt the survey back in by setting `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL=1`. The survey then logs ratings to the configured collector only. The transcript-share follow-up and all other Anthropic-bound feedback traffic stay disabled. To control frequency instead of disabling, set [`feedbackSurveyRate`](/en/settings#available-settings) in your settings file to a probability between `0` and `1`.

39 39 

40### Data retention40### Data retention

41 41 

Details

364 364 

365Official Anthropic marketplaces have auto-update enabled by default. Third-party and local development marketplaces have auto-update disabled by default.365Official Anthropic marketplaces have auto-update enabled by default. Third-party and local development marketplaces have auto-update disabled by default.

366 366 

367Administrators can also set `"autoUpdate": true` on each [`extraKnownMarketplaces`](/en/settings#extraknownmarketplaces) entry in managed settings to enable auto-update for an organization marketplace without requiring each user to toggle it.

368 

367To disable all automatic updates entirely for both Claude Code and all plugins, set the `DISABLE_AUTOUPDATER` environment variable. See [Auto updates](/en/setup#auto-updates) for details.369To disable all automatic updates entirely for both Claude Code and all plugins, set the `DISABLE_AUTOUPDATER` environment variable. See [Auto updates](/en/setup#auto-updates) for details.

368 370 

369To keep plugin auto-updates enabled while disabling Claude Code auto-updates, set `FORCE_AUTOUPDATE_PLUGINS=1` along with `DISABLE_AUTOUPDATER`:371To keep plugin auto-updates enabled while disabling Claude Code auto-updates, set `FORCE_AUTOUPDATE_PLUGINS=1` along with `DISABLE_AUTOUPDATER`:

env-vars.md +6 −2

Details

81| `CLAUDE_CODE_DISABLE_CRON` | Set to `1` to disable [scheduled tasks](/en/scheduled-tasks). The `/loop` skill and cron tools become unavailable and any already-scheduled tasks stop firing, including tasks that are already running mid-session |81| `CLAUDE_CODE_DISABLE_CRON` | Set to `1` to disable [scheduled tasks](/en/scheduled-tasks). The `/loop` skill and cron tools become unavailable and any already-scheduled tasks stop firing, including tasks that are already running mid-session |

82| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to strip Anthropic-specific `anthropic-beta` request headers and beta tool-schema fields (such as `defer_loading` and `eager_input_streaming`) from API requests. Use this when a proxy gateway rejects requests with errors like "Unexpected value(s) for the `anthropic-beta` header" or "Extra inputs are not permitted". Standard fields (`name`, `description`, `input_schema`, `cache_control`) are preserved. |82| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to strip Anthropic-specific `anthropic-beta` request headers and beta tool-schema fields (such as `defer_loading` and `eager_input_streaming`) from API requests. Use this when a proxy gateway rejects requests with errors like "Unexpected value(s) for the `anthropic-beta` header" or "Extra inputs are not permitted". Standard fields (`name`, `description`, `input_schema`, `cache_control`) are preserved. |

83| `CLAUDE_CODE_DISABLE_FAST_MODE` | Set to `1` to disable [fast mode](/en/fast-mode) |83| `CLAUDE_CODE_DISABLE_FAST_MODE` | Set to `1` to disable [fast mode](/en/fast-mode) |

84| `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY` | Set to `1` to disable the "How is Claude doing?" session quality surveys. Surveys are also disabled when `DISABLE_TELEMETRY` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set. To set a sample rate instead of disabling outright, use the [`feedbackSurveyRate`](/en/settings#available-settings) setting. See [Session quality surveys](/en/data-usage#session-quality-surveys) |84| `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY` | Set to `1` to disable the "How is Claude doing?" session quality surveys. Surveys are also disabled when `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` is set, unless `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL` opts back in. To set a sample rate instead of disabling outright, use the [`feedbackSurveyRate`](/en/settings#available-settings) setting. See [Session quality surveys](/en/data-usage#session-quality-surveys) |

85| `CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING` | Set to `1` to disable file [checkpointing](/en/checkpointing). The `/rewind` command will not be able to restore code changes |85| `CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING` | Set to `1` to disable file [checkpointing](/en/checkpointing). The `/rewind` command will not be able to restore code changes |

86| `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS` | Set to `1` to remove built-in commit and PR workflow instructions and the git status snapshot from Claude's system prompt. Useful when using your own git workflow skills. Takes precedence over the [`includeGitInstructions`](/en/settings#available-settings) setting when set |86| `CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS` | Set to `1` to remove built-in commit and PR workflow instructions and the git status snapshot from Claude's system prompt. Useful when using your own git workflow skills. Takes precedence over the [`includeGitInstructions`](/en/settings#available-settings) setting when set |

87| `CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP` | Set to `1` to prevent automatic remapping of Opus 4.0 and 4.1 to the current Opus version on the Anthropic API. Use when you intentionally want to pin an older model. The remap does not run on Bedrock, Vertex, or Foundry |87| `CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP` | Set to `1` to prevent automatic remapping of Opus 4.0 and 4.1 to the current Opus version on the Anthropic API. Use when you intentionally want to pin an older model. The remap does not run on Bedrock, Vertex, or Foundry |


96| `CLAUDE_CODE_EFFORT_LEVEL` | Set the effort level for supported models. Values: `low`, `medium`, `high`, `xhigh`, `max`, or `auto` to use the model default. Available levels depend on the model. Takes precedence over `/effort` and the `effortLevel` setting. See [Adjust effort level](/en/model-config#adjust-effort-level) |96| `CLAUDE_CODE_EFFORT_LEVEL` | Set the effort level for supported models. Values: `low`, `medium`, `high`, `xhigh`, `max`, or `auto` to use the model default. Available levels depend on the model. Takes precedence over `/effort` and the `effortLevel` setting. See [Adjust effort level](/en/model-config#adjust-effort-level) |

97| `CLAUDE_CODE_ENABLE_AWAY_SUMMARY` | Override [session recap](/en/interactive-mode#session-recap) availability. Set to `0` to force recaps off regardless of the `/config` toggle. Set to `1` to force recaps on when [`awaySummaryEnabled`](/en/settings#available-settings) is `false`. Takes precedence over the setting and `/config` toggle |97| `CLAUDE_CODE_ENABLE_AWAY_SUMMARY` | Override [session recap](/en/interactive-mode#session-recap) availability. Set to `0` to force recaps off regardless of the `/config` toggle. Set to `1` to force recaps on when [`awaySummaryEnabled`](/en/settings#available-settings) is `false`. Takes precedence over the setting and `/config` toggle |

98| `CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH` | Set to `1` to refresh plugin state at turn boundaries in [non-interactive mode](/en/headless) after a background install completes. Off by default because the refresh changes the system prompt mid-session, which invalidates [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for that turn |98| `CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH` | Set to `1` to refresh plugin state at turn boundaries in [non-interactive mode](/en/headless) after a background install completes. Off by default because the refresh changes the system prompt mid-session, which invalidates [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for that turn |

99| `CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL` | Set to `1` to route the "How is Claude doing?" session quality survey to your own [OpenTelemetry collector](/en/monitoring-usage) when Anthropic-bound nonessential traffic is blocked. Survey ratings are emitted only as OTEL events to your configured collector. No survey data is sent to Anthropic in this mode. Applies when `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_TELEMETRY`, or `DO_NOT_TRACK` is set, and has no effect otherwise. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY` and the organization product feedback policy take precedence |

99| `CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING` | Controls whether tool call inputs stream from the API as Claude generates them. With this off, a large tool input such as a long file write arrives only after Claude finishes generating it, which can look like it's hanging. Enabled by default on the Anthropic API. On Bedrock and Vertex, enabled per model where the deployed container supports it. Set to `0` to opt out. Set to `1` to force on when routing through a proxy via `ANTHROPIC_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_BEDROCK_BASE_URL`. Off by default on Foundry and [gateway](/en/llm-gateway) connections |100| `CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING` | Controls whether tool call inputs stream from the API as Claude generates them. With this off, a large tool input such as a long file write arrives only after Claude finishes generating it, which can look like it's hanging. Enabled by default on the Anthropic API. On Bedrock and Vertex, enabled per model where the deployed container supports it. Set to `0` to opt out. Set to `1` to force on when routing through a proxy via `ANTHROPIC_BASE_URL`, `ANTHROPIC_VERTEX_BASE_URL`, or `ANTHROPIC_BEDROCK_BASE_URL`. Off by default on Foundry and [gateway](/en/llm-gateway) connections |

100| `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` | Set to `1` to populate the `/model` picker from your gateway's `/v1/models` endpoint when `ANTHROPIC_BASE_URL` points at an Anthropic-compatible gateway such as LiteLLM, Kong, or an internal proxy. Off by default because gateways backed by a shared API key would otherwise show every user every model the key can access. Discovered models are still filtered by the [`availableModels`](/en/settings#available-settings) allowlist |101| `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` | Set to `1` to populate the `/model` picker from your gateway's `/v1/models` endpoint when `ANTHROPIC_BASE_URL` points at an Anthropic-compatible gateway such as LiteLLM, Kong, or an internal proxy. Off by default because gateways backed by a shared API key would otherwise show every user every model the key can access. Discovered models are still filtered by the [`availableModels`](/en/settings#available-settings) allowlist |

102| `CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE` | Set to `1` to run [fast mode](/en/fast-mode) on Claude Opus 4.7 instead of Opus 4.6. With the variable set, `/fast` switches to Opus 4.7; without it, `/fast` continues to use Opus 4.6 |

101| `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION` | Set to `false` to disable prompt suggestions (the "Prompt suggestions" toggle in `/config`). These are the grayed-out predictions that appear in your prompt input after Claude responds. See [Prompt suggestions](/en/interactive-mode#prompt-suggestions) |103| `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION` | Set to `false` to disable prompt suggestions (the "Prompt suggestions" toggle in `/config`). These are the grayed-out predictions that appear in your prompt input after Claude responds. See [Prompt suggestions](/en/interactive-mode#prompt-suggestions) |

102| `CLAUDE_CODE_ENABLE_TASKS` | Set to `1` to enable the task tracking system in non-interactive mode (the `-p` flag). Tasks are on by default in interactive mode. See [Task list](/en/interactive-mode#task-list) |104| `CLAUDE_CODE_ENABLE_TASKS` | Set to `1` to enable the task tracking system in non-interactive mode (the `-p` flag). Tasks are on by default in interactive mode. See [Task list](/en/interactive-mode#task-list) |

103| `CLAUDE_CODE_ENABLE_TELEMETRY` | Set to `1` to enable OpenTelemetry data collection for metrics and logging. Required before configuring OTel exporters. See [Monitoring](/en/monitoring-usage) |105| `CLAUDE_CODE_ENABLE_TELEMETRY` | Set to `1` to enable OpenTelemetry data collection for metrics and logging. Required before configuring OTel exporters. See [Monitoring](/en/monitoring-usage) |


127| `CLAUDE_CODE_OAUTH_REFRESH_TOKEN` | OAuth refresh token for Claude.ai authentication. When set, `claude auth login` exchanges this token directly instead of opening a browser. Requires `CLAUDE_CODE_OAUTH_SCOPES`. Useful for provisioning authentication in automated environments |129| `CLAUDE_CODE_OAUTH_REFRESH_TOKEN` | OAuth refresh token for Claude.ai authentication. When set, `claude auth login` exchanges this token directly instead of opening a browser. Requires `CLAUDE_CODE_OAUTH_SCOPES`. Useful for provisioning authentication in automated environments |

128| `CLAUDE_CODE_OAUTH_SCOPES` | Space-separated OAuth scopes the refresh token was issued with, such as `"user:profile user:inference user:sessions:claude_code"`. Required when `CLAUDE_CODE_OAUTH_REFRESH_TOKEN` is set |130| `CLAUDE_CODE_OAUTH_SCOPES` | Space-separated OAuth scopes the refresh token was issued with, such as `"user:profile user:inference user:sessions:claude_code"`. Required when `CLAUDE_CODE_OAUTH_REFRESH_TOKEN` is set |

129| `CLAUDE_CODE_OAUTH_TOKEN` | OAuth access token for Claude.ai authentication. Alternative to `/login` for SDK and automated environments. Takes precedence over keychain-stored credentials. Generate one with [`claude setup-token`](/en/authentication#generate-a-long-lived-token) |131| `CLAUDE_CODE_OAUTH_TOKEN` | OAuth access token for Claude.ai authentication. Alternative to `/login` for SDK and automated environments. Takes precedence over keychain-stored credentials. Generate one with [`claude setup-token`](/en/authentication#generate-a-long-lived-token) |

132| `CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE` | Set to `1` to keep [fast mode](/en/fast-mode) on Claude Opus 4.6. Takes precedence over `CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE`, so set this if you need to pin Opus 4.6 regardless of how the default changes |

130| `CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS` | Timeout in milliseconds for flushing pending OpenTelemetry spans (default: 5000). See [Monitoring](/en/monitoring-usage) |133| `CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS` | Timeout in milliseconds for flushing pending OpenTelemetry spans (default: 5000). See [Monitoring](/en/monitoring-usage) |

131| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) |134| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) |

132| `CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS` | Timeout in milliseconds for the OpenTelemetry exporter to finish on shutdown (default: 2000). Increase if metrics are dropped at exit. See [Monitoring](/en/monitoring-usage) |135| `CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS` | Timeout in milliseconds for the OpenTelemetry exporter to finish on shutdown (default: 2000). Increase if metrics are dropped at exit. See [Monitoring](/en/monitoring-usage) |


141| `CLAUDE_CODE_REMOTE` | Set automatically to `true` when Claude Code is running as a [cloud session](/en/claude-code-on-the-web). Read this from a hook or setup script to detect whether you are in a cloud environment |144| `CLAUDE_CODE_REMOTE` | Set automatically to `true` when Claude Code is running as a [cloud session](/en/claude-code-on-the-web). Read this from a hook or setup script to detect whether you are in a cloud environment |

142| `CLAUDE_CODE_REMOTE_SESSION_ID` | Set automatically in [cloud sessions](/en/claude-code-on-the-web) to the current session's ID. Read this to construct a link back to the session transcript. See [Link artifacts back to the session](/en/claude-code-on-the-web#link-artifacts-back-to-the-session) |145| `CLAUDE_CODE_REMOTE_SESSION_ID` | Set automatically in [cloud sessions](/en/claude-code-on-the-web) to the current session's ID. Read this to construct a link back to the session transcript. See [Link artifacts back to the session](/en/claude-code-on-the-web#link-artifacts-back-to-the-session) |

143| `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` | Set to `1` to automatically resume if the previous session ended mid-turn. Used in SDK mode so the model continues without requiring the SDK to re-send the prompt |146| `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` | Set to `1` to automatically resume if the previous session ended mid-turn. Used in SDK mode so the model continues without requiring the SDK to re-send the prompt |

147| `CLAUDE_CODE_RESUME_PROMPT` | Override the continuation message injected when resuming a session that ended mid-turn. Defaults to `Continue from where you left off.`. Spawn scripts for long-running agents can set this to a more directive boot message. An empty string uses the default |

144| `CLAUDE_CODE_SCRIPT_CAPS` | JSON object limiting how many times specific scripts may be invoked per session when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set. Keys are substrings matched against the command text; values are integer call limits. For example, `{"deploy.sh": 2}` allows `deploy.sh` to be called at most twice. Matching is substring-based so shell-expansion tricks like `./scripts/deploy.sh $(evil)` still count against the cap. Runtime fan-out via `xargs` or `find -exec` is not detected; this is a defense-in-depth control |148| `CLAUDE_CODE_SCRIPT_CAPS` | JSON object limiting how many times specific scripts may be invoked per session when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set. Keys are substrings matched against the command text; values are integer call limits. For example, `{"deploy.sh": 2}` allows `deploy.sh` to be called at most twice. Matching is substring-based so shell-expansion tricks like `./scripts/deploy.sh $(evil)` still count against the cap. Runtime fan-out via `xargs` or `find -exec` is not detected; this is a defense-in-depth control |

145| `CLAUDE_CODE_SCROLL_SPEED` | Set the mouse wheel scroll multiplier in [fullscreen rendering](/en/fullscreen#mouse-wheel-scrolling). Accepts values from 1 to 20. Set to `3` to match `vim` if your terminal sends one wheel event per notch without amplification. Ignored in the JetBrains IDE terminal, where Claude Code uses its own scroll handling |149| `CLAUDE_CODE_SCROLL_SPEED` | Set the mouse wheel scroll multiplier in [fullscreen rendering](/en/fullscreen#mouse-wheel-scrolling). Accepts values from 1 to 20. Set to `3` to match `vim` if your terminal sends one wheel event per notch without amplification. Ignored in the JetBrains IDE terminal, where Claude Code uses its own scroll handling |

146| `CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS` | Override the time budget in milliseconds for [SessionEnd](/en/hooks#sessionend) hooks. Applies to session exit, `/clear`, and switching sessions via interactive `/resume`. By default the budget is 1.5 seconds, automatically raised to the highest per-hook `timeout` configured in settings files, up to 60 seconds. Timeouts on plugin-provided hooks do not raise the budget |150| `CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS` | Override the time budget in milliseconds for [SessionEnd](/en/hooks#sessionend) hooks. Applies to session exit, `/clear`, and switching sessions via interactive `/resume`. By default the budget is 1.5 seconds, automatically raised to the highest per-hook `timeout` configured in settings files, up to 60 seconds. Timeouts on plugin-provided hooks do not raise the budget |


203| `ENABLE_CLAUDEAI_MCP_SERVERS` | Set to `false` to disable [claude.ai MCP servers](/en/mcp#use-mcp-servers-from-claude-ai) in Claude Code. Enabled by default for logged-in users |207| `ENABLE_CLAUDEAI_MCP_SERVERS` | Set to `false` to disable [claude.ai MCP servers](/en/mcp#use-mcp-servers-from-claude-ai) in Claude Code. Enabled by default for logged-in users |

204| `ENABLE_PROMPT_CACHING_1H` | Set to `1` to request a 1-hour prompt cache TTL instead of the default 5 minutes. Intended for API key, [Bedrock](/en/amazon-bedrock), [Vertex](/en/google-vertex-ai), [Foundry](/en/microsoft-foundry), and [Claude Platform on AWS](/en/claude-platform-on-aws) users. Subscription users receive 1-hour TTL automatically. 1-hour cache writes are billed at a higher rate |208| `ENABLE_PROMPT_CACHING_1H` | Set to `1` to request a 1-hour prompt cache TTL instead of the default 5 minutes. Intended for API key, [Bedrock](/en/amazon-bedrock), [Vertex](/en/google-vertex-ai), [Foundry](/en/microsoft-foundry), and [Claude Platform on AWS](/en/claude-platform-on-aws) users. Subscription users receive 1-hour TTL automatically. 1-hour cache writes are billed at a higher rate |

205| `ENABLE_PROMPT_CACHING_1H_BEDROCK` | Deprecated. Use `ENABLE_PROMPT_CACHING_1H` instead |209| `ENABLE_PROMPT_CACHING_1H_BEDROCK` | Deprecated. Use `ENABLE_PROMPT_CACHING_1H` instead |

206| `ENABLE_TOOL_SEARCH` | Controls [MCP tool search](/en/mcp#scale-with-mcp-tool-search). Unset: all MCP tools deferred by default, but loaded upfront on Vertex AI or when `ANTHROPIC_BASE_URL` points to a non-first-party host. Values: `true` (always defer including proxies and Vertex AI), `auto` (threshold mode: load upfront if tools fit within 10% of context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `false` (load all upfront) |210| `ENABLE_TOOL_SEARCH` | Controls [MCP tool search](/en/mcp#scale-with-mcp-tool-search). Unset: all MCP tools deferred by default, but loaded upfront on Vertex AI or when `ANTHROPIC_BASE_URL` points to a non-first-party host. Values: `true` (always defer and send the beta header, requests fail on Vertex AI or proxies that do not support `tool_reference`), `auto` (threshold mode: load upfront if tools fit within 10% of context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `false` (load all upfront) |

207| `FALLBACK_FOR_ALL_PRIMARY_MODELS` | Set to any non-empty value to trigger fallback to [`--fallback-model`](/en/cli-reference#cli-flags) after repeated overload errors on any primary model. By default, only Opus models trigger the fallback |211| `FALLBACK_FOR_ALL_PRIMARY_MODELS` | Set to any non-empty value to trigger fallback to [`--fallback-model`](/en/cli-reference#cli-flags) after repeated overload errors on any primary model. By default, only Opus models trigger the fallback |

208| `FORCE_AUTOUPDATE_PLUGINS` | Set to `1` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER` |212| `FORCE_AUTOUPDATE_PLUGINS` | Set to `1` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER` |

209| `FORCE_PROMPT_CACHING_5M` | Set to `1` to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply. Overrides `ENABLE_PROMPT_CACHING_1H` |213| `FORCE_PROMPT_CACHING_5M` | Set to `1` to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply. Overrides `ENABLE_PROMPT_CACHING_1H` |

fast-mode.md +46 −10

Details

4 4 

5# Speed up responses with fast mode5# Speed up responses with fast mode

6 6 

7> Get faster Opus 4.6 responses in Claude Code by toggling fast mode.7> Get faster Opus responses in Claude Code by toggling fast mode.

8 8 

9<Note>9<Note>

10 Fast mode is in [research preview](#research-preview). The feature, pricing, and availability may change based on feedback.10 Fast mode is in [research preview](#research-preview). The feature, pricing, and availability may change based on feedback.

11</Note>11</Note>

12 12 

13Fast mode is a high-speed configuration for Claude Opus 4.6, making the model 2.5x faster at a higher cost per token. Toggle it on with `/fast` when you need speed for interactive work like rapid iteration or live debugging, and toggle it off when cost matters more than latency.13Fast mode is a high-speed configuration for Claude Opus, making the model 2.5x faster at a higher cost per token. Toggle it on with `/fast` when you need speed for interactive work like rapid iteration or live debugging, and toggle it off when cost matters more than latency.

14 14 

15Fast mode is not a different model. It uses the same Opus 4.6 with a different API configuration that prioritizes speed over cost efficiency. You get identical quality and capabilities, just faster responses. Fast mode is not available on Opus 4.7 or other models.15Fast mode is not a different model. It uses Claude Opus with a different API configuration that prioritizes speed over cost efficiency. You get identical quality and capabilities, just faster responses. Fast mode is supported on Opus 4.6 and Opus 4.7. It is not available on Sonnet, Haiku, or other models.

16 16 

17<Note>17<Note>

18 Fast mode requires Claude Code v2.1.36 or later. Check your version with `claude --version`.18 Fast mode requires Claude Code v2.1.36 or later. Check your version with `claude --version`.


21What to know:21What to know:

22 22 

23* Use `/fast` to toggle on fast mode in Claude Code CLI. Also available via `/fast` in Claude Code VS Code Extension.23* Use `/fast` to toggle on fast mode in Claude Code CLI. Also available via `/fast` in Claude Code VS Code Extension.

24* Fast mode for Opus 4.6 pricing is \$30/150 MTok.24* By default, `/fast` runs on Opus 4.6. To run fast mode on Opus 4.7 instead, set the [`CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE`](#use-fast-mode-on-opus-4-7) environment variable.

25* Fast mode pricing is \$30/150 MTok on both Opus 4.6 and Opus 4.7.

25* Available to all Claude Code users on subscription plans (Pro/Max/Team/Enterprise) and Claude Console.26* Available to all Claude Code users on subscription plans (Pro/Max/Team/Enterprise) and Claude Console.

26* For Claude Code users on subscription plans (Pro/Max/Team/Enterprise), fast mode is available via extra usage only and not included in the subscription rate limits.27* For Claude Code users on subscription plans (Pro/Max/Team/Enterprise), fast mode is available via extra usage only and not included in the subscription rate limits.

27 28 

28This page covers how to [toggle fast mode](#toggle-fast-mode), its [cost tradeoff](#understand-the-cost-tradeoff), [when to use it](#decide-when-to-use-fast-mode), [requirements](#requirements), [per-session opt-in](#require-per-session-opt-in), and [rate limit behavior](#handle-rate-limits).29This page covers how to [toggle fast mode](#toggle-fast-mode), [use fast mode on Opus 4.7](#use-fast-mode-on-opus-4-7), the [cost tradeoff](#understand-the-cost-tradeoff), [when to use it](#decide-when-to-use-fast-mode), [requirements](#requirements), [per-session opt-in](#require-per-session-opt-in), and [rate limit behavior](#handle-rate-limits).

29 30 

30## Toggle fast mode31## Toggle fast mode

31 32 


40 41 

41When you enable fast mode:42When you enable fast mode:

42 43 

43* If you're on a different model, Claude Code automatically switches to Opus 4.644* If you're on a different model, Claude Code automatically switches to the fast mode model: Opus 4.6 by default, or Opus 4.7 when [`CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE`](#use-fast-mode-on-opus-4-7) is set.

44* You'll see a confirmation message: "Fast mode ON"45* You'll see a confirmation message: "Fast mode ON"

45* A small `↯` icon appears next to the prompt while fast mode is active46* A small `↯` icon appears next to the prompt while fast mode is active

46* Run `/fast` again at any time to check whether fast mode is on or off47* Run `/fast` again at any time to check whether fast mode is on or off

47 48 

48When you disable fast mode with `/fast` again, you remain on Opus 4.6. The model does not revert to your previous model. To switch to a different model, use `/model`.49When you disable fast mode with `/fast` again, you remain on the same Opus version that fast mode was running on. The model does not revert to your previous model. To switch to a different model, use `/model`.

50 

51## Use fast mode on Opus 4.7

52 

53<Note>

54 Fast mode on Opus 4.7 requires Claude Code v2.1.139 or later.

55</Note>

56 

57Fast mode for Claude Opus 4.7 is in research preview. It runs at the same 2.5x speed and the same price as fast mode for Opus 4.6, with no other behavior changes.

58 

59<Note>

60 On May 14, 2026, Opus 4.7 becomes the default fast mode model. Until then, opt in by setting `CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE=1`.

61</Note>

62 

63To opt in, set `CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE=1` before launching Claude Code. With the variable set, `/fast` runs on Opus 4.7. Without it, `/fast` continues to run on Opus 4.6.

64 

65You can set the variable as a shell export:

66 

67```bash theme={null}

68export CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE=1

69```

70 

71Or in any Claude Code [settings file](/en/settings#settings-files), including user, project, and managed settings, to scope the opt-in:

72 

73```json theme={null}

74{

75 "env": {

76 "CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE": "1"

77 }

78}

79```

80 

81Fast mode for Opus 4.6 remains available alongside Opus 4.7. The two share the same fast mode rate limit pool: usage on either model draws from the same limits.

82 

83To pin fast mode to Opus 4.6 explicitly, set `CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE=1`. This variable takes precedence, so fast mode runs on Opus 4.6 regardless of whether `CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE` is set.

49 84 

50## Understand the cost tradeoff85## Understand the cost tradeoff

51 86 

52Fast mode has higher per-token pricing than standard Opus 4.6:87Fast mode has higher per-token pricing than standard Opus:

53 88 

54| Mode | Input (MTok) | Output (MTok) |89| Mode | Input (MTok) | Output (MTok) |

55| --------------------- | ------------ | ------------- |90| --------------------- | ------------ | ------------- |

56| Fast mode on Opus 4.6 | \$30 | \$150 |91| Fast mode on Opus 4.6 | \$30 | \$150 |

92| Fast mode on Opus 4.7 | \$30 | \$150 |

57 93 

58Fast mode pricing is flat across the full 1M token context window.94Fast mode pricing is flat across the full 1M token context window.

59 95 


124 160 

125## Handle rate limits161## Handle rate limits

126 162 

127Fast mode has separate rate limits from standard Opus 4.6. When you hit the fast mode rate limit or run out of extra usage:163Fast mode has separate rate limits from standard Opus. Fast mode for Opus 4.6 and Opus 4.7 share the same rate limit pool: usage on either model draws from the same limits. When you hit the fast mode rate limit or run out of extra usage:

128 164 

1291. Fast mode automatically falls back to standard Opus 4.61651. Fast mode automatically falls back to standard speed on the same Opus version

1302. The `↯` icon turns gray to indicate cooldown1662. The `↯` icon turns gray to indicate cooldown

1313. You continue working at standard speed and pricing1673. You continue working at standard speed and pricing

1324. When the cooldown expires, fast mode automatically re-enables1684. When the cooldown expires, fast mode automatically re-enables

goal.md +1 −1

Details

128 128 

129## Requirements129## Requirements

130 130 

131`/goal` runs only in workspaces where you have accepted the trust dialog, because the evaluator is part of the hooks system. If [`disableAllHooks`](/en/hooks#disable-or-remove-hooks) is set in managed policy settings, `/goal` is unavailable. In both cases, the command tells you why instead of silently doing nothing.131`/goal` runs only in workspaces where you have accepted the trust dialog, because the evaluator is part of the hooks system. `/goal` is also unavailable when [`disableAllHooks`](/en/hooks#disable-or-remove-hooks) is set at any settings level or when [`allowManagedHooksOnly`](/en/settings#hook-configuration) is set in managed settings. In each case, the command tells you why instead of silently doing nothing.

132 132 

133## See also133## See also

134 134 

Details

202 202 

203[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. For heightened rate limits, contact Google Cloud support. When using Vertex AI, the `/login` and `/logout` commands are disabled since authentication is handled through Google Cloud credentials.203[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) is enabled automatically. To disable it, set `DISABLE_PROMPT_CACHING=1`. To request a 1-hour cache TTL instead of the 5-minute default, set `ENABLE_PROMPT_CACHING_1H=1`; cache writes with a 1-hour TTL are billed at a higher rate. For heightened rate limits, contact Google Cloud support. When using Vertex AI, the `/login` and `/logout` commands are disabled since authentication is handled through Google Cloud credentials.

204 204 

205[MCP tool search](/en/mcp#scale-with-mcp-tool-search) is disabled by default on Vertex AI because the endpoint does not accept the required beta header. All MCP tool definitions load upfront instead. To opt in, set `ENABLE_TOOL_SEARCH=true`.205[MCP tool search](/en/mcp#scale-with-mcp-tool-search) is disabled by default on Vertex AI because the endpoint does not accept the required beta header. All MCP tool definitions load upfront instead. Setting `ENABLE_TOOL_SEARCH=true` forces Claude Code to send the header anyway, which causes Vertex AI to reject requests.

206 206 

207### 5. Pin model versions207### 5. Pin model versions

208 208 

hooks.md +11 −6

Details

70 {70 {

71 "type": "command",71 "type": "command",

72 "if": "Bash(rm *)",72 "if": "Bash(rm *)",

73 "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-rm.sh"73 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh",

74 "args": []

74 }75 }

75 ]76 ]

76 }77 }


462 "hooks": [463 "hooks": [

463 {464 {

464 "type": "command",465 "type": "command",

465 "command": "\"${CLAUDE_PROJECT_DIR}\"/.claude/hooks/check-style.sh"466 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/check-style.sh",

467 "args": []

466 }468 }

467 ]469 ]

468 }470 }


487 "hooks": [489 "hooks": [

488 {490 {

489 "type": "command",491 "type": "command",

490 "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/format.sh",492 "command": "${CLAUDE_PLUGIN_ROOT}/scripts/format.sh",

493 "args": [],

491 "timeout": 30494 "timeout": 30

492 }495 }

493 ]496 ]


1966 "hooks": [1969 "hooks": [

1967 {1970 {

1968 "type": "command",1971 "type": "command",

1969 "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/audit-config-change.sh"1972 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/audit-config-change.sh",

1973 "args": []

1970 }1974 }

1971 ]1975 ]

1972 }1976 }


2643 "hooks": [2647 "hooks": [

2644 {2648 {

2645 "type": "command",2649 "type": "command",

2646 "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/run-tests-async.sh",2650 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/run-tests-async.sh",

2651 "args": [],

2647 "async": true,2652 "async": true,

2648 "timeout": 3002653 "timeout": 300

2649 }2654 }


2680* **Validate and sanitize inputs**: never trust input data blindly2685* **Validate and sanitize inputs**: never trust input data blindly

2681* **Always quote shell variables**: use `"$VAR"` not `$VAR`2686* **Always quote shell variables**: use `"$VAR"` not `$VAR`

2682* **Block path traversal**: check for `..` in file paths2687* **Block path traversal**: check for `..` in file paths

2683* **Use absolute paths**: specify full paths for scripts, using `"$CLAUDE_PROJECT_DIR"` for the project root2688* **Use absolute paths**: specify full paths for scripts. In exec form, use `${CLAUDE_PROJECT_DIR}` and the path needs no quoting. In shell form, wrap it in double quotes

2684* **Skip sensitive files**: avoid `.env`, `.git/`, keys, etc.2689* **Skip sensitive files**: avoid `.env`, `.git/`, keys, etc.

2685 2690 

2686## Windows PowerShell tool2691## Windows PowerShell tool

hooks-guide.md +1 −1

Details

895 echo '{"tool_name":"Bash","tool_input":{"command":"ls"}}' | ./my-hook.sh895 echo '{"tool_name":"Bash","tool_input":{"command":"ls"}}' | ./my-hook.sh

896 echo $? # Check the exit code896 echo $? # Check the exit code

897 ```897 ```

898* If you see "command not found", use absolute paths or `$CLAUDE_PROJECT_DIR` to reference scripts898* If you see "command not found", use absolute paths or `${CLAUDE_PROJECT_DIR}` to reference scripts. To avoid shell quoting entirely, add `"args": []` to switch to [exec form](/en/hooks#exec-form-and-shell-form), which spawns the script directly without a shell

899* If you see "jq: command not found", install `jq` or use Python/Node.js for JSON parsing899* If you see "jq: command not found", install `jq` or use Python/Node.js for JSON parsing

900* If the script isn't running at all, make it executable: `chmod +x ./my-hook.sh`900* If the script isn't running at all, make it executable: `chmod +x ./my-hook.sh`

901 901 

Details

36| `Ctrl+T` | Toggle task list | Show or hide the [task list](#task-list) in the terminal status area |36| `Ctrl+T` | Toggle task list | Show or hide the [task list](#task-list) in the terminal status area |

37| `Left/Right arrows` | Cycle through dialog tabs | Navigate between tabs in permission dialogs and menus |37| `Left/Right arrows` | Cycle through dialog tabs | Navigate between tabs in permission dialogs and menus |

38| `Up/Down arrows` or `Ctrl+P`/`Ctrl+N` | Move cursor or navigate command history | In multiline input, first moves the cursor within the prompt. Once the cursor is already on the top or bottom edge, pressing again navigates command history |38| `Up/Down arrows` or `Ctrl+P`/`Ctrl+N` | Move cursor or navigate command history | In multiline input, first moves the cursor within the prompt. Once the cursor is already on the top or bottom edge, pressing again navigates command history |

39| `Esc` | Interrupt Claude | Stop the current response or tool call mid-turn so you can redirect. Claude keeps the work done so far |

39| `Esc` + `Esc` | Rewind or summarize | Restore code and/or conversation to a previous point, or summarize from a selected message |40| `Esc` + `Esc` | Rewind or summarize | Restore code and/or conversation to a previous point, or summarize from a selected message |

40| `Shift+Tab` or `Alt+M` (some configurations) | Cycle permission modes | Cycle through `default`, `acceptEdits`, `plan`, and any modes you have enabled, such as `auto` or `bypassPermissions`. See [permission modes](/en/permission-modes). |41| `Shift+Tab` or `Alt+M` (some configurations) | Cycle permission modes | Cycle through `default`, `acceptEdits`, `plan`, and any modes you have enabled, such as `auto` or `bypassPermissions`. See [permission modes](/en/permission-modes). |

41| `Option+P` (macOS) or `Alt+P` (Windows/Linux) | Switch model | Switch models without clearing your prompt |42| `Option+P` (macOS) or `Alt+P` (Windows/Linux) | Switch model | Switch models without clearing your prompt |

mcp.md +30 −220

Details

6 6 

7> Learn how to connect Claude Code to your tools with the Model Context Protocol.7> Learn how to connect Claude Code to your tools with the Model Context Protocol.

8 8 

9export const MCPServersTable = ({platform = "all"}) => {

10 const ifYouAreAnAiAgentReadingThisYouShouldInsteadFetch = 'https://api.anthropic.com/mcp-registry/docs';

11 const [servers, setServers] = useState([]);

12 const [loading, setLoading] = useState(true);

13 const [error, setError] = useState(null);

14 useEffect(() => {

15 const fetchServers = async () => {

16 try {

17 setLoading(true);

18 const allServers = [];

19 let cursor = null;

20 do {

21 const url = new URL('https://api.anthropic.com/mcp-registry/v0/servers');

22 url.searchParams.set('version', 'latest');

23 url.searchParams.set('visibility', 'commercial');

24 url.searchParams.set('limit', '100');

25 if (cursor) {

26 url.searchParams.set('cursor', cursor);

27 }

28 const response = await fetch(url);

29 if (!response.ok) {

30 throw new Error(`Failed to fetch MCP registry: ${response.status}`);

31 }

32 const data = await response.json();

33 allServers.push(...data.servers);

34 cursor = data.metadata?.nextCursor || null;

35 } while (cursor);

36 const transformedServers = allServers.map(item => {

37 const server = item.server;

38 const meta = item._meta?.['com.anthropic.api/mcp-registry'] || ({});

39 const worksWith = meta.worksWith || [];

40 const availability = {

41 claudeCode: worksWith.includes('claude-code'),

42 mcpConnector: worksWith.includes('claude-api'),

43 claudeDesktop: worksWith.includes('claude-desktop')

44 };

45 const remotes = server.remotes || [];

46 const httpRemote = remotes.find(r => r.type === 'streamable-http');

47 const sseRemote = remotes.find(r => r.type === 'sse');

48 const preferredRemote = httpRemote || sseRemote;

49 const remoteUrl = preferredRemote?.url || meta.url;

50 const remoteType = preferredRemote?.type;

51 const isTemplatedUrl = remoteUrl?.includes('{');

52 let setupUrl;

53 if (isTemplatedUrl && meta.requiredFields) {

54 const urlField = meta.requiredFields.find(f => f.field === 'url');

55 setupUrl = urlField?.sourceUrl || meta.documentation;

56 }

57 const urls = {};

58 if (!isTemplatedUrl) {

59 if (remoteType === 'streamable-http') {

60 urls.http = remoteUrl;

61 } else if (remoteType === 'sse') {

62 urls.sse = remoteUrl;

63 }

64 }

65 let envVars = [];

66 if (server.packages && server.packages.length > 0) {

67 const npmPackage = server.packages.find(p => p.registryType === 'npm');

68 if (npmPackage) {

69 urls.stdio = `npx -y ${npmPackage.identifier}`;

70 if (npmPackage.environmentVariables) {

71 envVars = npmPackage.environmentVariables;

72 }

73 }

74 }

75 return {

76 name: meta.displayName || server.title || server.name,

77 description: meta.oneLiner || server.description,

78 documentation: meta.documentation,

79 urls: urls,

80 envVars: envVars,

81 availability: availability,

82 customCommands: meta.claudeCodeCopyText ? {

83 claudeCode: meta.claudeCodeCopyText

84 } : undefined,

85 setupUrl: setupUrl

86 };

87 });

88 setServers(transformedServers);

89 setError(null);

90 } catch (err) {

91 setError(err.message);

92 console.error('Error fetching MCP registry:', err);

93 } finally {

94 setLoading(false);

95 }

96 };

97 fetchServers();

98 }, []);

99 const generateClaudeCodeCommand = server => {

100 if (server.customCommands && server.customCommands.claudeCode) {

101 return server.customCommands.claudeCode.replace('--transport streamable-http', '--transport http');

102 }

103 const serverSlug = server.name.toLowerCase().replace(/[^a-z0-9]/g, '-');

104 if (server.urls.http) {

105 return `claude mcp add ${serverSlug} --transport http ${server.urls.http}`;

106 }

107 if (server.urls.sse) {

108 return `claude mcp add ${serverSlug} --transport sse ${server.urls.sse}`;

109 }

110 if (server.urls.stdio) {

111 const envFlags = server.envVars && server.envVars.length > 0 ? server.envVars.map(v => `--env ${v.name}=YOUR_${v.name}`).join(' ') : '';

112 const baseCommand = `claude mcp add ${serverSlug} --transport stdio`;

113 return envFlags ? `${baseCommand} ${envFlags} -- ${server.urls.stdio}` : `${baseCommand} -- ${server.urls.stdio}`;

114 }

115 return null;

116 };

117 if (loading) {

118 return <div>Loading MCP servers...</div>;

119 }

120 if (error) {

121 return <div>Error loading MCP servers: {error}</div>;

122 }

123 const filteredServers = servers.filter(server => {

124 if (platform === "claudeCode") {

125 return server.availability.claudeCode;

126 } else if (platform === "mcpConnector") {

127 return server.availability.mcpConnector;

128 } else if (platform === "claudeDesktop") {

129 return server.availability.claudeDesktop;

130 } else if (platform === "all") {

131 return true;

132 } else {

133 throw new Error(`Unknown platform: ${platform}`);

134 }

135 });

136 return <>

137 <style jsx>{`

138 .cards-container {

139 display: grid;

140 gap: 1rem;

141 margin-bottom: 2rem;

142 }

143 .server-card {

144 border: 1px solid var(--border-color, #e5e7eb);

145 border-radius: 6px;

146 padding: 1rem;

147 }

148 .command-row {

149 display: flex;

150 align-items: center;

151 gap: 0.25rem;

152 }

153 .command-row code {

154 font-size: 0.75rem;

155 overflow-x: auto;

156 }

157 `}</style>

158 

159 <div className="cards-container">

160 {filteredServers.map(server => {

161 const claudeCodeCommand = generateClaudeCodeCommand(server);

162 const mcpUrl = server.urls.http || server.urls.sse;

163 const commandToShow = platform === "claudeCode" ? claudeCodeCommand : mcpUrl;

164 return <div key={server.name} className="server-card">

165 <div>

166 {server.documentation ? <a href={server.documentation}>

167 <strong>{server.name}</strong>

168 </a> : <strong>{server.name}</strong>}

169 </div>

170 

171 <p style={{

172 margin: '0.5rem 0',

173 fontSize: '0.9rem'

174 }}>

175 {server.description}

176 </p>

177 

178 {server.setupUrl && <p style={{

179 margin: '0.25rem 0',

180 fontSize: '0.8rem',

181 fontStyle: 'italic',

182 opacity: 0.7

183 }}>

184 Requires user-specific URL.{' '}

185 <a href={server.setupUrl} style={{

186 textDecoration: 'underline'

187 }}>

188 Get your URL here

189 </a>.

190 </p>}

191 

192 {commandToShow && !server.setupUrl && <>

193 <p style={{

194 display: 'block',

195 fontSize: '0.75rem',

196 fontWeight: 500,

197 minWidth: 'fit-content',

198 marginTop: '0.5rem',

199 marginBottom: 0

200 }}>

201 {platform === "claudeCode" ? "Command" : "URL"}

202 </p>

203 <div className="command-row">

204 <code>

205 {commandToShow}

206 </code>

207 </div>

208 </>}

209 </div>;

210 })}

211 </div>

212 </>;

213};

214 

215Claude Code can connect to hundreds of external tools and data sources through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction), an open source standard for AI-tool integrations. MCP servers give Claude Code access to your tools, databases, and APIs.9Claude Code can connect to hundreds of external tools and data sources through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction), an open source standard for AI-tool integrations. MCP servers give Claude Code access to your tools, databases, and APIs.

216 10 

217Connect a server when you find yourself copying data into chat from another tool, like an issue tracker or a monitoring dashboard. Once connected, Claude can read and act on that system directly instead of working from what you paste.11Connect a server when you find yourself copying data into chat from another tool, like an issue tracker or a monitoring dashboard. Once connected, Claude can read and act on that system directly instead of working from what you paste.


227* **Automate workflows**: "Create Gmail drafts inviting these 10 users to a feedback session about the new feature."21* **Automate workflows**: "Create Gmail drafts inviting these 10 users to a feedback session about the new feature."

228* **React to external events**: An MCP server can also act as a [channel](/en/channels) that pushes messages into your session, so Claude reacts to Telegram messages, Discord chats, or webhook events while you're away.22* **React to external events**: An MCP server can also act as a [channel](/en/channels) that pushes messages into your session, so Claude reacts to Telegram messages, Discord chats, or webhook events while you're away.

229 23 

230## Popular MCP servers24## Find and build MCP servers

231 25 

232Here are some commonly used MCP servers you can connect to Claude Code:26Browse reviewed connectors in the [Anthropic Directory](https://claude.ai/directory). Directory connectors use the same MCP infrastructure as Claude Code, so you can add any remote server listed there with `claude mcp add`.

233 27 

234<Warning>28<Warning>

235 Use third party MCP servers at your own risk - Anthropic has not verified29 Verify you trust each server before connecting it. Servers that fetch external content can expose you to [prompt injection risk](/en/security#protect-against-prompt-injection).

236 the correctness or security of all these servers.

237 Make sure you trust MCP servers you are installing.

238 Be especially careful when using MCP servers that could fetch untrusted

239 content, as these can expose you to prompt injection risk.

240</Warning>30</Warning>

241 31 

242<MCPServersTable platform="claudeCode" />32To build your own server, see the [MCP server guide](https://modelcontextprotocol.io/docs/develop/build-server) for protocol fundamentals and the [Claude connector building docs](https://claude.com/docs/connectors/building) for authentication, testing, and Directory submission.

243 33 

244<Note>34You can also have Claude scaffold a server for you with the official [`mcp-server-dev` plugin](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev).

245 **Need a specific integration?** [Find hundreds more MCP servers on GitHub](https://github.com/modelcontextprotocol/servers), or build your own using the [MCP SDK](https://modelcontextprotocol.io/quickstart/server).35 

246</Note>36<Steps>

37 <Step title="Install the plugin">

38 In a Claude Code session, run:

39 

40 ```

41 /plugin install mcp-server-dev@claude-plugins-official

42 ```

43 

44 Then run `/reload-plugins` to activate it in the current session.

45 </Step>

46 

47 <Step title="Run the build skill">

48 ```

49 /mcp-server-dev:build-mcp-server

50 ```

51 

52 Claude asks about your use case and scaffolds a remote HTTP or local stdio server.

53 </Step>

54</Steps>

247 55 

248## Installing MCP servers56## Installing MCP servers

249 57 


650 458 

651Many cloud-based MCP servers require authentication. Claude Code supports OAuth 2.0 for secure connections.459Many cloud-based MCP servers require authentication. Claude Code supports OAuth 2.0 for secure connections.

652 460 

461Claude Code marks a remote server as needing authentication when the server responds with `401 Unauthorized` and a `WWW-Authenticate` header pointing to its authorization server. Any custom server that returns that response gets the same `/mcp` authentication flow as any other remote server.

462 

653<Steps>463<Steps>

654 <Step title="Add the server that requires authentication">464 <Step title="Add the server that requires authentication">

655 For example:465 For example:


1143 953 

1144### Configure tool search954### Configure tool search

1145 955 

1146Tool search is enabled by default: MCP tools are deferred and discovered on demand. It is disabled by default on Vertex AI, which does not accept the tool search beta header, and when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies do not forward `tool_reference` blocks. Set `ENABLE_TOOL_SEARCH` explicitly to opt in. This feature requires models that support `tool_reference` blocks: Sonnet 4 and later, or Opus 4 and later. Haiku models do not support tool search.956Tool search is enabled by default: MCP tools are deferred and discovered on demand. It is disabled by default on Vertex AI, which does not accept the tool search beta header, and when `ANTHROPIC_BASE_URL` points to a non-first-party host, since most proxies do not forward `tool_reference` blocks. If your proxy forwards `tool_reference` blocks, set `ENABLE_TOOL_SEARCH` explicitly to override the fallback. This feature requires models that support `tool_reference` blocks: Sonnet 4 and later, or Opus 4 and later. Haiku models do not support tool search.

1147 957 

1148Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable:958Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable:

1149 959 

1150| Value | Behavior |960| Value | Behavior |

1151| :--------- | :--------------------------------------------------------------------------------------------------------------------------------------------- |961| :--------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

1152| (unset) | All MCP tools deferred and loaded on demand. Falls back to loading upfront on Vertex AI or when `ANTHROPIC_BASE_URL` is a non-first-party host |962| (unset) | All MCP tools deferred and loaded on demand. Falls back to loading upfront on Vertex AI or when `ANTHROPIC_BASE_URL` is a non-first-party host |

1153| `true` | All MCP tools deferred, including on Vertex AI and for non-first-party `ANTHROPIC_BASE_URL` |963| `true` | All MCP tools deferred. Claude Code sends the beta header even on Vertex AI and through proxies. Requests fail if the backend does not support `tool_reference` blocks |

1154| `auto` | Threshold mode: tools load upfront if they fit within 10% of the context window, deferred otherwise |964| `auto` | Threshold mode: tools load upfront if they fit within 10% of the context window, deferred otherwise |

1155| `auto:<N>` | Threshold mode with a custom percentage, where `<N>` is 0-100 (e.g., `auto:5` for 5%) |965| `auto:<N>` | Threshold mode with a custom percentage, where `<N>` is 0-100 (e.g., `auto:5` for 5%) |

1156| `false` | All MCP tools loaded upfront, no deferral |966| `false` | All MCP tools loaded upfront, no deferral |

model-config.md +2 −0

Details

57 57 

58Your `/model` selection is saved to user settings and persists across restarts. As of v2.1.117, if the project's `.claude/settings.json` pins a different model, Claude Code also writes your choice to `.claude/settings.local.json` so it continues to apply in that project after a restart. Managed settings take precedence and reapply on the next launch.58Your `/model` selection is saved to user settings and persists across restarts. As of v2.1.117, if the project's `.claude/settings.json` pins a different model, Claude Code also writes your choice to `.claude/settings.local.json` so it continues to apply in that project after a restart. Managed settings take precedence and reapply on the next launch.

59 59 

60The `--model` flag and `ANTHROPIC_MODEL` environment variable apply only to the session you launch with them and are not saved. To run different models in different terminals at the same time, launch each one with its own `--model` flag rather than switching with `/model`.

61 

60When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session.62When the active model at startup comes from project or managed settings rather than your own selection, the startup header shows which settings file set it. Run `/model` to override for the current session.

61 63 

62Example usage:64Example usage:

Details

905* `post_tokens`: Approximate token count after compaction905* `post_tokens`: Approximate token count after compaction

906* `error`: Error message when compaction failed906* `error`: Error message when compaction failed

907 907 

908#### Feedback survey event

909 

910Logged when a session quality survey is shown or answered. See [Session quality surveys](/en/data-usage#session-quality-surveys) for what the surveys collect and how to control them.

911 

912**Event Name**: `claude_code.feedback_survey`

913 

914**Attributes**:

915 

916* All [standard attributes](#standard-attributes)

917* `event.name`: `"feedback_survey"`

918* `event.timestamp`: ISO 8601 timestamp

919* `event.sequence`: monotonically increasing counter for ordering events within a session

920* `event_type`: Survey lifecycle event, for example `"appeared"`, `"responded"`, or `"transcript_prompt_appeared"`

921* `appearance_id`: Unique ID linking the events emitted for one survey instance

922* `survey_type`: Which survey produced the event. `"session"` is the "How is Claude doing?" rating prompt

923* `response`: The user's selection on `responded` events

924* `enabled_via_override`: `true` when [`CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL`](/en/env-vars) is set. Emitted as a boolean, not a string. Present on `session` survey events. Filter on this attribute to confirm the override is applied across a fleet

925 

908## Interpret metrics and events data926## Interpret metrics and events data

909 927 

910The exported metrics and events support a range of analyses:928The exported metrics and events support a range of analyses:

output-styles.md +18 −9

Details

116 116 

117### Output Styles vs. CLAUDE.md vs. --append-system-prompt117### Output Styles vs. CLAUDE.md vs. --append-system-prompt

118 118 

119Output styles completely "turn off" the parts of Claude Code's default system119Choose based on whether Claude should stop acting as a coding assistant or keep

120prompt specific to software engineering. Neither CLAUDE.md nor120its default role and learn more. Output styles replace the software-engineering

121`--append-system-prompt` edit Claude Code's default system prompt. CLAUDE.md121parts of Claude Code's system prompt with your own role and voice, so use one

122adds the contents as a user message *following* Claude Code's default system122when Claude should adopt a different identity, like a writing editor or a

123prompt. `--append-system-prompt` appends the content to the system prompt.123data-analysis assistant. CLAUDE.md and `--append-system-prompt` both keep

124Claude Code's default identity and add to it, so use them when Claude should

125remain a coding assistant that also follows your project conventions or extra

126instructions.

127 

128The mechanisms differ as well. Output styles edit the system prompt directly.

129CLAUDE.md adds its contents as a user message after the system prompt.

130`--append-system-prompt` appends content to the end of the system prompt without

131removing anything.

124 132 

125### Output Styles vs. [Agents](/en/sub-agents)133### Output Styles vs. [Agents](/en/sub-agents)

126 134 

127Output styles directly affect the main agent loop and only affect the system135Use an output style to change how the main conversation responds in every

128prompt. Agents are invoked to handle specific tasks and can include additional136session. Use a [subagent](/en/sub-agents) when you want a separately scoped

129settings like the model to use, the tools they have available, and some context137helper that the main conversation delegates to. Output styles affect only the

130about when to use the agent.138system prompt of the main agent loop. Agents handle specific tasks and can carry

139their own model, tools, and context about when to invoke them.

131 140 

132### Output Styles vs. [Skills](/en/skills)141### Output Styles vs. [Skills](/en/skills)

133 142 

Details

138* Keep planning with feedback138* Keep planning with feedback

139* Refine with [Ultraplan](/en/ultraplan) for browser-based review139* Refine with [Ultraplan](/en/ultraplan) for browser-based review

140 140 

141Approving a plan exits plan mode and switches the session to the permission mode each approve option describes, so Claude starts editing. To plan again, cycle back to plan mode with `Shift+Tab`, or prefix your next prompt with `/plan`.

142 

141Press `Ctrl+G` to open the proposed plan in your default text editor and edit it directly before Claude proceeds. When [`showClearContextOnPlanAccept`](/en/settings#available-settings) is enabled, each approve option also offers to clear the planning context first.143Press `Ctrl+G` to open the proposed plan in your default text editor and edit it directly before Claude proceeds. When [`showClearContextOnPlanAccept`](/en/settings#available-settings) is enabled, each approve option also offers to clear the planning context first.

142 144 

143Accepting a plan also names the session from the plan content automatically, unless you've already set a name with `--name` or `/rename`.145Accepting a plan also names the session from the plan content automatically, unless you've already set a name with `--name` or `/rename`.


274 276 

275The `--dangerously-skip-permissions` flag is equivalent.277The `--dangerously-skip-permissions` flag is equivalent.

276 278 

279On Linux and macOS, Claude Code refuses to start in this mode when running as root or under `sudo`:

280 

281```text theme={null}

282--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons

283```

284 

285The check is skipped automatically inside a recognized sandbox. To run autonomously in a container, use the [dev container](/en/devcontainer) configuration, which runs Claude Code as a non-root user.

286 

277<Warning>287<Warning>

278 `bypassPermissions` offers no protection against prompt injection or unintended actions. For background safety checks without prompts, use [auto mode](#eliminate-prompts-with-auto-mode) instead. Administrators can block this mode by setting `permissions.disableBypassPermissionsMode` to `"disable"` in [managed settings](/en/permissions#managed-settings).288 `bypassPermissions` offers no protection against prompt injection or unintended actions. For background safety checks without prompts, use [auto mode](#eliminate-prompts-with-auto-mode) instead. Administrators can block this mode by setting `permissions.disableBypassPermissionsMode` to `"disable"` in [managed settings](/en/permissions#managed-settings).

279</Warning>289</Warning>

permissions.md +8 −2

Details

28 28 

29Rules are evaluated in order: **deny -> ask -> allow**. The first matching rule wins, so deny rules always take precedence.29Rules are evaluated in order: **deny -> ask -> allow**. The first matching rule wins, so deny rules always take precedence.

30 30 

31<Note>

32 Permission rules are enforced by Claude Code, not by the model. Instructions in your prompt or `CLAUDE.md` shape what Claude tries to do, but they don't change what Claude Code allows. To grant or revoke access, use `/permissions`, the rules described here, a [permission mode](/en/permission-modes), or a [PreToolUse hook](#extend-permissions-with-hooks).

33</Note>

34 

31## Permission modes35## Permission modes

32 36 

33Claude Code supports several permission modes that control how tools are approved. See [Permission modes](/en/permission-modes) for when to use each one. Set the `defaultMode` in your [settings files](/en/settings#settings-files):37Claude Code supports several permission modes that control how tools are approved. See [Permission modes](/en/permission-modes) for when to use each one. Set the `defaultMode` in your [settings files](/en/settings#settings-files):


134 138 

135#### Read-only commands139#### Read-only commands

136 140 

137Claude Code recognizes a built-in set of Bash commands as read-only and runs them without a permission prompt in every mode. These include `ls`, `cat`, `head`, `tail`, `grep`, `find`, `wc`, `diff`, `stat`, `du`, `cd`, and read-only forms of `git`. The set is not configurable; to require a prompt for one of these commands, add an `ask` or `deny` rule for it.141Claude Code recognizes a built-in set of Bash commands as read-only and runs them without a permission prompt in every mode. These include `ls`, `cat`, `echo`, `pwd`, `head`, `tail`, `grep`, `find`, `wc`, `which`, `diff`, `stat`, `du`, `cd`, and read-only forms of `git`. The set is not configurable; to require a prompt for one of these commands, add an `ask` or `deny` rule for it.

138 142 

139Unquoted glob patterns are permitted for commands whose every flag is read-only, so `ls *.ts` and `wc -l src/*.py` run without a prompt. Commands with write-capable or exec-capable flags, such as `find`, `sort`, `sed`, and `git`, still prompt when an unquoted glob is present because the glob could expand to a flag like `-delete`.143Unquoted glob patterns are permitted for commands whose every flag is read-only, so `ls *.ts` and `wc -l src/*.py` run without a prompt. Commands with write-capable or exec-capable flags, such as `find`, `sort`, `sed`, and `git`, still prompt when an unquoted glob is present because the glob could expand to a flag like `-delete`.

140 144 


153 157 

154 * **Restrict Bash network tools**: use deny rules to block `curl`, `wget`, and similar commands, then use the WebFetch tool with `WebFetch(domain:github.com)` permission for allowed domains158 * **Restrict Bash network tools**: use deny rules to block `curl`, `wget`, and similar commands, then use the WebFetch tool with `WebFetch(domain:github.com)` permission for allowed domains

155 * **Use PreToolUse hooks**: implement a hook that validates URLs in Bash commands and blocks disallowed domains159 * **Use PreToolUse hooks**: implement a hook that validates URLs in Bash commands and blocks disallowed domains

156 * Instructing Claude Code about your allowed curl patterns via CLAUDE.md160 * **Add CLAUDE.md guidance**: describe your allowed curl patterns in `CLAUDE.md`. This shapes what Claude tries but doesn't enforce a boundary, so pair it with one of the options above

157 161 

158 Note that using WebFetch alone does not prevent network access. If Bash is allowed, Claude can still use `curl`, `wget`, or other tools to reach any URL.162 Note that using WebFetch alone does not prevent network access. If Bash is allowed, Claude can still use `curl`, `wget`, or other tools to reach any URL.

159</Warning>163</Warning>


349 353 

350If a tool is denied at any level, no other level can allow it. For example, a managed settings deny cannot be overridden by `--allowedTools`, and `--disallowedTools` can add restrictions beyond what managed settings define.354If a tool is denied at any level, no other level can allow it. For example, a managed settings deny cannot be overridden by `--allowedTools`, and `--disallowedTools` can add restrictions beyond what managed settings define.

351 355 

356Embedding hosts can supply additional managed policy via the SDK `managedSettings` option when [`parentSettingsBehavior`](/en/settings#settings-precedence) is set to `"merge"`; embedder values can tighten policy but not loosen it.

357 

352If a permission is allowed in user settings but denied in project settings, the project setting takes precedence and the permission is blocked.358If a permission is allowed in user settings but denied in project settings, the project setting takes precedence and the permission is blocked.

353 359 

354## Example configurations360## Example configurations

plugins.md +6 −0

Details

299claude --plugin-dir ./my-plugin299claude --plugin-dir ./my-plugin

300```300```

301 301 

302The flag also accepts a `.zip` archive of the plugin directory, which requires Claude Code v2.1.128 or later.

303 

304```bash theme={null}

305claude --plugin-dir ./my-plugin.zip

306```

307 

302When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. Marketplace plugins force-enabled by managed settings are the only exception and cannot be overridden.308When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. Marketplace plugins force-enabled by managed settings are the only exception and cannot be overridden.

303 309 

304As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components:310As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components:

Details

518* **Adds to the default**: `skills`. The default `skills/` directory is always scanned, and directories listed in `skills` are loaded alongside it518* **Adds to the default**: `skills`. The default `skills/` directory is always scanned, and directories listed in `skills` are loaded alongside it

519* **Own merge rules**: [hooks](#hooks), [MCP servers](#mcp-servers), and [LSP servers](#lsp-servers). See each section for how multiple sources combine519* **Own merge rules**: [hooks](#hooks), [MCP servers](#mcp-servers), and [LSP servers](#lsp-servers). See each section for how multiple sources combine

520 520 

521When a plugin has both a default folder and the matching manifest key, Claude Code v2.1.140 and later flags the ignored folder in `/doctor`, `claude plugin list`, and the `/plugin` detail view. The plugin still loads using the manifest paths. No warning is shown when the manifest key points into the default folder, for example `"commands": ["./commands/deploy.md"]`, because the folder is addressed explicitly in that case.

522 

521For all path fields:523For all path fields:

522 524 

523* All paths must be relative to the plugin root and start with `./`525* All paths must be relative to the plugin root and start with `./`


544 546 

545Claude Code provides three variables for referencing paths. All are substituted inline anywhere they appear in skill content, agent content, hook commands, monitor commands, and MCP or LSP server configs. All are also exported as environment variables to hook processes and MCP or LSP server subprocesses.547Claude Code provides three variables for referencing paths. All are substituted inline anywhere they appear in skill content, agent content, hook commands, monitor commands, and MCP or LSP server configs. All are also exported as environment variables to hook processes and MCP or LSP server subprocesses.

546 548 

547**`${CLAUDE_PLUGIN_ROOT}`**: the absolute path to your plugin's installation directory. Use this to reference scripts, binaries, and config files bundled with the plugin. In hook and monitor commands, wrap it in double quotes, as in `"${CLAUDE_PLUGIN_ROOT}"`, so paths containing spaces or special characters are passed as a single argument. This path changes when the plugin updates. The previous version's directory remains on disk for about seven days after an update before cleanup, but treat it as ephemeral and do not write state here.549**`${CLAUDE_PLUGIN_ROOT}`**: the absolute path to your plugin's installation directory. Use this to reference scripts, binaries, and config files bundled with the plugin. In hook commands, use [exec form](/en/hooks#exec-form-and-shell-form) with `args` so the path is passed as one argument with no quoting. In shell-form hooks and monitor commands, wrap it in double quotes, as in `"${CLAUDE_PLUGIN_ROOT}"`. This path changes when the plugin updates. The previous version's directory remains on disk for about seven days after an update before cleanup, but treat it as ephemeral and do not write state here.

548 550 

549When a plugin updates mid-session, hook commands, monitors, MCP servers, and LSP servers keep using the previous version's path. Run `/reload-plugins` to switch hooks, MCP servers, and LSP servers to the new path; monitors require a session restart.551When a plugin updates mid-session, hook commands, monitors, MCP servers, and LSP servers keep using the previous version's path. Run `/reload-plugins` to switch hooks, MCP servers, and LSP servers to the new path; monitors require a session restart.

550 552 


780| `-s, --scope <scope>` | Uninstall from scope: `user`, `project`, or `local` | `user` |782| `-s, --scope <scope>` | Uninstall from scope: `user`, `project`, or `local` | `user` |

781| `--keep-data` | Preserve the plugin's [persistent data directory](#persistent-data-directory) | |783| `--keep-data` | Preserve the plugin's [persistent data directory](#persistent-data-directory) | |

782| `--prune` | Also remove auto-installed dependencies that no other plugin requires. See [plugin prune](#plugin-prune) | |784| `--prune` | Also remove auto-installed dependencies that no other plugin requires. See [plugin prune](#plugin-prune) | |

783| `-y, --yes` | Skip the `--prune` confirmation prompt. Required when stdin is not a TTY | |785| `-y, --yes` | Skip the `--prune` confirmation prompt. Required when stdin or stdout is not a TTY | |

784| `-h, --help` | Display help for command | |786| `-h, --help` | Display help for command | |

785 787 

786**Aliases:** `remove`, `rm`788**Aliases:** `remove`, `rm`


798**Options:**800**Options:**

799 801 

800| Option | Description | Default |802| Option | Description | Default |

801| :-------------------- | :------------------------------------------------------------- | :------ |803| :-------------------- | :----------------------------------------------------------------------- | :------ |

802| `-s, --scope <scope>` | Prune at scope: `user`, `project`, or `local` | `user` |804| `-s, --scope <scope>` | Prune at scope: `user`, `project`, or `local` | `user` |

803| `--dry-run` | List what would be removed without removing anything | |805| `--dry-run` | List what would be removed without removing anything | |

804| `-y, --yes` | Skip the confirmation prompt. Required when stdin is not a TTY | |806| `-y, --yes` | Skip the confirmation prompt. Required when stdin or stdout is not a TTY | |

805| `-h, --help` | Display help for command | |807| `-h, --help` | Display help for command | |

806 808 

807**Aliases:** `autoremove`809**Aliases:** `autoremove`

quickstart.md +5 −5

Details

29 <Tab title="Native Install (Recommended)">29 <Tab title="Native Install (Recommended)">

30 **macOS, Linux, WSL:**30 **macOS, Linux, WSL:**

31 31 

32 ```bash theme={null} theme={null}32 ```bash theme={null}

33 curl -fsSL https://claude.ai/install.sh | bash33 curl -fsSL https://claude.ai/install.sh | bash

34 ```34 ```

35 35 

36 **Windows PowerShell:**36 **Windows PowerShell:**

37 37 

38 ```powershell theme={null} theme={null}38 ```powershell theme={null}

39 irm https://claude.ai/install.ps1 | iex39 irm https://claude.ai/install.ps1 | iex

40 ```40 ```

41 41 

42 **Windows CMD:**42 **Windows CMD:**

43 43 

44 ```batch theme={null} theme={null}44 ```batch theme={null}

45 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd45 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

46 ```46 ```

47 47 


55 </Tab>55 </Tab>

56 56 

57 <Tab title="Homebrew">57 <Tab title="Homebrew">

58 ```bash theme={null} theme={null}58 ```bash theme={null}

59 brew install --cask claude-code59 brew install --cask claude-code

60 ```60 ```

61 61 


67 </Tab>67 </Tab>

68 68 

69 <Tab title="WinGet">69 <Tab title="WinGet">

70 ```powershell theme={null} theme={null}70 ```powershell theme={null}

71 winget install Anthropic.ClaudeCode71 winget install Anthropic.ClaudeCode

72 ```72 ```

73 73 

routines.md +2 −0

Details

318 318 

319Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear.319Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear.

320 320 

321Connectors are the [claude.ai integrations](/en/mcp#use-mcp-servers-from-claude-ai) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](https://claude.ai/customize/connectors), or declare it in a committed [`.mcp.json`](/en/mcp#project-scope) so it is part of the cloned repository.

322 

321When you create a routine, all of your currently connected connectors are included by default. Remove any that aren't needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form.323When you create a routine, all of your currently connected connectors are included by default. Remove any that aren't needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form.

322 324 

323To manage or add connectors outside of the routine form, visit **Settings > Connectors** on claude.ai or use `/schedule update` in the CLI.325To manage or add connectors outside of the routine form, visit **Settings > Connectors** on claude.ai or use `/schedule update` in the CLI.

sandboxing.md +20 −0

Details

91 </Tab>91 </Tab>

92</Tabs>92</Tabs>

93 93 

94On Ubuntu 24.04 and later, the default AppArmor policy prevents bubblewrap from creating the user namespaces it needs for isolation. Add an AppArmor profile that grants `bwrap` this capability:

95 

96```bash theme={null}

97sudo tee /etc/apparmor.d/bwrap > /dev/null <<'EOF'

98abi <abi/4.0>,

99include <tunables/global>

100 

101profile bwrap /usr/bin/bwrap flags=(unconfined) {

102 userns,

103 include if exists <local/bwrap>

104}

105EOF

106```

107 

108The profile applies only to `bwrap` itself, not to the commands it runs inside the sandbox. Reload AppArmor to apply it:

109 

110```bash theme={null}

111sudo systemctl reload apparmor

112```

113 

94WSL1 does not support sandboxing because it lacks the required Linux namespace primitives. If you see `Sandboxing requires WSL2`, upgrade your distribution to WSL2 or run Claude Code without sandboxing.114WSL1 does not support sandboxing because it lacks the required Linux namespace primitives. If you see `Sandboxing requires WSL2`, upgrade your distribution to WSL2 or run Claude Code without sandboxing.

95 115 

96On WSL2, sandboxed commands cannot launch Windows binaries such as `cmd.exe`, `powershell.exe`, or anything under `/mnt/c/`. WSL hands these off to the Windows host over a Unix socket, which the sandbox blocks. If a command needs to invoke a Windows binary, add it to [`excludedCommands`](/en/settings#sandbox-settings) so it runs outside the sandbox.116On WSL2, sandboxed commands cannot launch Windows binaries such as `cmd.exe`, `powershell.exe`, or anything under `/mnt/c/`. WSL hands these off to the Windows host over a Unix socket, which the sandbox blocks. If a command needs to invoke a Windows binary, add it to [`excludedCommands`](/en/settings#sandbox-settings) so it runs outside the sandbox.

security.md +1 −1

Details

87 87 

88Claude Code allows users to configure Model Context Protocol (MCP) servers. The list of allowed MCP servers is configured in your source code, as part of Claude Code settings engineers check into source control.88Claude Code allows users to configure Model Context Protocol (MCP) servers. The list of allowed MCP servers is configured in your source code, as part of Claude Code settings engineers check into source control.

89 89 

90We encourage either writing your own MCP servers or using MCP servers from providers that you trust. You are able to configure Claude Code permissions for MCP servers. Anthropic does not manage or audit any MCP servers.90We encourage either writing your own MCP servers or using MCP servers from providers that you trust. You are able to configure Claude Code permissions for MCP servers. Anthropic reviews connectors against its [listing criteria](https://claude.com/docs/connectors/building/review-criteria) before adding them to the [Anthropic Directory](https://claude.ai/directory), but does not security-audit or manage any MCP server.

91 91 

92## IDE security92## IDE security

93 93 

settings.md +5 −1

Details

257</Note>257</Note>

258 258 

259| Key | Description | Example |259| Key | Description | Example |

260| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------ |260| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------- |

261| `autoConnectIde` | Automatically connect to a running IDE when Claude Code starts from an external terminal. Default: `false`. Appears in `/config` as **Auto-connect to IDE (external terminal)** when running outside a VS Code or JetBrains terminal. The [`CLAUDE_CODE_AUTO_CONNECT_IDE`](/en/env-vars) environment variable overrides this when set | `true` |261| `autoConnectIde` | Automatically connect to a running IDE when Claude Code starts from an external terminal. Default: `false`. Appears in `/config` as **Auto-connect to IDE (external terminal)** when running outside a VS Code or JetBrains terminal. The [`CLAUDE_CODE_AUTO_CONNECT_IDE`](/en/env-vars) environment variable overrides this when set | `true` |

262| `autoInstallIdeExtension` | Automatically install the Claude Code IDE extension when running from a VS Code terminal. Default: `true`. Appears in `/config` as **Auto-install IDE extension** when running inside a VS Code or JetBrains terminal. You can also set the [`CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL`](/en/env-vars) environment variable | `false` |262| `autoInstallIdeExtension` | Automatically install the Claude Code IDE extension when running from a VS Code terminal. Default: `true`. Appears in `/config` as **Auto-install IDE extension** when running inside a VS Code or JetBrains terminal. You can also set the [`CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL`](/en/env-vars) environment variable | `false` |

263| `externalEditorContext` | Prepend Claude's previous response as `#`-commented context when you open the external editor with `Ctrl+G`. Default: `false`. Appears in `/config` as **Show last response in external editor** | `true` |263| `externalEditorContext` | Prepend Claude's previous response as `#`-commented context when you open the external editor with `Ctrl+G`. Default: `false`. Appears in `/config` as **Show last response in external editor** | `true` |

264| `teammateDefaultModel` | Default model for [agent team](/en/agent-teams) teammates when the spawn prompt doesn't specify one. Set to a model alias such as `"sonnet"`, or `null` to inherit the lead's current `/model` selection. Appears in `/config` as **Default teammate model** | `"sonnet"` |

264 265 

265### Worktree settings266### Worktree settings

266 267 


512 * Policies deployed by IT through server delivery, MDM configuration profiles, registry policies, or managed settings files513 * Policies deployed by IT through server delivery, MDM configuration profiles, registry policies, or managed settings files

513 * Cannot be overridden by any other level, including command line arguments514 * Cannot be overridden by any other level, including command line arguments

514 * Within the managed tier, precedence is: server-managed > MDM/OS-level policies > file-based (`managed-settings.d/*.json` + `managed-settings.json`) > HKCU registry (Windows only). Only one managed source is used; sources do not merge across tiers. Within the file-based tier, drop-in files and the base file are merged together.515 * Within the managed tier, precedence is: server-managed > MDM/OS-level policies > file-based (`managed-settings.d/*.json` + `managed-settings.json`) > HKCU registry (Windows only). Only one managed source is used; sources do not merge across tiers. Within the file-based tier, drop-in files and the base file are merged together.

516 * Embedding hosts such as Claude Desktop can supply policy via the SDK `managedSettings` option. By default this is ignored when any managed-settings tier is present. Administrators can opt in by setting [`parentSettingsBehavior`](#available-settings) to `"merge"`. The embedder's values are filtered so they can tighten managed policy but not loosen it.

515 517 

5162. **Command line arguments**5182. **Command line arguments**

517 * Temporary overrides for a specific session. JSON passed via `--settings <file-or-json>` merges with file-based settings using the same rules as the other layers: a key set here overrides the same key in local, project, or user settings, and omitting a key leaves the lower-layer value in place519 * Temporary overrides for a specific session. JSON passed via `--settings <file-or-json>` merges with file-based settings using the same rules as the other layers: a key set here overrides the same key in local, project, or user settings, and omitting a key leaves the lower-layer value in place


674* `hostPattern`: regex pattern to match marketplace hosts (uses `hostPattern`)676* `hostPattern`: regex pattern to match marketplace hosts (uses `hostPattern`)

675* `settings`: inline marketplace declared directly in settings.json without a separate hosted repository (uses `name` and `plugins`)677* `settings`: inline marketplace declared directly in settings.json without a separate hosted repository (uses `name` and `plugins`)

676 678 

679Each marketplace entry also accepts an optional `autoUpdate` Boolean. Set `"autoUpdate": true` alongside `source` to make Claude Code refresh that marketplace and update its installed plugins at startup. When omitted, official Anthropic marketplaces default to `true` and all other marketplaces default to `false`. See [Configure auto-updates](/en/discover-plugins#configure-auto-updates).

680 

677Use `source: 'settings'` to declare a small set of plugins inline without setting up a hosted marketplace repository. Plugins listed here must reference external sources such as GitHub or npm. You still need to enable each plugin separately in `enabledPlugins`.681Use `source: 'settings'` to declare a small set of plugins inline without setting up a hosted marketplace repository. Plugins listed here must reference external sources such as GitHub or npm. You still need to enable each plugin separately in `enabledPlugins`.

678 682 

679```json theme={null}683```json theme={null}

Details

45| `TaskUpdate` | Updates task status, dependencies, details, or deletes tasks | No |45| `TaskUpdate` | Updates task status, dependencies, details, or deletes tasks | No |

46| `TeamCreate` | Creates an [agent team](/en/agent-teams) with multiple teammates. Only available when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set | No |46| `TeamCreate` | Creates an [agent team](/en/agent-teams) with multiple teammates. Only available when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set | No |

47| `TeamDelete` | Disbands an agent team and cleans up teammate processes. Only available when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set | No |47| `TeamDelete` | Disbands an agent team and cleans up teammate processes. Only available when `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set | No |

48| `TodoWrite` | Manages the session task checklist. Available in non-interactive mode and the [Agent SDK](/en/headless); interactive sessions use TaskCreate, TaskGet, TaskList, and TaskUpdate instead | No |48| `TodoWrite` | Manages the session task checklist. Deprecated in favor of `TaskCreate`, `TaskGet`, `TaskList`, and `TaskUpdate`. Interactive sessions already use the Task tools by default. When you run `claude -p` or use the [Agent SDK](/en/agent-sdk/overview), `TodoWrite` is still the default. Set `CLAUDE_CODE_ENABLE_TASKS=1` to switch those to the Task tools before `TodoWrite` is removed | No |

49| `ToolSearch` | Searches for and loads deferred tools when [tool search](/en/mcp#scale-with-mcp-tool-search) is enabled | No |49| `ToolSearch` | Searches for and loads deferred tools when [tool search](/en/mcp#scale-with-mcp-tool-search) is enabled | No |

50| `WebFetch` | Fetches content from a specified URL. See [WebFetch tool behavior](#webfetch-tool-behavior) | Yes |50| `WebFetch` | Fetches content from a specified URL. See [WebFetch tool behavior](#webfetch-tool-behavior) | Yes |

51| `WebSearch` | Performs web searches. See [WebSearch tool behavior](#websearch-tool-behavior) | Yes |51| `WebSearch` | Performs web searches. See [WebSearch tool behavior](#websearch-tool-behavior) | Yes |