SpyBara
Go Premium

Documentation 2026-01-14 06:02 UTC to 2026-01-16 21:01 UTC

16 files changed +208 −59. View all changes and history on the product overview
2026
Sat 31 03:42 Fri 30 18:07 Thu 29 21:03 Wed 28 15:06 Tue 27 21:01 Mon 26 21:03 Sun 25 03:34 Sat 24 03:29 Fri 23 21:01 Thu 22 21:03 Wed 21 21:05 Tue 20 21:03 Mon 19 21:01 Fri 16 21:01 Wed 14 06:02 Mon 12 21:02 Sun 11 18:02 Sat 10 21:01 Fri 9 21:01 Thu 8 21:02 Wed 7 21:01 Tue 6 21:01 Sat 3 18:02
Details

316* ghcr.io316* ghcr.io

317* mcr.microsoft.com317* mcr.microsoft.com

318* \*.data.mcr.microsoft.com318* \*.data.mcr.microsoft.com

319* public.ecr.aws

319 320 

320#### Cloud Platforms321#### Cloud Platforms

321 322 


336* dot.net337* dot.net

337* visualstudio.com338* visualstudio.com

338* dev.azure.com339* dev.azure.com

340* \*.amazonaws.com

341* \*.api.aws

339* oracle.com342* oracle.com

340* [www.oracle.com](http://www.oracle.com)343* [www.oracle.com](http://www.oracle.com)

341* java.com344* java.com

cli-reference.md +18 −13

Details

21Customize Claude Code's behavior with these command-line flags:21Customize Claude Code's behavior with these command-line flags:

22 22 

23| Flag | Description | Example |23| Flag | Description | Example |

24| :------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------- |24| :------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------- |

25| `--add-dir` | Add additional working directories for Claude to access (validates each path exists as a directory) | `claude --add-dir ../apps ../lib` |25| `--add-dir` | Add additional working directories for Claude to access (validates each path exists as a directory) | `claude --add-dir ../apps ../lib` |

26| `--agent` | Specify an agent for the current session (overrides the `agent` setting) | `claude --agent my-custom-agent` |26| `--agent` | Specify an agent for the current session (overrides the `agent` setting) | `claude --agent my-custom-agent` |

27| `--agents` | Define custom [subagents](/en/sub-agents) dynamically via JSON (see below for format) | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` |27| `--agents` | Define custom [subagents](/en/sub-agents) dynamically via JSON (see below for format) | `claude --agents '{"reviewer":{"description":"Reviews code","prompt":"You are a code reviewer"}}'` |

28| `--allow-dangerously-skip-permissions` | Enable permission bypassing as an option without immediately activating it. Allows composing with `--permission-mode` (use with caution) | `claude --permission-mode plan --allow-dangerously-skip-permissions` |

28| `--allowedTools` | Tools that execute without prompting for permission. To restrict which tools are available, use `--tools` instead | `"Bash(git log:*)" "Bash(git diff:*)" "Read"` |29| `--allowedTools` | Tools that execute without prompting for permission. To restrict which tools are available, use `--tools` instead | `"Bash(git log:*)" "Bash(git diff:*)" "Read"` |

29| `--append-system-prompt` | Append custom text to the end of the default system prompt (works in both interactive and print modes) | `claude --append-system-prompt "Always use TypeScript"` |30| `--append-system-prompt` | Append custom text to the end of the default system prompt (works in both interactive and print modes) | `claude --append-system-prompt "Always use TypeScript"` |

31| `--append-system-prompt-file` | Load additional system prompt text from a file and append to the default prompt (print mode only) | `claude -p --append-system-prompt-file ./extra-rules.txt "query"` |

30| `--betas` | Beta headers to include in API requests (API key users only) | `claude --betas interleaved-thinking` |32| `--betas` | Beta headers to include in API requests (API key users only) | `claude --betas interleaved-thinking` |

31| `--chrome` | Enable [Chrome browser integration](/en/chrome) for web automation and testing | `claude --chrome` |33| `--chrome` | Enable [Chrome browser integration](/en/chrome) for web automation and testing | `claude --chrome` |

32| `--continue`, `-c` | Load the most recent conversation in the current directory | `claude --continue` |34| `--continue`, `-c` | Load the most recent conversation in the current directory | `claude --continue` |

33| `--dangerously-skip-permissions` | Skip permission prompts (use with caution) | `claude --dangerously-skip-permissions` |35| `--dangerously-skip-permissions` | Skip all permission prompts (use with caution) | `claude --dangerously-skip-permissions` |

34| `--debug` | Enable debug mode with optional category filtering (for example, `"api,hooks"` or `"!statsig,!file"`) | `claude --debug "api,mcp"` |36| `--debug` | Enable debug mode with optional category filtering (for example, `"api,hooks"` or `"!statsig,!file"`) | `claude --debug "api,mcp"` |

37| `--disable-slash-commands` | Disable all skills and slash commands for this session | `claude --disable-slash-commands` |

35| `--disallowedTools` | Tools that are removed from the model's context and cannot be used | `"Bash(git log:*)" "Bash(git diff:*)" "Edit"` |38| `--disallowedTools` | Tools that are removed from the model's context and cannot be used | `"Bash(git log:*)" "Bash(git diff:*)" "Edit"` |

36| `--fallback-model` | Enable automatic fallback to specified model when default model is overloaded (print mode only) | `claude -p --fallback-model sonnet "query"` |39| `--fallback-model` | Enable automatic fallback to specified model when default model is overloaded (print mode only) | `claude -p --fallback-model sonnet "query"` |

37| `--fork-session` | When resuming, create a new session ID instead of reusing the original (use with `--resume` or `--continue`) | `claude --resume abc123 --fork-session` |40| `--fork-session` | When resuming, create a new session ID instead of reusing the original (use with `--resume` or `--continue`) | `claude --resume abc123 --fork-session` |


39| `--include-partial-messages` | Include partial streaming events in output (requires `--print` and `--output-format=stream-json`) | `claude -p --output-format stream-json --include-partial-messages "query"` |42| `--include-partial-messages` | Include partial streaming events in output (requires `--print` and `--output-format=stream-json`) | `claude -p --output-format stream-json --include-partial-messages "query"` |

40| `--input-format` | Specify input format for print mode (options: `text`, `stream-json`) | `claude -p --output-format json --input-format stream-json` |43| `--input-format` | Specify input format for print mode (options: `text`, `stream-json`) | `claude -p --output-format json --input-format stream-json` |

41| `--json-schema` | Get validated JSON output matching a JSON Schema after agent completes its workflow (print mode only, see [Agent SDK Structured Outputs](https://docs.claude.com/en/docs/agent-sdk/structured-outputs)) | `claude -p --json-schema '{"type":"object","properties":{...}}' "query"` |44| `--json-schema` | Get validated JSON output matching a JSON Schema after agent completes its workflow (print mode only, see [Agent SDK Structured Outputs](https://docs.claude.com/en/docs/agent-sdk/structured-outputs)) | `claude -p --json-schema '{"type":"object","properties":{...}}' "query"` |

45| `--max-budget-usd` | Maximum dollar amount to spend on API calls before stopping (print mode only) | `claude -p --max-budget-usd 5.00 "query"` |

42| `--max-turns` | Limit the number of agentic turns (print mode only). Exits with an error when the limit is reached. No limit by default | `claude -p --max-turns 3 "query"` |46| `--max-turns` | Limit the number of agentic turns (print mode only). Exits with an error when the limit is reached. No limit by default | `claude -p --max-turns 3 "query"` |

43| `--mcp-config` | Load MCP servers from JSON files or strings (space-separated) | `claude --mcp-config ./mcp.json` |47| `--mcp-config` | Load MCP servers from JSON files or strings (space-separated) | `claude --mcp-config ./mcp.json` |

44| `--model` | Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model's full name | `claude --model claude-sonnet-4-5-20250929` |48| `--model` | Sets the model for the current session with an alias for the latest model (`sonnet` or `opus`) or a model's full name | `claude --model claude-sonnet-4-5-20250929` |

45| `--no-chrome` | Disable [Chrome browser integration](/en/chrome) for this session | `claude --no-chrome` |49| `--no-chrome` | Disable [Chrome browser integration](/en/chrome) for this session | `claude --no-chrome` |

50| `--no-session-persistence` | Disable session persistence so sessions are not saved to disk and cannot be resumed (print mode only) | `claude -p --no-session-persistence "query"` |

46| `--output-format` | Specify output format for print mode (options: `text`, `json`, `stream-json`) | `claude -p "query" --output-format json` |51| `--output-format` | Specify output format for print mode (options: `text`, `json`, `stream-json`) | `claude -p "query" --output-format json` |

47| `--permission-mode` | Begin in a specified [permission mode](/en/iam#permission-modes) | `claude --permission-mode plan` |52| `--permission-mode` | Begin in a specified [permission mode](/en/iam#permission-modes) | `claude --permission-mode plan` |

48| `--permission-prompt-tool` | Specify an MCP tool to handle permission prompts in non-interactive mode | `claude -p --permission-prompt-tool mcp_auth_tool "query"` |53| `--permission-prompt-tool` | Specify an MCP tool to handle permission prompts in non-interactive mode | `claude -p --permission-prompt-tool mcp_auth_tool "query"` |

49| `--plugin-dir` | Load plugins from directories for this session only (repeatable) | `claude --plugin-dir ./my-plugins` |54| `--plugin-dir` | Load plugins from directories for this session only (repeatable) | `claude --plugin-dir ./my-plugins` |

50| `--print`, `-p` | Print response without interactive mode (see [SDK documentation](https://docs.claude.com/en/docs/agent-sdk) for programmatic usage details) | `claude -p "query"` |55| `--print`, `-p` | Print response without interactive mode (see [SDK documentation](https://docs.claude.com/en/docs/agent-sdk) for programmatic usage details) | `claude -p "query"` |

56| `--remote` | Create a new [web session](/en/claude-code-on-the-web) on claude.ai with the provided task description | `claude --remote "Fix the login bug"` |

51| `--resume`, `-r` | Resume a specific session by ID or name, or show an interactive picker to choose a session | `claude --resume auth-refactor` |57| `--resume`, `-r` | Resume a specific session by ID or name, or show an interactive picker to choose a session | `claude --resume auth-refactor` |

52| `--session-id` | Use a specific session ID for the conversation (must be a valid UUID) | `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` |58| `--session-id` | Use a specific session ID for the conversation (must be a valid UUID) | `claude --session-id "550e8400-e29b-41d4-a716-446655440000"` |

53| `--setting-sources` | Comma-separated list of setting sources to load (`user`, `project`, `local`) | `claude --setting-sources user,project` |59| `--setting-sources` | Comma-separated list of setting sources to load (`user`, `project`, `local`) | `claude --setting-sources user,project` |


55| `--strict-mcp-config` | Only use MCP servers from `--mcp-config`, ignoring all other MCP configurations | `claude --strict-mcp-config --mcp-config ./mcp.json` |61| `--strict-mcp-config` | Only use MCP servers from `--mcp-config`, ignoring all other MCP configurations | `claude --strict-mcp-config --mcp-config ./mcp.json` |

56| `--system-prompt` | Replace the entire system prompt with custom text (works in both interactive and print modes) | `claude --system-prompt "You are a Python expert"` |62| `--system-prompt` | Replace the entire system prompt with custom text (works in both interactive and print modes) | `claude --system-prompt "You are a Python expert"` |

57| `--system-prompt-file` | Load system prompt from a file, replacing the default prompt (print mode only) | `claude -p --system-prompt-file ./custom-prompt.txt "query"` |63| `--system-prompt-file` | Load system prompt from a file, replacing the default prompt (print mode only) | `claude -p --system-prompt-file ./custom-prompt.txt "query"` |

64| `--teleport` | Resume a [web session](/en/claude-code-on-the-web) in your local terminal | `claude --teleport` |

58| `--tools` | Restrict which built-in tools Claude can use (works in both interactive and print modes). Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"` | `claude --tools "Bash,Edit,Read"` |65| `--tools` | Restrict which built-in tools Claude can use (works in both interactive and print modes). Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"` | `claude --tools "Bash,Edit,Read"` |

59| `--verbose` | Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) | `claude --verbose` |66| `--verbose` | Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) | `claude --verbose` |

60| `--version`, `-v` | Output the version number | `claude -v` |67| `--version`, `-v` | Output the version number | `claude -v` |


96 103 

97### System prompt flags104### System prompt flags

98 105 

99Claude Code provides three flags for customizing the system prompt, each serving a different purpose:106Claude Code provides four flags for customizing the system prompt, each serving a different purpose:

100 107 

101| Flag | Behavior | Modes | Use Case |108| Flag | Behavior | Modes | Use Case |

102| :----------------------- | :--------------------------------- | :------------------ | :------------------------------------------------------------------- |109| :---------------------------- | :------------------------------------------ | :------------------ | :------------------------------------------------------------------- |

103| `--system-prompt` | **Replaces** entire default prompt | Interactive + Print | Complete control over Claude's behavior and instructions |110| `--system-prompt` | **Replaces** entire default prompt | Interactive + Print | Complete control over Claude's behavior and instructions |

104| `--system-prompt-file` | **Replaces** with file contents | Print only | Load prompts from files for reproducibility and version control |111| `--system-prompt-file` | **Replaces** with file contents | Print only | Load prompts from files for reproducibility and version control |

105| `--append-system-prompt` | **Appends** to default prompt | Interactive + Print | Add specific instructions while keeping default Claude Code behavior |112| `--append-system-prompt` | **Appends** to default prompt | Interactive + Print | Add specific instructions while keeping default Claude Code behavior |

113| `--append-system-prompt-file` | **Appends** file contents to default prompt | Print only | Load additional instructions from files while keeping defaults |

106 114 

107**When to use each:**115**When to use each:**

108 116 


121 claude --append-system-prompt "Always use TypeScript and include JSDoc comments"129 claude --append-system-prompt "Always use TypeScript and include JSDoc comments"

122 ```130 ```

123 131 

124<Note>132* **`--append-system-prompt-file`**: Use when you want to append instructions from a file while keeping Claude Code's defaults. Useful for version-controlled additions.

125 `--system-prompt` and `--system-prompt-file` are mutually exclusive. You cannot use both flags simultaneously.133 ```bash theme={null}

126</Note>134 claude -p --append-system-prompt-file ./prompts/style-rules.txt "Review this PR"

135 ```

127 136 

128<Tip>137`--system-prompt` and `--system-prompt-file` are mutually exclusive. The append flags can be used together with either replacement flag.

129 For most use cases, `--append-system-prompt` is recommended as it preserves Claude Code's built-in capabilities while adding your custom requirements. Use `--system-prompt` or `--system-prompt-file` only when you need complete control over the system prompt.

130</Tip>

131 138 

132For detailed information about print mode (`-p`) including output formats,139For most use cases, `--append-system-prompt` or `--append-system-prompt-file` is recommended as they preserve Claude Code's built-in capabilities while adding your custom requirements. Use `--system-prompt` or `--system-prompt-file` only when you need complete control over the system prompt.

133streaming, verbose logging, and programmatic usage, see the

134[SDK documentation](https://docs.claude.com/en/docs/agent-sdk).

135 140 

136## See also141## See also

137 142 

Details

530 530 

531## Use extended thinking (thinking mode)531## Use extended thinking (thinking mode)

532 532 

533[Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) reserves a portion of the total output token budget for Claude to reason through complex problems step-by-step. This reasoning is visible in verbose mode, which you can toggle on with `Ctrl+O`.533[Extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) is enabled by default, reserving a portion of the output token budget (up to 31,999 tokens) for Claude to reason through complex problems step-by-step. This reasoning is visible in verbose mode, which you can toggle on with `Ctrl+O`.

534 534 

535Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches. It provides more space for exploring multiple solutions, analyzing edge cases, and self-correcting mistakes.535Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches. It provides more space for exploring multiple solutions, analyzing edge cases, and self-correcting mistakes.

536 536 

537<Note>537<Note>

538 Sonnet 4.5 and Opus 4.5 have thinking enabled by default. All other models have thinking disabled by default. Use `/model` to view or switch your current model.538 Phrases like "think", "think hard", "ultrathink", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.

539</Note>539</Note>

540 540 

541You can configure thinking mode for Claude Code in several ways:541### Configure thinking mode

542 542 

543| Scope | How to enable | Details |543Thinking is enabled by default, but you can adjust or disable it.

544| --------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |

545| **Toggle shortcut** | Press `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle thinking on/off. May require [terminal configuration](/en/terminal-config) to enable Option key shortcuts |

546| **Global default** | Use `/config` to toggle thinking mode on | Sets your default across all projects.<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |

547| **Environment variable override** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | When set, applies a custom token budget to all requests, overriding your thinking mode configuration. Example: `export MAX_THINKING_TOKENS=1024` |

548 544 

549### Per-request thinking with `ultrathink`545| Scope | How to configure | Details |

550 546| ---------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |

551You can include `ultrathink` as a keyword in your message to enable thinking for a single request:547| **Toggle shortcut** | Press `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle thinking on/off for the current session. May require [terminal configuration](/en/terminal-config) to enable Option key shortcuts |

552 548| **Global default** | Use `/config` to toggle thinking mode | Sets your default across all projects.<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |

553```549| **Limit token budget** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | Limit the thinking budget to a specific number of tokens. Example: `export MAX_THINKING_TOKENS=10000` |

554> ultrathink: design a caching layer for our API

555```

556 

557Note that `ultrathink` both allocates the thinking budget AND semantically signals to Claude to reason more thoroughly, which may result in deeper thinking than necessary for your task.

558 

559The `ultrathink` keyword only works when `MAX_THINKING_TOKENS` is not set. When `MAX_THINKING_TOKENS` is configured, it takes priority and controls the thinking budget for all requests.

560 

561Other phrases like "think", "think hard", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.

562 550 

563To view Claude's thinking process, press `Ctrl+O` to toggle verbose mode and see the internal reasoning displayed as gray italic text.551To view Claude's thinking process, press `Ctrl+O` to toggle verbose mode and see the internal reasoning displayed as gray italic text.

564 552 

565See the [token budget section below](#how-extended-thinking-token-budgets-work) for detailed budget information and cost implications.

566 

567### How extended thinking token budgets work553### How extended thinking token budgets work

568 554 

569Extended thinking uses a **token budget** that controls how much internal reasoning Claude can perform before responding.555Extended thinking uses a **token budget** that controls how much internal reasoning Claude can perform before responding.


576 562 

577Token budgets for thinking mode:563Token budgets for thinking mode:

578 564 

579* When thinking is **enabled** (via `/config` or `ultrathink`), Claude can use up to **31,999 tokens** from your output budget for internal reasoning565* When thinking is **enabled**, Claude can use up to **31,999 tokens** from your output budget for internal reasoning

580* When thinking is **disabled**, Claude uses **0 tokens** for thinking566* When thinking is **disabled** (via toggle or `/config`), Claude uses **0 tokens** for thinking

581 567 

582**Custom token budgets:**568**Limit the thinking budget:**

583 569 

584* You can set a custom thinking token budget using the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables)570* Use the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables) to cap the thinking budget

585* This takes highest priority and overrides the default 31,999 token budget571* When set, this value limits the maximum tokens Claude can use for thinking

586* See the [extended thinking documentation](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for valid token ranges572* See the [extended thinking documentation](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for valid token ranges

587 573 

588<Warning>574<Warning>

costs.md +1 −1

Details

62 62 

63* **Compact conversations:**63* **Compact conversations:**

64 64 

65 * Claude uses auto-compact by default when context exceeds 95% capacity65 * Claude uses auto-compact by default when context reaches approximately 95% capacity. To trigger compaction earlier, set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](/en/settings#environment-variables) to a lower percentage (for example, `50`)

66 * Toggle auto-compact: Run `/config` and navigate to "Auto-compact enabled"66 * Toggle auto-compact: Run `/config` and navigate to "Auto-compact enabled"

67 * Use `/compact` manually when context gets large67 * Use `/compact` manually when context gets large

68 * Add custom instructions: `/compact Focus on code samples and API usage`68 * Add custom instructions: `/compact Focus on code samples and API usage`

hooks.md +6 −1

Details

809* Combine with `"permissionDecision": "allow"` to modify the input and auto-approve the tool call809* Combine with `"permissionDecision": "allow"` to modify the input and auto-approve the tool call

810* Combine with `"permissionDecision": "ask"` to modify the input and show it to the user for confirmation810* Combine with `"permissionDecision": "ask"` to modify the input and show it to the user for confirmation

811 811 

812Hooks can also provide context to Claude using `additionalContext`:

813 

814* `"hookSpecificOutput.additionalContext"` adds a string to Claude's context before the tool executes.

815 

812```json theme={null}816```json theme={null}

813{817{

814 "hookSpecificOutput": {818 "hookSpecificOutput": {


817 "permissionDecisionReason": "My reason here",821 "permissionDecisionReason": "My reason here",

818 "updatedInput": {822 "updatedInput": {

819 "field_to_modify": "new value"823 "field_to_modify": "new value"

820 }824 },

825 "additionalContext": "Current environment: production. Proceed with caution."

821 }826 }

822}827}

823```828```

iam.md +4 −2

Details

134 134 

135 For more reliable URL filtering, consider:135 For more reliable URL filtering, consider:

136 136 

137 * Using the WebFetch tool with `WebFetch(domain:github.com)` permission137 * **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

138 * **Use PreToolUse hooks**: Implement a hook that validates URLs in Bash commands and blocks disallowed domains

138 * Instructing Claude Code about your allowed curl patterns via CLAUDE.md139 * Instructing Claude Code about your allowed curl patterns via CLAUDE.md

139 * Using hooks for custom permission validation140 

141 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.

140</Warning>142</Warning>

141 143 

142**Read & Edit**144**Read & Edit**

mcp.md +56 −0

Details

797 * Resources can contain any type of content that the MCP server provides (text, JSON, structured data, etc.)797 * Resources can contain any type of content that the MCP server provides (text, JSON, structured data, etc.)

798</Tip>798</Tip>

799 799 

800## Scale with MCP Tool Search

801 

802When you have many MCP servers configured, tool definitions can consume a significant portion of your context window. MCP Tool Search solves this by dynamically loading tools on-demand instead of preloading all of them.

803 

804### How it works

805 

806Claude Code automatically enables Tool Search when your MCP tool descriptions would consume more than 10% of the context window. You can [adjust this threshold](#configure-tool-search) or disable tool search entirely. When triggered:

807 

8081. MCP tools are deferred rather than loaded into context upfront

8092. Claude uses a search tool to discover relevant MCP tools when needed

8103. Only the tools Claude actually needs are loaded into context

8114. MCP tools continue to work exactly as before from your perspective

812 

813### For MCP server authors

814 

815If you're building an MCP server, the server instructions field becomes more useful with Tool Search enabled. Server instructions help Claude understand when to search for your tools, similar to how [skills](/en/skills) work.

816 

817Add clear, descriptive server instructions that explain:

818 

819* What category of tasks your tools handle

820* When Claude should search for your tools

821* Key capabilities your server provides

822 

823### Configure tool search

824 

825Tool search runs in auto mode by default, meaning it activates only when your MCP tool definitions exceed the context threshold. If you have few tools, they load normally without tool search. 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.

826 

827Control tool search behavior with the `ENABLE_TOOL_SEARCH` environment variable:

828 

829| Value | Behavior |

830| :--------- | :--------------------------------------------------------------------------------- |

831| `auto` | Activates when MCP tools exceed 10% of context (default) |

832| `auto:<N>` | Activates at custom threshold, where `<N>` is a percentage (e.g., `auto:5` for 5%) |

833| `true` | Always enabled |

834| `false` | Disabled, all MCP tools loaded upfront |

835 

836```bash theme={null}

837# Use a custom 5% threshold

838ENABLE_TOOL_SEARCH=auto:5 claude

839 

840# Disable tool search entirely

841ENABLE_TOOL_SEARCH=false claude

842```

843 

844Or set the value in your [settings.json `env` field](/en/settings#available-settings).

845 

846You can also disable the MCPSearch tool specifically using the `disallowedTools` setting:

847 

848```json theme={null}

849{

850 "permissions": {

851 "deny": ["MCPSearch"]

852 }

853}

854```

855 

800## Use MCP prompts as slash commands856## Use MCP prompts as slash commands

801 857 

802MCP servers can expose prompts that become available as slash commands in Claude Code.858MCP servers can expose prompts that become available as slash commands in Claude Code.

overview.md +13 −1

Details

31 ```batch theme={null}31 ```batch theme={null}

32 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd32 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

33 ```33 ```

34 

35 <Info>

36 Native installations automatically update in the background to keep you on the latest version.

37 </Info>

34 </Tab>38 </Tab>

35 39 

36 <Tab title="Homebrew">40 <Tab title="Homebrew">

37 ```sh theme={null}41 ```sh theme={null}

38 brew install --cask claude-code42 brew install --cask claude-code

39 ```43 ```

44 

45 <Info>

46 Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.

47 </Info>

40 </Tab>48 </Tab>

41 49 

42 <Tab title="WinGet">50 <Tab title="WinGet">

43 ```powershell theme={null}51 ```powershell theme={null}

44 winget install Anthropic.ClaudeCode52 winget install Anthropic.ClaudeCode

45 ```53 ```

54 

55 <Info>

56 WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

57 </Info>

46 </Tab>58 </Tab>

47</Tabs>59</Tabs>

48 60 


56You'll be prompted to log in on first use. That's it! [Continue with Quickstart (5 minutes) →](/en/quickstart)68You'll be prompted to log in on first use. That's it! [Continue with Quickstart (5 minutes) →](/en/quickstart)

57 69 

58<Tip>70<Tip>

59 Claude Code automatically keeps itself up to date. See [advanced setup](/en/setup) for installation options, manual updates, or uninstallation instructions. Visit [troubleshooting](/en/troubleshooting) if you hit issues.71 See [advanced setup](/en/setup) for installation options, manual updates, or uninstallation instructions. Visit [troubleshooting](/en/troubleshooting) if you hit issues.

60</Tip>72</Tip>

61 73 

62## What Claude Code does for you74## What Claude Code does for you

quickstart.md +12 −0

Details

35 ```batch theme={null}35 ```batch theme={null}

36 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd36 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

37 ```37 ```

38 

39 <Info>

40 Native installations automatically update in the background to keep you on the latest version.

41 </Info>

38 </Tab>42 </Tab>

39 43 

40 <Tab title="Homebrew">44 <Tab title="Homebrew">

41 ```sh theme={null}45 ```sh theme={null}

42 brew install --cask claude-code46 brew install --cask claude-code

43 ```47 ```

48 

49 <Info>

50 Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.

51 </Info>

44 </Tab>52 </Tab>

45 53 

46 <Tab title="WinGet">54 <Tab title="WinGet">

47 ```powershell theme={null}55 ```powershell theme={null}

48 winget install Anthropic.ClaudeCode56 winget install Anthropic.ClaudeCode

49 ```57 ```

58 

59 <Info>

60 WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

61 </Info>

50 </Tab>62 </Tab>

51</Tabs>63</Tabs>

52 64 

sandboxing.md +1 −1

Details

216* [Security](/en/security) - Comprehensive security features and best practices216* [Security](/en/security) - Comprehensive security features and best practices

217* [IAM](/en/iam) - Permission configuration and access control217* [IAM](/en/iam) - Permission configuration and access control

218* [Settings](/en/settings) - Complete configuration reference218* [Settings](/en/settings) - Complete configuration reference

219* [CLI reference](/en/cli-reference) - Command-line options including `-sb`219* [CLI reference](/en/cli-reference) - Command-line options

220 220 

221 221 

222---222---

settings.md +17 −5

Details

157| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |157| `awsAuthRefresh` | Custom script that modifies the `.aws` directory (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `aws sso login --profile myprofile` |

158| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |158| `awsCredentialExport` | Custom script that outputs JSON with AWS credentials (see [advanced credential configuration](/en/amazon-bedrock#advanced-credential-configuration)) | `/bin/generate_aws_grant.sh` |

159| `alwaysThinkingEnabled` | Enable [extended thinking](/en/common-workflows#use-extended-thinking) by default for all sessions. Typically configured via the `/config` command rather than editing directly | `true` |159| `alwaysThinkingEnabled` | Enable [extended thinking](/en/common-workflows#use-extended-thinking) by default for all sessions. Typically configured via the `/config` command rather than editing directly | `true` |

160| `plansDirectory` | Customize where plan files are stored. Path is relative to project root. Default: `~/.claude/plans` | `"./plans"` |

161| `showTurnDuration` | Show turn duration messages after responses (e.g., "Cooked for 1m 6s"). Set to `false` to hide these messages | `true` |

160| `language` | Configure Claude's preferred response language (e.g., `"japanese"`, `"spanish"`, `"french"`). Claude will respond in this language by default | `"japanese"` |162| `language` | Configure Claude's preferred response language (e.g., `"japanese"`, `"spanish"`, `"french"`). Claude will respond in this language by default | `"japanese"` |

161| `autoUpdatesChannel` | Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release | `"stable"` |163| `autoUpdatesChannel` | Release channel to follow for updates. Use `"stable"` for a version that is typically about one week old and skips versions with major regressions, or `"latest"` (default) for the most recent release | `"stable"` |

164| `spinnerTipsEnabled` | Show tips in the spinner while Claude is working. Set to `false` to disable tips (default: `true`) | `false` |

165| `terminalProgressBarEnabled` | Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: `true`) | `false` |

162 166 

163### Permission settings167### Permission settings

164 168 


672</Note>676</Note>

673 677 

674| Variable | Purpose |678| Variable | Purpose |

675| :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |679| :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

676| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) |680| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) |

677| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |681| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |

678| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers you want to add to the request (in `Name: Value` format) |682| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers you want to add to the request (in `Name: Value` format) |


687| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands |691| `BASH_DEFAULT_TIMEOUT_MS` | Default timeout for long-running bash commands |

688| `BASH_MAX_OUTPUT_LENGTH` | Maximum number of characters in bash outputs before they are middle-truncated |692| `BASH_MAX_OUTPUT_LENGTH` | Maximum number of characters in bash outputs before they are middle-truncated |

689| `BASH_MAX_TIMEOUT_MS` | Maximum timeout the model can set for long-running bash commands |693| `BASH_MAX_TIMEOUT_MS` | Maximum timeout the model can set for long-running bash commands |

694| `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like `50` to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the `context_window.used_percentage` field available in [status line](/en/statusline) |

690| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command |695| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command |

691| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) |696| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) |

692| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |697| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication |


694| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |699| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication |

695| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to disable Anthropic API-specific `anthropic-beta` headers. Use this if experiencing issues like "Unexpected value(s) for the `anthropic-beta` header" when using an LLM gateway with third-party providers |700| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to disable Anthropic API-specific `anthropic-beta` headers. Use this if experiencing issues like "Unexpected value(s) for the `anthropic-beta` header" when using an LLM gateway with third-party providers |

696| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut |701| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut |

702| `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY` | Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode |

703| `CLAUDE_CODE_PROXY_RESOLVES_HOSTS` | Set to `true` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution |

704| `CLAUDE_CODE_TMPDIR` | Override the temp directory used for internal temp files. Claude Code appends `/claude/` to this path. Default: `/tmp` on Unix/macOS, `os.tmpdir()` on Windows |

697| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |705| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` |

698| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |706| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context |

699| `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS` | Override the default token limit for file reads. Useful when you need to read larger files in full |707| `CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS` | Override the default token limit for file reads. Useful when you need to read larger files in full |

700| `CLAUDE_CODE_HIDE_ACCOUNT_INFO` | Set to `1` to hide your email address and organization name from the Claude Code UI. Useful when streaming or recording |708| `CLAUDE_CODE_HIDE_ACCOUNT_INFO` | Set to `1` to hide your email address and organization name from the Claude Code UI. Useful when streaming or recording |

701| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |709| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions |

702| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests |710| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests. Default: 32,000. Maximum: 64,000. Increasing this value reduces the effective context window available before [auto-compaction](/en/costs#reduce-token-usage) triggers. |

703| `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) |711| `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) |

704| `CLAUDE_CODE_SHELL` | Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) |712| `CLAUDE_CODE_SHELL` | Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) |

705| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` |713| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` |


721| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models |729| `DISABLE_PROMPT_CACHING_OPUS` | Set to `1` to disable prompt caching for Opus models |

722| `DISABLE_PROMPT_CACHING_SONNET` | Set to `1` to disable prompt caching for Sonnet models |730| `DISABLE_PROMPT_CACHING_SONNET` | Set to `1` to disable prompt caching for Sonnet models |

723| `DISABLE_TELEMETRY` | Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |731| `DISABLE_TELEMETRY` | Set to `1` to opt out of Statsig telemetry (note that Statsig events do not include user data like code, file paths, or bash commands) |

732| `ENABLE_TOOL_SEARCH` | Controls [MCP tool search](/en/mcp#scale-with-mcp-tool-search). Values: `auto` (default, enables at 10% context), `auto:N` (custom threshold, e.g., `auto:5` for 5%), `true` (always on), `false` (disabled) |

733| `FORCE_AUTOUPDATE_PLUGINS` | Set to `true` to force plugin auto-updates even when the main auto-updater is disabled via `DISABLE_AUTOUPDATER` |

724| `HTTP_PROXY` | Specify HTTP proxy server for network connections |734| `HTTP_PROXY` | Specify HTTP proxy server for network connections |

725| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections |735| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections |

736| `IS_DEMO` | Set to `true` to enable demo mode: hides email and organization from the UI, skips onboarding, and hides internal commands. Useful for streaming or recording sessions |

726| `MAX_MCP_OUTPUT_TOKENS` | Maximum number of tokens allowed in MCP tool responses. Claude Code displays a warning when output exceeds 10,000 tokens (default: 25000) |737| `MAX_MCP_OUTPUT_TOKENS` | Maximum number of tokens allowed in MCP tool responses. Claude Code displays a warning when output exceeds 10,000 tokens (default: 25000) |

727| `MAX_THINKING_TOKENS` | Enable [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) and set the token budget for the thinking process. Extended thinking improves performance on complex reasoning and coding tasks but impacts [prompt caching efficiency](https://docs.claude.com/en/docs/build-with-claude/prompt-caching#caching-with-thinking-blocks). Disabled by default. |738| `MAX_THINKING_TOKENS` | Override the [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) token budget. Thinking is enabled at max budget (31,999 tokens) by default. Use this to limit the budget (for example, `MAX_THINKING_TOKENS=10000`) or disable thinking entirely (`MAX_THINKING_TOKENS=0`). Extended thinking improves performance on complex reasoning and coding tasks but impacts [prompt caching efficiency](https://docs.claude.com/en/docs/build-with-claude/prompt-caching#caching-with-thinking-blocks). |

728| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup |739| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup |

729| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |740| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution |

730| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |741| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy |


741Claude Code has access to a set of powerful tools that help it understand and modify your codebase:752Claude Code has access to a set of powerful tools that help it understand and modify your codebase:

742 753 

743| Tool | Description | Permission Required |754| Tool | Description | Permission Required |

744| :------------------ | :------------------------------------------------------------------------------------------------ | :------------------ |755| :------------------ | :------------------------------------------------------------------------------------------------- | :------------------ |

745| **AskUserQuestion** | Asks multiple-choice questions to gather requirements or clarify ambiguity | No |756| **AskUserQuestion** | Asks multiple-choice questions to gather requirements or clarify ambiguity | No |

746| **Bash** | Executes shell commands in your environment (see [Bash tool behavior](#bash-tool-behavior) below) | Yes |757| **Bash** | Executes shell commands in your environment (see [Bash tool behavior](#bash-tool-behavior) below) | Yes |

747| **BashOutput** | Retrieves output from a background bash shell | No |758| **TaskOutput** | Retrieves output from a background task (bash shell or subagent) | No |

748| **Edit** | Makes targeted edits to specific files | Yes |759| **Edit** | Makes targeted edits to specific files | Yes |

749| **ExitPlanMode** | Prompts the user to exit plan mode and start coding | Yes |760| **ExitPlanMode** | Prompts the user to exit plan mode and start coding | Yes |

750| **Glob** | Finds files based on pattern matching | No |761| **Glob** | Finds files based on pattern matching | No |

751| **Grep** | Searches for patterns in file contents | No |762| **Grep** | Searches for patterns in file contents | No |

752| **KillShell** | Kills a running background bash shell by its ID | No |763| **KillShell** | Kills a running background bash shell by its ID | No |

764| **MCPSearch** | Searches for and loads MCP tools when [tool search](/en/mcp#scale-with-mcp-tool-search) is enabled | No |

753| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |765| **NotebookEdit** | Modifies Jupyter notebook cells | Yes |

754| **Read** | Reads the contents of files | No |766| **Read** | Reads the contents of files | No |

755| **Skill** | Executes a [skill or slash command](/en/slash-commands#skill-tool) within the main conversation | Yes |767| **Skill** | Executes a [skill or slash command](/en/slash-commands#skill-tool) within the main conversation | Yes |

setup.md +13 −1

Details

4 4 

5## System requirements5## System requirements

6 6 

7* **Operating Systems**: macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (with WSL 1, WSL 2, or Git for Windows)7* **Operating Systems**: macOS 13.0+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (with WSL 1, WSL 2, or Git for Windows)

8* **Hardware**: 4 GB+ RAM8* **Hardware**: 4 GB+ RAM

9* **Network**: Internet connection required (see [network configuration](/en/network-config#network-access-requirements))9* **Network**: Internet connection required (see [network configuration](/en/network-config#network-access-requirements))

10* **Shell**: Works best in Bash or Zsh10* **Shell**: Works best in Bash or Zsh


38 ```batch theme={null}38 ```batch theme={null}

39 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd39 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

40 ```40 ```

41 

42 <Info>

43 Native installations automatically update in the background to keep you on the latest version.

44 </Info>

41 </Tab>45 </Tab>

42 46 

43 <Tab title="Homebrew">47 <Tab title="Homebrew">

44 ```sh theme={null}48 ```sh theme={null}

45 brew install --cask claude-code49 brew install --cask claude-code

46 ```50 ```

51 

52 <Info>

53 Homebrew installations do not auto-update. Run `brew upgrade claude-code` periodically to get the latest features and security fixes.

54 </Info>

47 </Tab>55 </Tab>

48 56 

49 <Tab title="WinGet">57 <Tab title="WinGet">

50 ```powershell theme={null}58 ```powershell theme={null}

51 winget install Anthropic.ClaudeCode59 winget install Anthropic.ClaudeCode

52 ```60 ```

61 

62 <Info>

63 WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

64 </Info>

53 </Tab>65 </Tab>

54</Tabs>66</Tabs>

55 67 

skills.md +26 −0

Details

109 109 

110If two Skills have the same name, the higher row wins: managed overrides personal, personal overrides project, and project overrides plugin.110If two Skills have the same name, the higher row wins: managed overrides personal, personal overrides project, and project overrides plugin.

111 111 

112#### Automatic discovery from nested directories

113 

114When you work with files in subdirectories, Claude Code automatically discovers Skills from nested `.claude/skills/` directories. For example, if you're editing a file in `packages/frontend/`, Claude Code also looks for Skills in `packages/frontend/.claude/skills/`. This supports monorepo setups where packages have their own Skills.

115 

112### When to use Skills versus other options116### When to use Skills versus other options

113 117 

114Claude Code offers several ways to customize behavior. The key difference: **Skills are triggered automatically by Claude** based on your request, while slash commands require you to type `/command` explicitly.118Claude Code offers several ways to customize behavior. The key difference: **Skills are triggered automatically by Claude** based on your request, while slash commands require you to type `/command` explicitly.


168| `hooks` | No | Define hooks scoped to this Skill's lifecycle. Supports `PreToolUse`, `PostToolUse`, and `Stop` events. |172| `hooks` | No | Define hooks scoped to this Skill's lifecycle. Supports `PreToolUse`, `PostToolUse`, and `Stop` events. |

169| `user-invocable` | No | Controls whether the Skill appears in the slash command menu. Does not affect the [`Skill` tool](/en/slash-commands#skill-tool) or automatic discovery. Defaults to `true`. See [Control Skill visibility](#control-skill-visibility). |173| `user-invocable` | No | Controls whether the Skill appears in the slash command menu. Does not affect the [`Skill` tool](/en/slash-commands#skill-tool) or automatic discovery. Defaults to `true`. See [Control Skill visibility](#control-skill-visibility). |

170 174 

175#### Available string substitutions

176 

177Skills support string substitution for dynamic values in the Skill content:

178 

179| Variable | Description |

180| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------- |

181| `$ARGUMENTS` | All arguments passed when invoking the Skill. If `$ARGUMENTS` is not present in the content, arguments are appended as `ARGUMENTS: <value>`. |

182| `${CLAUDE_SESSION_ID}` | The current session ID. Useful for logging, creating session-specific files, or correlating Skill output with sessions. |

183 

184**Example using substitutions:**

185 

186```yaml theme={null}

187---

188name: session-logger

189description: Log activity for this session

190---

191 

192Log the following to logs/${CLAUDE_SESSION_ID}.log:

193 

194$ARGUMENTS

195```

196 

171See the [best practices guide](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices) for complete authoring guidance including validation rules.197See the [best practices guide](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices) for complete authoring guidance including validation rules.

172 198 

173### Update or delete a Skill199### Update or delete a Skill

Details

5## Built-in slash commands5## Built-in slash commands

6 6 

7| Command | Purpose |7| Command | Purpose |

8| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------- |8| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------- |

9| `/add-dir` | Add additional working directories |9| `/add-dir` | Add additional working directories |

10| `/agents` | Manage custom AI subagents for specialized tasks |10| `/agents` | Manage custom AI subagents for specialized tasks |

11| `/bashes` | List and manage background tasks |11| `/bashes` | List and manage background tasks |

12| `/bug` | Report bugs (sends conversation to Anthropic) |12| `/bug` | Report bugs (sends conversation to Anthropic) |

13| `/clear` | Clear conversation history |13| `/clear` | Clear conversation history |

14| `/compact [instructions]` | Compact conversation with optional focus instructions |14| `/compact [instructions]` | Compact conversation with optional focus instructions |

15| `/config` | Open the Settings interface (Config tab) |15| `/config` | Open the Settings interface (Config tab). Type to search and filter settings |

16| `/context` | Visualize current context usage as a colored grid |16| `/context` | Visualize current context usage as a colored grid |

17| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details. |17| `/cost` | Show token usage statistics. See [cost tracking guide](/en/costs#using-the-cost-command) for subscription-specific details. |

18| `/doctor` | Checks the health of your Claude Code installation |18| `/doctor` | Checks installation health. Shows Updates section with auto-update channel and available npm versions |

19| `/exit` | Exit the REPL |19| `/exit` | Exit the REPL |

20| `/export [filename]` | Export the current conversation to a file or clipboard |20| `/export [filename]` | Export the current conversation to a file or clipboard |

21| `/help` | Get usage help |21| `/help` | Get usage help |


42| `/rewind` | Rewind the conversation and/or code |42| `/rewind` | Rewind the conversation and/or code |

43| `/sandbox` | Enable sandboxed bash tool with filesystem and network isolation for safer, more autonomous execution |43| `/sandbox` | Enable sandboxed bash tool with filesystem and network isolation for safer, more autonomous execution |

44| `/security-review` | Complete a security review of pending changes on the current branch |44| `/security-review` | Complete a security review of pending changes on the current branch |

45| `/stats` | Visualize daily usage, session history, streaks, and model preferences |45| `/stats` | Visualize daily usage, session history, streaks, and model preferences. Press `r` to cycle date ranges (Last 7 days, Last 30 days, All time) |

46| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |46| `/status` | Open the Settings interface (Status tab) showing version, model, account, and connectivity |

47| `/statusline` | Set up Claude Code's status line UI |47| `/statusline` | Set up Claude Code's status line UI |

48| `/teleport` | Resume a remote session from claude.ai by session ID, or open a picker (claude.ai subscribers) |48| `/teleport` | Resume a remote session from claude.ai by session ID, or open a picker (claude.ai subscribers) |

statusline.md +19 −1

Details

63 "total_input_tokens": 15234,63 "total_input_tokens": 15234,

64 "total_output_tokens": 4521,64 "total_output_tokens": 4521,

65 "context_window_size": 200000,65 "context_window_size": 200000,

66 "used_percentage": 42.5,

67 "remaining_percentage": 57.5,

66 "current_usage": {68 "current_usage": {

67 "input_tokens": 8500,69 "input_tokens": 8500,

68 "output_tokens": 1200,70 "output_tokens": 1200,


207Display the percentage of context window consumed. The `context_window` object contains:209Display the percentage of context window consumed. The `context_window` object contains:

208 210 

209* `total_input_tokens` / `total_output_tokens`: Cumulative totals across the entire session211* `total_input_tokens` / `total_output_tokens`: Cumulative totals across the entire session

212* `used_percentage`: Pre-calculated percentage of context window used (0-100)

213* `remaining_percentage`: Pre-calculated percentage of context window remaining (0-100)

210* `current_usage`: Current context window usage from the last API call (may be `null` if no messages yet)214* `current_usage`: Current context window usage from the last API call (may be `null` if no messages yet)

211 * `input_tokens`: Input tokens in current context215 * `input_tokens`: Input tokens in current context

212 * `output_tokens`: Output tokens generated216 * `output_tokens`: Output tokens generated

213 * `cache_creation_input_tokens`: Tokens written to cache217 * `cache_creation_input_tokens`: Tokens written to cache

214 * `cache_read_input_tokens`: Tokens read from cache218 * `cache_read_input_tokens`: Tokens read from cache

215 219 

216For accurate context percentage, use `current_usage` which reflects the actual context window state:220You can use the pre-calculated `used_percentage` and `remaining_percentage` fields directly, or calculate from `current_usage` for more control.

221 

222**Simple approach using pre-calculated percentages:**

223 

224```bash theme={null}

225#!/bin/bash

226input=$(cat)

227 

228MODEL=$(echo "$input" | jq -r '.model.display_name')

229PERCENT_USED=$(echo "$input" | jq -r '.context_window.used_percentage // 0')

230 

231echo "[$MODEL] Context: ${PERCENT_USED}%"

232```

233 

234**Advanced approach with manual calculation:**

217 235 

218```bash theme={null}236```bash theme={null}

219#!/bin/bash237#!/bin/bash

sub-agents.md +1 −1

Details

499 499 

500#### Auto-compaction500#### Auto-compaction

501 501 

502Subagents support automatic compaction using the same logic as the main conversation. When a subagent's context approaches its limit, Claude Code summarizes older messages to free up space while preserving important context.502Subagents support automatic compaction using the same logic as the main conversation. By default, auto-compaction triggers at approximately 95% capacity. To trigger compaction earlier, set `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` to a lower percentage (for example, `50`). See [environment variables](/en/settings#environment-variables) for details.

503 503 

504Compaction events are logged in subagent transcript files:504Compaction events are logged in subagent transcript files:

505 505