跳至主要內容

工程手冊 / RELEASE 2.1.307

Claude Code CLI 完整參考

單一可搜尋介面,整合本機遞迴 help、官方文件與已發布設定 schema,並保留每筆資料的可用性差異。

閱讀完整使用指南 → CAPTURED 2026-10-22 · darwin-arm64
CMD
64
FLAGS
327
SLASH
120
CONFIG
249
ENV
391
834 筆顯示中
01

命令路徑

runtime-confirmed 來自已安裝版本;展開項目可查看旗標與範例。

claude 已由 runtime 確認 需檢視 83 個旗標
claude [options] [command] [prompt]

Start Claude Code interactively, run a headless prompt, or manage a session.

--add-dir <directories>

Add directories Claude may read and edit for this session.

已由 runtime 確認 一般
--agent <agent>

Use a named agent for this session.

已由 runtime 確認 需檢視
--agents <json-or-file>

Define session subagents with a JSON object, or with --print a file that holds one.

已由 runtime 確認 需檢視
--allow-dangerously-skip-permissions

Control Claude Code allow dangerously skip permissions behavior.

已由 runtime 確認 高風險
--allowed-tools, --allowedTools <tools>

Grant matching tools without a permission prompt.

已由 runtime 確認 需檢視
--append-system-prompt <prompt>

Append text to the default system prompt.

已由 runtime 確認 需檢視
--autocompact <auto-or-tokens>

Set the auto-compact context window for this session.

已由 runtime 確認 一般
--ax-screen-reader

Control Claude Code ax screen reader behavior.

已由 runtime 確認 一般
--background, --bg

Control Claude Code background behavior.

已由 runtime 確認 一般
-r, --resume <session>

Resume a session by ID or name, or open the session picker.

已由 runtime 確認 一般
--bare

Control Claude Code bare behavior.

已由 runtime 確認 一般
--settings <file-or-json>

Load additional settings from a file or inline JSON.

已由 runtime 確認 需檢視
--plugin-dir <paths>

Load plugins from directories for this session.

已由 runtime 確認 需檢視
--betas <betas>

Include API beta headers for requests.

已由 runtime 確認 一般
--brief

Enable the compact runtime presentation.

已由 runtime 確認 一般
--chrome

Control Claude Code chrome behavior.

已由 runtime 確認 一般
--cloud <description-or-session>

Create or attach to a Claude Code on the web session.

已由 runtime 確認 一般
-c, --continue

Continue the most recent conversation in the current directory.

已由 runtime 確認 一般
--dangerously-skip-permissions

Control Claude Code dangerously skip permissions behavior.

已由 runtime 確認 高風險
-d, --debug <filter>

Enable debug mode, optionally filtering categories.

已由 runtime 確認 一般
--debug-file <path>

Write debug logs to a file and enable debug mode.

已由 runtime 確認 需檢視
--desktop

Open the session in the Claude Desktop app instead of the terminal.

已由 runtime 確認 一般
--disable-slash-commands

Control Claude Code disable slash commands behavior.

已由 runtime 確認 一般
--disallowed-tools, --disallowedTools <tools>

Remove matching tools from the model-visible tool set.

已由 runtime 確認 需檢視
--effort <level>

Set the reasoning effort level for the session.

已由 runtime 確認 一般
--environment <environment-id>

Create a cloud session on a named self-hosted environment.

已由 runtime 確認 一般
--exclude-dynamic-system-prompt-sections

Control Claude Code exclude dynamic system prompt sections behavior.

已由 runtime 確認 需檢視
--fallback-model <model>

Use a fallback model when the primary model is overloaded.

已由 runtime 確認 一般
--file <specs>

Download file resources at startup using file specifications.

已由 runtime 確認 需檢視
--fork-session

Control Claude Code fork session behavior.

已由 runtime 確認 一般
--forward-subagent-text

Control Claude Code forward subagent text behavior.

已由 runtime 確認 需檢視
-p, --print

Print a non-interactive response and exit.

已由 runtime 確認 一般
--output-format <format>

Select print-mode output: text, json, or stream-json.

已由 runtime 確認 一般
--from-pr <pr>

Resume a session linked to a pull request.

已由 runtime 確認 一般
-h, --help

Control Claude Code help behavior.

已由 runtime 確認 一般
--ide

Control Claude Code ide behavior.

已由 runtime 確認 一般
--include-hook-events

Control Claude Code include hook events behavior.

已由 runtime 確認 一般
--include-partial-messages

Control Claude Code include partial messages behavior.

已由 runtime 確認 一般
--input-format <format>

Select print-mode input: text or stream-json.

已由 runtime 確認 一般
--json-schema <schema>

Validate print-mode structured output against a JSON Schema.

已由 runtime 確認 一般
--max-budget-usd <amount>

Stop print-mode execution at an approximate dollar budget.

已由 runtime 確認 一般
--mcp-config <configs>

Load MCP servers from JSON files or inline JSON.

已由 runtime 確認 需檢視
--model <model>

Choose a model alias or full model ID.

已由 runtime 確認 一般
-n, --name <name>

Name the session.

已由 runtime 確認 一般
--no-chrome

Control Claude Code no chrome behavior.

已由 runtime 確認 一般
--no-session-persistence

Control Claude Code no session persistence behavior.

已由 runtime 確認 一般
--permission-mode <mode>

Start in a selected permission mode.

已由 runtime 確認 需檢視
--permission-prompts <target>

Choose who answers print-mode permission prompts: the host or nobody.

已由 runtime 確認 需檢視
--permission-prompt-tool <tool>

Delegate permission prompts to an MCP tool in print mode.

已由 runtime 確認 需檢視
--plugin-url <urls>

Load plugins from URLs for this session.

已由 runtime 確認 需檢視
--prompt-suggestions

Control Claude Code prompt suggestions behavior.

已由 runtime 確認 一般
--remote-control, --rc <name>

Start an interactive session with Remote Control enabled.

已由 runtime 確認 一般
--remote-control-session-name-prefix <prefix>

Prefix automatically generated Remote Control session names.

已由 runtime 確認 一般
--replay-user-messages

Replay stream-json user messages on stdout for acknowledgement.

已由 runtime 確認 一般
--restricted

Remove code-running tools and WebFetch, ignore user/project/local settings, and confine file tools to the working directories.

已由 runtime 確認 一般
--strict-mcp-config

Control Claude Code strict mcp config behavior.

已由 runtime 確認 需檢視
--safe-mode

Control Claude Code safe mode behavior.

已由 runtime 確認 一般
--session-id <uuid>

Use a specific UUID for the new conversation.

已由 runtime 確認 一般
--setting-sources <sources>

Choose which setting scopes to load.

已由 runtime 確認 一般
--system-prompt <prompt>

Replace the default system prompt in print mode.

已由 runtime 確認 需檢視
--system-prompt-snapshot <on-or-off>

Record the system prompt once per conversation and reuse it verbatim, or render it fresh every request.

已由 runtime 確認 需檢視
--teleport <session>

Resume a Claude Code on the web session in this terminal.

已由 runtime 確認 一般
--tmux

Control Claude Code tmux behavior.

已由 runtime 確認 一般
--tools <tools>

Restrict the tools available to Claude.

已由 runtime 確認 需檢視
--verbose

Control Claude Code verbose behavior.

已由 runtime 確認 一般
-v, --version

Control Claude Code version behavior.

已由 runtime 確認 一般
-w, --worktree <name>

Start Claude in an isolated git worktree.

已由 runtime 確認 一般
--advisor <model>

Enable the server-side advisor tool with a selected model.

條件式 一般
--append-subagent-system-prompt <prompt>

Append instructions to every subagent system prompt in print mode.

官方文件 需檢視
--append-subagent-system-prompt-file <file>

Append a file to every subagent system prompt in print mode.

官方文件 需檢視
--append-system-prompt-file <file>

Append a file to the default system prompt in print mode.

官方文件 需檢視
--channels <channels>

Enable selected development channels for the session.

條件式 一般
--dangerously-load-development-channels

Control Claude Code dangerously load development channels behavior.

條件式 需檢視
--enable-auto-mode

Control Claude Code enable auto mode behavior.

條件式 一般
--exec <command>

Run a PTY-backed shell command as a background job with --background.

官方文件 需檢視
--init

Control Claude Code init behavior.

官方文件 一般
--init-only

Control Claude Code init only behavior.

官方文件 一般
--maintenance

Control Claude Code maintenance behavior.

官方文件 需檢視
--max-turns <turns>

Limit agentic turns in print mode.

官方文件 一般
--ref <branch>

Choose the source ref for a session created with --environment.

官方文件 一般
--remote

Control Claude Code remote behavior.

官方文件 一般
--system-prompt-file <file>

Replace the default system prompt with a file in print mode.

官方文件 需檢視
--teammate-mode <mode>

Select the agent-team teammate display mode.

條件式 一般
範例 claudeclaude -p "Explain this repository"claude --resume auth-refactorclaude --permission-mode plan

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference · @anthropic-ai/claude-code 2.1.307 package metadata

claude agents 已由 runtime 確認 一般 17 個旗標
claude agents [options]

Open agent view or query active background sessions.

--add-dir <directory>

Set add dir for this command.

已由 runtime 確認 一般
--agent <agent>

Set agent for this command.

已由 runtime 確認 一般
--all

Set all for this command.

已由 runtime 確認 一般
--allow-dangerously-skip-permissions

Set allow dangerously skip permissions for this command.

已由 runtime 確認 高風險
--cwd <path>

Set cwd for this command.

已由 runtime 確認 一般
--dangerously-skip-permissions

Set dangerously skip permissions for this command.

已由 runtime 確認 高風險
--effort <level>

Set effort for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
--mcp-config <config>

Set mcp config for this command.

已由 runtime 確認 一般
--model <model>

Set model for this command.

已由 runtime 確認 一般
--permission-mode <mode>

Set permission mode for this command.

已由 runtime 確認 一般
--plugin-dir <path>

Set plugin dir for this command.

已由 runtime 確認 一般
--restricted

Set restricted for this command.

已由 runtime 確認 一般
--setting-sources <sources>

Set setting sources for this command.

已由 runtime 確認 一般
--settings, -or-json <file-or-json>

Set settings for this command.

已由 runtime 確認 一般
--strict-mcp-config

Set strict mcp config for this command.

已由 runtime 確認 一般
範例 claude agents --json

來源: Claude Code 2.1.307 recursive local help

claude auth 已由 runtime 確認 一般 1 個旗標
claude auth [options] [command]

Manage Claude Code authentication.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude auth status

來源: Claude Code 2.1.307 recursive local help

claude auth login 已由 runtime 確認 需檢視 5 個旗標
claude auth login [options]

Sign in with a Claude subscription or Anthropic Console account.

--claudeai

Set claudeai for this command.

已由 runtime 確認 需檢視
--console

Set console for this command.

已由 runtime 確認 需檢視
--email <email>

Set email for this command.

已由 runtime 確認 需檢視
-h, --help

Display help for this command.

已由 runtime 確認 需檢視
--sso

Set sso for this command.

已由 runtime 確認 需檢視
範例 claude auth login --console

來源: Claude Code 2.1.307 recursive local help

claude auth logout 已由 runtime 確認 需檢視 1 個旗標
claude auth logout [options]

Sign out from the current Anthropic account.

-h, --help

Display help for this command.

已由 runtime 確認 需檢視
範例 claude auth logout

來源: Claude Code 2.1.307 recursive local help

claude auth status 已由 runtime 確認 一般 3 個旗標
claude auth status [options]

Inspect authentication state for scripts or humans.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
--text

Set text for this command.

已由 runtime 確認 一般
範例 claude auth status --json

來源: Claude Code 2.1.307 recursive local help

claude auto-mode 已由 runtime 確認 一般 1 個旗標
claude auto-mode [options] [command]

Inspect, critique, or reset automatic permission-mode rules.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude auto-mode config

來源: Claude Code 2.1.307 recursive local help

claude auto-mode config 已由 runtime 確認 一般 1 個旗標
claude auto-mode config [options]

Print the effective automatic permission-mode configuration.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude auto-mode config

來源: Claude Code 2.1.307 recursive local help

claude auto-mode critique 已由 runtime 確認 一般 2 個旗標
claude auto-mode critique [options]

Ask a model to critique custom automatic permission rules.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--model <model>

Set model for this command.

已由 runtime 確認 一般
範例 claude auto-mode critique --model sonnet

來源: Claude Code 2.1.307 recursive local help

claude auto-mode defaults 已由 runtime 確認 一般 2 個旗標
claude auto-mode defaults [options]

Print the shipped automatic permission-mode rule set.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--label <prefix>

Set label for this command.

已由 runtime 確認 一般
範例 claude auto-mode defaults --label "Git Destructive"

來源: Claude Code 2.1.307 recursive local help

claude auto-mode reset 已由 runtime 確認 需檢視 2 個旗標
claude auto-mode reset [options]

Remove user autoMode settings and restore shipped defaults.

-h, --help

Display help for this command.

已由 runtime 確認 需檢視
-y, --yes

Set yes for this command.

已由 runtime 確認 需檢視
範例 claude auto-mode reset --yes

來源: Claude Code 2.1.307 recursive local help

claude doctor 已由 runtime 確認 一般 1 個旗標
claude doctor [options]

Run read-only installation and settings diagnostics.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude doctor

來源: Claude Code 2.1.307 recursive local help

claude gateway 已由 runtime 確認 需檢視 2 個旗標
claude gateway [options]

Start the administrator-managed Claude apps gateway.

--config <path>

Set config for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude gateway --config gateway.yaml

來源: Claude Code 2.1.307 recursive local help

claude import 已由 runtime 確認 需檢視 3 個旗標
claude import [options] [source]

Import configuration from another AI coding agent into Claude Code.

--dry-run

Set dry run for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--yes

Set yes for this command.

已由 runtime 確認 需檢視
範例 claude import codex --dry-run

來源: Claude Code 2.1.307 recursive local help

claude install 已由 runtime 確認 需檢視 2 個旗標
claude install [options] [target]

Install or reinstall a selected native Claude Code release.

--force

Set force for this command.

已由 runtime 確認 需檢視
-h, --help

Display help for this command.

已由 runtime 確認 需檢視
範例 claude install stable

來源: Claude Code 2.1.307 recursive local help

claude mcp 已由 runtime 確認 一般 1 個旗標
claude mcp [options] [command]

Configure Model Context Protocol servers.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude mcp list

來源: Claude Code 2.1.307 recursive local help

claude mcp add 已由 runtime 確認 需檢視 8 個旗標
claude mcp add [options] <name> <commandOrUrl> [args...]

Add a stdio, SSE, or HTTP MCP server.

--callback-port <port>

Set callback port for this command.

已由 runtime 確認 一般
--client-id <clientId>

Set client id for this command.

已由 runtime 確認 一般
--client-secret

Set client secret for this command.

已由 runtime 確認 需檢視
-e, --env <env>

Set env for this command.

已由 runtime 確認 需檢視
-H, --header <header>

Set header for this command.

已由 runtime 確認 需檢視
-h, --help

Display help for this command.

已由 runtime 確認 一般
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
-t, --transport <transport>

Set transport for this command.

已由 runtime 確認 一般
範例 claude mcp add --transport http sentry https://mcp.sentry.dev/mcp

來源: Claude Code 2.1.307 recursive local help

claude mcp add-from-claude-desktop 已由 runtime 確認 需檢視 2 個旗標
claude mcp add-from-claude-desktop [options]

Import MCP servers from Claude Desktop on supported systems.

-h, --help

Display help for this command.

已由 runtime 確認 一般
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
範例 claude mcp add-from-claude-desktop --scope user

來源: Claude Code 2.1.307 recursive local help

claude mcp add-json 已由 runtime 確認 需檢視 3 個旗標
claude mcp add-json [options] <name> <json>

Add an MCP server from a JSON configuration object.

--client-secret

Set client secret for this command.

已由 runtime 確認 需檢視
-h, --help

Display help for this command.

已由 runtime 確認 一般
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
範例 claude mcp add-json calendar '{"type":"http","url":"https://example.com/mcp"}'

來源: Claude Code 2.1.307 recursive local help

claude mcp get 已由 runtime 確認 一般 1 個旗標
claude mcp get [options] <name>

Inspect one configured MCP server and its approval state.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude mcp get sentry

來源: Claude Code 2.1.307 recursive local help

claude mcp list 已由 runtime 確認 一般 1 個旗標
claude mcp list [options]

List configured MCP servers and health-check approved servers.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude mcp list

來源: Claude Code 2.1.307 recursive local help

claude mcp login 已由 runtime 確認 需檢視 2 個旗標
claude mcp login [options] <name>

Run the OAuth flow for a configured remote MCP server.

-h, --help

Display help for this command.

已由 runtime 確認 需檢視
--no-browser

Set no browser for this command.

已由 runtime 確認 需檢視
範例 claude mcp login sentry --no-browser

來源: Claude Code 2.1.307 recursive local help

claude mcp logout 已由 runtime 確認 需檢視 1 個旗標
claude mcp logout [options] <name>

Clear stored OAuth credentials for an MCP server.

-h, --help

Display help for this command.

已由 runtime 確認 需檢視
範例 claude mcp logout sentry

來源: Claude Code 2.1.307 recursive local help

claude mcp remove 已由 runtime 確認 需檢視 2 個旗標
claude mcp remove [options] <name>

Remove an MCP server from a selected configuration scope.

-h, --help

Display help for this command.

已由 runtime 確認 需檢視
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
範例 claude mcp remove sentry --scope user

來源: Claude Code 2.1.307 recursive local help

claude mcp reset-project-choices 已由 runtime 確認 一般 1 個旗標
claude mcp reset-project-choices [options]

Reset approvals and rejections for project .mcp.json servers.

-h, --help

Display help for this command.

已由 runtime 確認 需檢視
範例 claude mcp reset-project-choices

來源: Claude Code 2.1.307 recursive local help

claude mcp serve 已由 runtime 確認 需檢視 3 個旗標
claude mcp serve [options]

Expose Claude Code tools as a local stdio MCP server.

-d, --debug

Set debug for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--verbose

Set verbose for this command.

已由 runtime 確認 一般
範例 claude mcp serve

來源: Claude Code 2.1.307 recursive local help

claude plugin 已由 runtime 確認 一般 1 個旗標
claude plugin|plugins [options] [command]

Manage Claude Code plugins and marketplaces.

別名: plugins
-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude plugin list

來源: Claude Code 2.1.307 recursive local help

claude plugin configure 已由 runtime 確認 需檢視 3 個旗標
claude plugin configure [options] <plugin>

Show a plugin's options and which are unset, or save values from stdin.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
--values-stdin

Set values stdin for this command.

已由 runtime 確認 一般
範例 claude plugin configure example --json

來源: Claude Code 2.1.307 recursive local help

claude plugin details 已由 runtime 確認 一般 1 個旗標
claude plugin details [options] <name>

Show a plugin component inventory and projected token cost.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude plugin details code-review

來源: Claude Code 2.1.307 recursive local help

claude plugin disable 已由 runtime 確認 需檢視 4 個旗標
claude plugin disable [options] [plugin]

Disable one or all enabled plugins at a scope.

-a, --all

Set all for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
範例 claude plugin disable code-review --scope project

來源: Claude Code 2.1.307 recursive local help

claude plugin enable 已由 runtime 確認 需檢視 3 個旗標
claude plugin enable [options] <plugin>

Enable a disabled plugin at a scope.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
範例 claude plugin enable code-review --scope project

來源: Claude Code 2.1.307 recursive local help

claude plugin eval 已由 runtime 確認 需檢視 25 個旗標
claude plugin eval [options] [command] [target]

Run scored evaluation cases against a plugin.

--ablation <mode>

Set ablation for this command.

已由 runtime 確認 一般
--allow-real-servers

Set allow real servers for this command.

已由 runtime 確認 一般
--allow-tools <tools>

Set allow tools for this command.

已由 runtime 確認 一般
--case <glob>

Set case for this command.

已由 runtime 確認 一般
-j, --concurrency <n>

Set concurrency for this command.

已由 runtime 確認 一般
--disallow-tools <tools>

Set disallow tools for this command.

已由 runtime 確認 一般
--eval-dir <dir>

Set eval dir for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--json <path>

Set json for this command.

已由 runtime 確認 一般
--judge-model <model>

Set judge model for this command.

已由 runtime 確認 一般
--keep-temp

Set keep temp for this command.

已由 runtime 確認 一般
--max-cost-usd <usd>

Set max cost usd for this command.

已由 runtime 確認 一般
--mocks <mode>

Set mocks for this command.

已由 runtime 確認 一般
--model <model>

Set model for this command.

已由 runtime 確認 一般
--no-publish

Set no publish for this command.

已由 runtime 確認 需檢視
--no-scaffold

Set no scaffold for this command.

已由 runtime 確認 需檢視
--output-dir <dir>

Set output dir for this command.

已由 runtime 確認 一般
--publish-report

Set publish report for this command.

已由 runtime 確認 需檢視
--report <path>

Set report for this command.

已由 runtime 確認 一般
--runs <n>

Set runs for this command.

已由 runtime 確認 一般
--scaffold

Set scaffold for this command.

已由 runtime 確認 需檢視
--tag <tag>

Set tag for this command.

已由 runtime 確認 一般
--threshold <0..1>

Set threshold for this command.

已由 runtime 確認 一般
--trust-plugin

Set trust plugin for this command.

已由 runtime 確認 一般
--verbose

Set verbose for this command.

已由 runtime 確認 一般
範例 claude plugin eval ./my-plugin --report report.html

來源: Claude Code 2.1.307 recursive local help

claude plugin eval init 已由 runtime 確認 需檢視 4 個旗標
claude plugin eval init [options] [name]

Author an eval suite interactively or create a bare case.

--bare

Set bare for this command.

已由 runtime 確認 一般
--eval-dir <dir>

Set eval dir for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
-i, --interactive

Set interactive for this command.

已由 runtime 確認 一般
範例 claude plugin eval init --bare regression

來源: Claude Code 2.1.307 recursive local help

claude plugin init 已由 runtime 確認 需檢視 6 個旗標
claude plugin init|new [options] <name>

Scaffold a skills-directory plugin.

別名: plugin new
--author <name>

Set author for this command.

已由 runtime 確認 一般
--author-email <email>

Set author email for this command.

已由 runtime 確認 一般
--description <text>

Set description for this command.

已由 runtime 確認 一般
-f, --force

Set force for this command.

已由 runtime 確認 需檢視
-h, --help

Display help for this command.

已由 runtime 確認 一般
--with <components>

Set with for this command.

已由 runtime 確認 一般
範例 claude plugin init my-plugin --with commands skills hooks

來源: Claude Code 2.1.307 recursive local help

claude plugin install 已由 runtime 確認 需檢視 8 個旗標
claude plugin install|i [options] <plugin>

Install a plugin from a configured marketplace.

別名: plugin i
--accept-command <sha256>

Set accept command for this command.

已由 runtime 確認 需檢視
--config <key=value>

Set config for this command.

已由 runtime 確認 需檢視
-h, --help

Display help for this command.

已由 runtime 確認 需檢視
--json

Set json for this command.

已由 runtime 確認 需檢視
--marketplace <source>

Set marketplace for this command.

已由 runtime 確認 需檢視
--registry <url>

Set registry for this command.

已由 runtime 確認 需檢視
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
-y, --yes

Set yes for this command.

已由 runtime 確認 需檢視
範例 claude plugin install code-review@claude-plugins-official

來源: Claude Code 2.1.307 recursive local help

claude plugin list 已由 runtime 確認 一般 4 個旗標
claude plugin list [options]

List installed or marketplace-available plugins.

--available

Set available for this command.

已由 runtime 確認 一般
--data-size <plugin>

Set data size for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
範例 claude plugin list --json

來源: Claude Code 2.1.307 recursive local help

claude plugin marketplace 已由 runtime 確認 一般 1 個旗標
claude plugin marketplace [options] [command]

Manage plugin marketplace sources.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude plugin marketplace list

來源: Claude Code 2.1.307 recursive local help

claude plugin marketplace add 已由 runtime 確認 需檢視 5 個旗標
claude plugin marketplace add [options] <source>

Register a plugin marketplace source.

--claudeai

Set claudeai for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
--scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
--sparse <paths>

Set sparse for this command.

已由 runtime 確認 一般
範例 claude plugin marketplace add anthropics/claude-plugins-official

來源: Claude Code 2.1.307 recursive local help

claude plugin marketplace list 已由 runtime 確認 一般 2 個旗標
claude plugin marketplace list [options]

List configured plugin marketplaces.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
範例 claude plugin marketplace list --json

來源: Claude Code 2.1.307 recursive local help

claude plugin marketplace remove 已由 runtime 確認 需檢視 3 個旗標
claude plugin marketplace remove|rm [options] <name>

Remove a configured plugin marketplace.

別名: plugin marketplace rm
-h, --help

Display help for this command.

已由 runtime 確認 需檢視
--json

Set json for this command.

已由 runtime 確認 需檢視
--scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
範例 claude plugin marketplace remove example

來源: Claude Code 2.1.307 recursive local help

claude plugin marketplace update 已由 runtime 確認 需檢視 2 個旗標
claude plugin marketplace update [options] [name]

Refresh one or all configured plugin marketplaces.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
範例 claude plugin marketplace update

來源: Claude Code 2.1.307 recursive local help

claude plugin prune 已由 runtime 確認 需檢視 4 個旗標
claude plugin prune|autoremove [options]

Remove auto-installed plugin dependencies no longer needed.

別名: plugin autoremove
--dry-run

Set dry run for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
-y, --yes

Set yes for this command.

已由 runtime 確認 需檢視
範例 claude plugin prune --dry-run

來源: Claude Code 2.1.307 recursive local help

claude plugin tag 已由 runtime 確認 需檢視 6 個旗標
claude plugin tag [options] [path]

Validate a plugin version and create an annotated release tag.

--dry-run

Set dry run for this command.

已由 runtime 確認 一般
-f, --force

Set force for this command.

已由 runtime 確認 需檢視
-h, --help

Display help for this command.

已由 runtime 確認 一般
-m, --message <msg>

Set message for this command.

已由 runtime 確認 一般
--push

Set push for this command.

已由 runtime 確認 需檢視
--remote <name>

Set remote for this command.

已由 runtime 確認 一般
範例 claude plugin tag --dry-run

來源: Claude Code 2.1.307 recursive local help

claude plugin test 已由 runtime 確認 需檢視 1 個旗標
claude plugin test [dir]

Run a mod's *.test.ts and *.test.tsx files in the mod hook environment.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude plugin test ./my-mod

來源: Claude Code 2.1.307 recursive local help

claude plugin uninstall 已由 runtime 確認 需檢視 6 個旗標
claude plugin uninstall|remove [options] <plugin>

Uninstall a plugin and optionally prune dependencies.

別名: plugin remove
-h, --help

Display help for this command.

已由 runtime 確認 需檢視
--json

Set json for this command.

已由 runtime 確認 需檢視
--keep-data

Set keep data for this command.

已由 runtime 確認 需檢視
--prune

Set prune for this command.

已由 runtime 確認 需檢視
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
-y, --yes

Set yes for this command.

已由 runtime 確認 需檢視
範例 claude plugin uninstall example --scope user

來源: Claude Code 2.1.307 recursive local help

claude plugin update 已由 runtime 確認 需檢視 5 個旗標
claude plugin update [options] <plugin>

Update an installed plugin.

--accept-command <sha256>

Set accept command for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
-s, --scope <scope>

Set scope for this command.

已由 runtime 確認 需檢視
-y, --yes

Set yes for this command.

已由 runtime 確認 需檢視
範例 claude plugin update example

來源: Claude Code 2.1.307 recursive local help

claude plugin validate 已由 runtime 確認 一般 4 個旗標
claude plugin validate [options] <path>

Validate plugin structure and metadata.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
--profile <name>

Set profile for this command.

已由 runtime 確認 一般
--strict

Set strict for this command.

已由 runtime 確認 一般
範例 claude plugin validate ./my-plugin --strict

來源: Claude Code 2.1.307 recursive local help

claude purge 已由 runtime 確認 高風險 5 個旗標
claude purge [options] [path]

Delete Claude Code state for one project or, with --all, every project.

--all

Set all for this command.

已由 runtime 確認 高風險
--dry-run

Set dry run for this command.

已由 runtime 確認 高風險
-h, --help

Display help for this command.

已由 runtime 確認 高風險
-i, --interactive

Set interactive for this command.

已由 runtime 確認 高風險
-y, --yes

Set yes for this command.

已由 runtime 確認 高風險
範例 claude purge ~/work/repo --dry-run

來源: Claude Code 2.1.307 recursive local help

claude setup-token 已由 runtime 確認 需檢視 1 個旗標
claude setup-token [options]

Generate a long-lived OAuth token for CI and scripts.

-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude setup-token

來源: Claude Code 2.1.307 recursive local help

claude ultrareview 已由 runtime 確認 需檢視 5 個旗標
claude ultrareview [options] [target]

Run a cloud-hosted multi-agent code review and print the findings.

-h, --help

Display help for this command.

已由 runtime 確認 一般
--json

Set json for this command.

已由 runtime 確認 一般
--no-post

Set no post for this command.

已由 runtime 確認 一般
--post

Set post for this command.

已由 runtime 確認 一般
--timeout <minutes>

Set timeout for this command.

已由 runtime 確認 一般
範例 claude ultrareview 1234 --json

來源: Claude Code 2.1.307 recursive local help

claude update 已由 runtime 確認 需檢視 1 個旗標
claude update|upgrade [options]

Check for and install Claude Code updates.

別名: upgrade
-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude update

來源: Claude Code 2.1.307 recursive local help

claude attach 已由 runtime 確認 需檢視 0 個旗標
claude attach <id|name>

Open a background session in this terminal by short id or part of its name.

沒有此命令專屬的旗標。

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude daemon 已由 runtime 確認 一般 3 個旗標
claude daemon [subcommand] [options]

Inspect and manage the on-demand background-session supervisor.

--json-path <path>

Set json path for this command.

已由 runtime 確認 一般
--log-file <path>

Set log file for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude daemon run 已由 runtime 確認 需檢視 3 個旗標
claude daemon run [json-path]

Run the background-session supervisor in the foreground.

--json-path <path>

Set json path for this command.

已由 runtime 確認 一般
--log-file <path>

Set log file for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude daemon status 已由 runtime 確認 一般 1 個旗標
claude daemon status

Show supervisor process, version, uptime, and workers.

-h, --help

Display help for this command.

已由 runtime 確認 一般

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude daemon logs 已由 runtime 確認 一般 1 個旗標
claude daemon logs

Tail the supervisor log until interrupted.

-h, --help

Display help for this command.

已由 runtime 確認 一般

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude daemon uninstall 已由 runtime 確認 需檢視 1 個旗標
claude daemon uninstall

Remove a previously installed background service where supported.

-h, --help

Display help for this command.

已由 runtime 確認 需檢視

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude daemon stop 已由 runtime 確認 需檢視 3 個旗標
claude daemon stop [options]

Stop the supervisor and its background sessions.

--any

Set any for this command.

已由 runtime 確認 一般
--keep-workers

Set keep workers for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude logs 已由 runtime 確認 一般 0 個旗標
claude logs <id|name>

Print recent terminal output for a background session by id or name.

沒有此命令專屬的旗標。

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude respawn 已由 runtime 確認 需檢視 1 個旗標
claude respawn <id>|--all

Restart a background session with its conversation intact.

--all

Set all for this command.

已由 runtime 確認 一般

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude rm 已由 runtime 確認 需檢視 2 個旗標
claude rm <id> [--discard-unpushed <commit>@<worktree-id>] [--force-remove-worktree <worktree-id>]

Delete a background session, and its worktree when that is safe, while retaining its transcript.

--discard-unpushed, -id <commit>

Set discard unpushed for this command.

已由 runtime 確認 需檢視
--force-remove-worktree, -id <worktree-id>

Set force remove worktree for this command.

已由 runtime 確認 需檢視

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude stop 已由 runtime 確認 需檢視 0 個旗標
claude stop <id>

Stop a background session while retaining its conversation.

別名: kill

沒有此命令專屬的旗標。

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude remote-control 已由 runtime 確認 需檢視 15 個旗標
claude remote-control [options]

Run a Remote Control server for claude.ai/code and the Claude mobile app without a local interactive session.

--name <name>

Set name for this command.

已由 runtime 確認 一般
--remote-control-session-name-prefix <prefix>

Set remote control session name prefix for this command.

已由 runtime 確認 一般
-c, --continue

Set continue for this command.

已由 runtime 確認 一般
--session-id <id>

Set session id for this command.

已由 runtime 確認 一般
--permission-mode <mode>

Set permission mode for this command.

已由 runtime 確認 一般
--chrome

Set chrome for this command.

已由 runtime 確認 一般
--no-chrome

Set no chrome for this command.

已由 runtime 確認 一般
-d, --debug <filter>

Set debug for this command.

已由 runtime 確認 一般
--debug-file <path>

Set debug file for this command.

已由 runtime 確認 一般
-v, --verbose

Set verbose for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
--spawn <mode>

Set spawn for this command.

已由 runtime 確認 一般
--capacity <N>

Set capacity for this command.

已由 runtime 確認 一般
--create-session-in-dir

Set create session in dir for this command.

已由 runtime 確認 一般
--no-create-session-in-dir

Set no create session in dir for this command.

已由 runtime 確認 一般
範例 claude remote-control --name "My Project" --spawn worktree

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

claude self-hosted-runner 已由 runtime 確認 需檢視 36 個旗標
claude self-hosted-runner [options]

Run a self-hosted environment runner that executes cloud sessions on your own infrastructure.

--api-url <url>

Set api url for this command.

已由 runtime 確認 一般
--environment-secret-file <path>

Set environment secret file for this command.

已由 runtime 確認 需檢視
--lock-to-account <id>

Set lock to account for this command.

已由 runtime 確認 一般
--client-label <label>

Set client label for this command.

已由 runtime 確認 一般
--proxy-authorization-command <shell command>

Set proxy authorization command for this command.

已由 runtime 確認 一般
--proxy-authorization-file <path>

Set proxy authorization file for this command.

已由 runtime 確認 一般
--capacity <n>

Set capacity for this command.

已由 runtime 確認 一般
--base-dir <path>

Set base dir for this command.

已由 runtime 確認 一般
--exec-path <path>

Set exec path for this command.

已由 runtime 確認 一般
--hooks-dir <path>

Set hooks dir for this command.

已由 runtime 確認 一般
--session-stop-grace-sec <n>

Set session stop grace sec for this command.

已由 runtime 確認 一般
--post-session-hook-timeout-sec <n>

Set post session hook timeout sec for this command.

已由 runtime 確認 一般
--drain-wait-sec <n>

Set drain wait sec for this command.

已由 runtime 確認 一般
--drain-marker-file <path>

Set drain marker file for this command.

已由 runtime 確認 一般
--git-ssh-rewrite <host>

Set git ssh rewrite for this command.

已由 runtime 確認 一般
--git-host-rewrite <from=to>

Set git host rewrite for this command.

已由 runtime 確認 一般
--use-anthropic-git-proxy

Set use anthropic git proxy for this command.

已由 runtime 確認 一般
--configure-git

Set configure git for this command.

已由 runtime 確認 一般
--push-outcome-on-release

Set push outcome on release for this command.

已由 runtime 確認 需檢視
--trust-workspace <bool>

Set trust workspace for this command.

已由 runtime 確認 一般
--remove-session-state <bool>

Set remove session state for this command.

已由 runtime 確認 需檢視
--confine-repo-settings <mode>

Set confine repo settings for this command.

已由 runtime 確認 一般
--server-auto-mode-lists <mode>

Set server auto mode lists for this command.

已由 runtime 確認 一般
--host-config-snapshot <disk|memory>

Set host config snapshot for this command.

已由 runtime 確認 一般
--health-port <port>

Set health port for this command.

已由 runtime 確認 一般
--log-level <level>

Set log level for this command.

已由 runtime 確認 一般
--log-file <path>

Set log file for this command.

已由 runtime 確認 一般
--exit-if-unused-min <n>

Set exit if unused min for this command.

已由 runtime 確認 一般
--drain-grace-sec <n>

Set drain grace sec for this command.

已由 runtime 確認 一般
--retire-at, -seconds <epoch-seconds>

Set retire at for this command.

已由 runtime 確認 一般
--defer-shutdown-max-min <m>

Set defer shutdown max min for this command.

已由 runtime 確認 一般
--release-idle-session-min <n>

Set release idle session min for this command.

已由 runtime 確認 一般
--startup-timeout-min <n>

Set startup timeout min for this command.

已由 runtime 確認 一般
--kill-session-after-min <n>

Set kill session after min for this command.

已由 runtime 確認 一般
--debug-token-dir <path>

Set debug token dir for this command.

已由 runtime 確認 一般
-h, --help

Display help for this command.

已由 runtime 確認 一般
範例 claude self-hosted-runner --environment-secret-file ./runner.secret --capacity 2

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

02

互動命令

在 Claude Code session 開頭輸入的命令;平台、方案與環境限制會明確標示。

/add-dir 官方文件

Add a working directory for file access during the current session.

來源: Official Claude Code commands reference
/advisor 條件式

Enable or disable the advisor tool, which consults a second model for guidance at key moments during a task.

來源: Official Claude Code commands reference
/agents 官方文件

Print a reminder to ask Claude to create or manage subagents, or to edit `.claude/agents/` or `~/.claude/agents/` directly.

來源: Official Claude Code commands reference
/artifact-capabilities 條件式

Load the reference for the runtime capabilities a published artifact can use, such as calling your connectors or offering a file download, including which ones your account has.

來源: Official Claude Code commands reference
/artifact-diagramming 條件式

Load diagramming guidance for Claude to follow in artifacts: when a diagram helps, what to draw, and how to write inline SVG that stays legible in light and dark themes.

來源: Official Claude Code commands reference
/artifacts 條件式

List the artifacts you own or that are shared with you, then attach one to the session, open it in your browser, or copy its link.

來源: Official Claude Code commands reference
/auto-mode-setup 條件式

Draft `autoMode.environment` entries from your project and recent sessions, then review the draft and save it to your user settings.

來源: Official Claude Code commands reference
/autocompact 官方文件

Set the auto-compact window: how full the context window gets before Claude Code compacts automatically.

來源: Official Claude Code commands reference
/autofix-pr 條件式

Spawn a cloud session that watches the current branch's PR and pushes fixes when CI fails or reviewers leave comments.

來源: Official Claude Code commands reference
/background 條件式

Detach the current session to run as a background agent and free this terminal.

別名: /bg 來源: Official Claude Code commands reference
/batch 官方文件

Orchestrate large-scale changes across a codebase in parallel.

來源: Official Claude Code commands reference
/branch 官方文件

Create a branch of the current conversation at this point, so you can try a different direction without losing the conversation as it stands.

來源: Official Claude Code commands reference
/btw 官方文件

Ask a side question about the current session without adding to the conversation.

來源: Official Claude Code commands reference
/bug 官方文件

Report a bug or share your conversation.

別名: /share 來源: Official Claude Code commands reference
/cd 官方文件

Move this session to a new working directory, keeping the conversation.

來源: Official Claude Code commands reference
/chrome 條件式

Configure Claude in Chrome settings

來源: Official Claude Code commands reference
/claude-api 條件式

Load Claude API and Managed Agents reference material for your project's language.

來源: Official Claude Code commands reference
/claude-in-chrome 條件式

Have Claude carry out a task in your browser, such as testing a page, filling a form, or reading console logs, through Claude in Chrome.

來源: Official Claude Code commands reference
/clear 官方文件

Start a new conversation with empty context.

別名: /reset, /new 來源: Official Claude Code commands reference
/code-review 官方文件

Review the current diff, or a PR number, branch, or path you pass, for correctness bugs.

別名: /review 來源: Official Claude Code commands reference
/color 官方文件

Set the prompt bar color for the current session.

來源: Official Claude Code commands reference
/compact 官方文件

Free up context by summarizing the conversation so far.

來源: Official Claude Code commands reference
/config 官方文件

Open the Settings interface to adjust theme, model, output style, and other preferences.

別名: /settings 來源: Official Claude Code commands reference
/context 官方文件

Visualize current context usage as a colored grid.

來源: Official Claude Code commands reference
/copy 官方文件

Copy the last assistant response to clipboard.

來源: Official Claude Code commands reference
/cost 官方文件

Alias for `/usage`

來源: Official Claude Code commands reference
/dataviz 條件式

Design guidance for charts, graphs, and dashboards.

來源: Official Claude Code commands reference
/debug 官方文件

Enable debug logging for the current session and troubleshoot issues by reading the session debug log.

來源: Official Claude Code commands reference
/deep-research 條件式

Fan out web searches on a question, fetch and cross-check sources, and synthesize a cited report

來源: Official Claude Code commands reference
/design 條件式

Draft UI mockups, screen flows, landing pages, or posters as artboards on one canvas, published as a Claude Design artifact, for example `/design a settings screen for a mobile banking app`.

來源: Official Claude Code commands reference
/design-login 條件式

Authorize design-system access for `/design-sync` with your claude.ai account.

來源: Official Claude Code commands reference
/design-sync 條件式

Convert your repo's React design system and upload it to Claude Design, so designs it produces use your real components.

來源: Official Claude Code commands reference
/desktop 條件式

Continue the current session in the Claude Code Desktop app.

別名: /app 來源: Official Claude Code commands reference
/diff 官方文件

Review the changes in your working tree, including the edits Claude has made so far.

來源: Official Claude Code commands reference
/doctor 官方文件

Run a setup checkup that diagnoses installation, settings, extension, and `CLAUDE.md` problems and proposes fixes that Claude applies after you confirm.

別名: /checkup 來源: Official Claude Code commands reference
/effort 官方文件

Set the effort level: `low` to `xhigh`, `max`, or `auto`; `status` prints it.

來源: Official Claude Code commands reference
/exit 官方文件

Exit the CLI.

別名: /quit 來源: Official Claude Code commands reference
/export 官方文件

Export the current conversation as plain text.

來源: Official Claude Code commands reference
/fast 條件式

Toggle fast mode on or off.

來源: Official Claude Code commands reference
/feedback 官方文件

Send product feedback about Claude Code.

來源: Official Claude Code commands reference
/fewer-permission-prompts 官方文件

Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project `.claude/settings.json` to reduce permission prompts

來源: Official Claude Code commands reference
/focus 條件式

Toggle the focus view, which shows only your last prompt, a one-line tool-call summary with edit diffstats, and the final response.

來源: Official Claude Code commands reference
/fork 官方文件

Copy the current conversation into a new background session and keep working here.

來源: Official Claude Code commands reference
/goal 官方文件

Set a goal: Claude keeps working across turns until the condition is met or the goal clears for another reason.

來源: Official Claude Code commands reference
/heapdump 官方文件

Write a JavaScript heap snapshot and a memory breakdown to `~/Desktop`, or your home directory on Linux without a Desktop folder, for diagnosing high memory usage.

來源: Official Claude Code commands reference
/help 官方文件

Show help and available commands

來源: Official Claude Code commands reference
/hooks 官方文件

View hook configurations

來源: Official Claude Code commands reference
/ide 官方文件

Manage IDE integrations and show status

來源: Official Claude Code commands reference
/import 官方文件

Bring configuration from OpenAI Codex, Google Gemini CLI, or Cursor on your machine into Claude Code, including instruction files, MCP servers, commands, subagents, and skills.

來源: Official Claude Code commands reference
/init 官方文件

Initialize project with a `CLAUDE.md` guide.

來源: Official Claude Code commands reference
/insights 官方文件

Generate an HTML report analyzing your recent sessions on this machine: which projects you work in, how you use Claude Code, where things go wrong, and features to try.

來源: Official Claude Code commands reference
/install-github-app 條件式

Install the Claude GitHub App for a repository, with an optional step to set up GitHub Actions workflows and secrets.

來源: Official Claude Code commands reference
/install-slack-app 條件式

Install the Claude Slack app.

來源: Official Claude Code commands reference
/keybindings 官方文件

Open your keyboard shortcuts file

來源: Official Claude Code commands reference
/list-agents 官方文件

List the subagents, agent team teammates, and other Claude Code sessions Claude can message, with the name to use for each.

來源: Official Claude Code commands reference
/login 官方文件

Sign in to your Anthropic account

來源: Official Claude Code commands reference
/logout 官方文件

Sign out from your Anthropic account

來源: Official Claude Code commands reference
/loop 官方文件

Run a prompt repeatedly while the session stays open.

別名: /proactive 來源: Official Claude Code commands reference
/mcp 官方文件

Manage MCP server connections and OAuth authentication.

來源: Official Claude Code commands reference
/memory 官方文件

Edit `CLAUDE.md` files, enable or disable auto memory, and view auto memory entries

來源: Official Claude Code commands reference
/mobile 條件式

Show QR code to download the Claude mobile app.

別名: /ios, /android 來源: Official Claude Code commands reference
/model 官方文件

Switch the AI model and save it as your default for new sessions.

來源: Official Claude Code commands reference
/output-style 官方文件

List output styles or switch to one, for example `/output-style concise`.

來源: Official Claude Code commands reference
/passes 官方文件

Share a free week of Claude Code with friends.

來源: Official Claude Code commands reference
/permissions 官方文件

Manage allow, ask, and deny rules for tool permissions.

別名: /allowed-tools 來源: Official Claude Code commands reference
/plan 官方文件

Enter plan mode directly from the prompt.

來源: Official Claude Code commands reference
/plugin 官方文件

Manage Claude Code plugins.

來源: Official Claude Code commands reference
/plugin-authoring 官方文件

Load the reference Claude works from to write a mod.

來源: Official Claude Code commands reference
/powerup 官方文件

Discover Claude Code features through quick interactive lessons with animated demos

來源: Official Claude Code commands reference
/pr-comments 歷史項目

Removed in v2.1.91.

來源: Official Claude Code commands reference
/privacy-settings 條件式

View and update your privacy settings.

來源: Official Claude Code commands reference
/radio 條件式

Open Claude FM lo-fi radio in your browser.

來源: Official Claude Code commands reference
/rate-limit-options 條件式

Show ways to keep working when a claude.ai usage limit blocks a request: wait and continue automatically when the limit resets, add usage credits, or upgrade your plan.

來源: Official Claude Code commands reference
/recap 官方文件

Generate a one-line summary of the current session on demand.

來源: Official Claude Code commands reference
/release-notes 官方文件

View the changelog in an interactive version picker.

來源: Official Claude Code commands reference
/reload-plugins 官方文件

Reload all active plugins to apply pending changes without restarting.

來源: Official Claude Code commands reference
/reload-skills 官方文件

Re-scan skill and command directories so skills added or changed on disk during the session become available without restarting.

來源: Official Claude Code commands reference
/remote-control 條件式

Make this session available for Remote Control from claude.ai.

別名: /rc 來源: Official Claude Code commands reference
/remote-env 條件式

Choose the default cloud environment for cloud sessions you start from the CLI

來源: Official Claude Code commands reference
/rename 官方文件

Rename the current session and show the name on the prompt bar.

來源: Official Claude Code commands reference
/resume 官方文件

Resume a conversation by ID or name, or open the session picker.

別名: /continue 來源: Official Claude Code commands reference
/review 官方文件

Alias of `/code-review`: reviews the current diff, or a PR number, branch, or path you pass, such as `/review 1234`, and takes the same effort levels and flags.

來源: Official Claude Code commands reference
/rewind 官方文件

Rewind the conversation and/or code to a previous point, or summarize from a selected message.

別名: /checkpoint, /undo 來源: Official Claude Code commands reference
/run 官方文件

Launch and drive your project's app to see a change working, not only passing tests.

來源: Official Claude Code commands reference
/run-skill-generator 官方文件

Teach `/run` and `/verify` how to build, launch, and drive your project's app from a clean environment by writing a per-project skill

來源: Official Claude Code commands reference
/sandbox 官方文件

Toggle sandbox mode.

來源: Official Claude Code commands reference
/schedule 官方文件

Create, update, list, or run cloud scheduled tasks, formerly routines.

別名: /routines 來源: Official Claude Code commands reference
/scroll-speed 官方文件

Adjust mouse wheel scroll speed interactively.

來源: Official Claude Code commands reference
/security-review 官方文件

Analyze the changes on your current branch for security vulnerabilities.

來源: Official Claude Code commands reference
/setup-bedrock 條件式

Configure Amazon Bedrock authentication, region, and model pins through an interactive wizard.

來源: Official Claude Code commands reference
/setup-vertex 條件式

Configure Google Cloud's Agent Platform authentication, project, region, and model pins through an interactive wizard.

來源: Official Claude Code commands reference
/simplify 官方文件

Review the changed code for cleanup opportunities and apply the fixes.

來源: Official Claude Code commands reference
/skill-doctor 條件式

Show what each of your skills costs in context and how often it gets used, so you can find skills to turn off.

來源: Official Claude Code commands reference
/skills 官方文件

List available skills.

來源: Official Claude Code commands reference
/slides 條件式

Make a new presentation as a Claude Slides artifact filled from your brief, for example `/slides a quarterly review of the platform team`.

來源: Official Claude Code commands reference
/stats 官方文件

Alias for `/usage`.

來源: Official Claude Code commands reference
/status 官方文件

Open the Settings interface on the Status tab, showing version, model, account, and connectivity.

來源: Official Claude Code commands reference
/statusline 官方文件

Configure Claude Code's status line.

來源: Official Claude Code commands reference
/stickers 條件式

Order Claude Code stickers

來源: Official Claude Code commands reference
/stop 條件式

Stop the background session you're attached to, or the one you send it to as a peek reply; the transcript and any worktree are kept.

來源: Official Claude Code commands reference
/subtask 官方文件

Spawn a forked subagent: a background subagent that inherits the full conversation and works on the task while you keep working.

來源: Official Claude Code commands reference
/tasks 官方文件

View and manage background work in the current session, including subagents that have finished.

來源: Official Claude Code commands reference
/team-onboarding 條件式

Generate a team onboarding guide from your Claude Code usage history.

來源: Official Claude Code commands reference
/teleport 條件式

Pull a cloud session into this terminal.

別名: /tp 來源: Official Claude Code commands reference
/terminal-setup 條件式

Install a Shift+Enter keybinding for newlines in VS Code, Cursor, Devin Desktop, Alacritty, or Zed.

來源: Official Claude Code commands reference
/theme 官方文件

Change the color theme.

來源: Official Claude Code commands reference
/tui 官方文件

Set the terminal UI renderer and relaunch into it with your conversation intact.

來源: Official Claude Code commands reference
/ultraplan 條件式

Removed.

來源: Official Claude Code commands reference
/ultrareview 條件式

Run a deep, multi-agent code review in a cloud sandbox with ultrareview.

來源: Official Claude Code commands reference
/update-config 官方文件

Describe a settings change, such as allowing a command, setting an environment variable, or adding a hook, and Claude edits the matching `settings.json` file.

來源: Official Claude Code commands reference
/upgrade 條件式

Open the upgrade page in your browser to switch to a higher plan tier.

來源: Official Claude Code commands reference
/usage 官方文件

Show session cost, plan usage limits, and activity stats.

來源: Official Claude Code commands reference
/usage-credits 條件式

Configure usage credits, or request them from your admin, when you hit a limit.

來源: Official Claude Code commands reference
/verify 官方文件

Confirm a code change does what it should by building your project's app, running it, and observing the result, rather than relying on tests or type checks.

來源: Official Claude Code commands reference
/vim 歷史項目

Removed in v2.1.92.

來源: Official Claude Code commands reference
/voice 條件式

Toggle voice dictation, or enable it in a specific mode.

來源: Official Claude Code commands reference
/web-setup 條件式

Connect your GitHub account for cloud sessions using your local `gh` CLI credentials

來源: Official Claude Code commands reference
/workflow-authoring 條件式

Load the reference for writing dynamic workflow scripts: the script API, resume behavior, quality patterns, and worked examples.

來源: Official Claude Code commands reference
/workflows 官方文件

Open the workflow progress view to watch, pause, resume, or save running and completed workflows

來源: Official Claude Code commands reference
/plugin-dev:create-plugin 原始碼預覽

Run the public plugin-dev asset workflow for creating a Claude Code plugin.

來源: Public Claude Code v2.1.307 plugin assets
03

設定鍵

官方設定表與公開 JSON Schema top-level keys 的聯集。

$schema url

Enable editor validation against the published Claude Code settings schema.

官方文件
advisorModel string

Pick which model answers when Claude asks the advisor tool

官方文件
agent string

Start every session as a named subagent with its prompt, tools, and model

官方文件
agentPushNotifEnabled boolean

Let Claude send a push notification to your phone when it decides to

官方文件
allowAllClaudeAiMcps boolean

Load the claude.ai connectors Claude Code fetches itself alongside a deployed `managed-mcp.json`

官方文件
allowClaudeInChromeWithManagedMcp boolean

Let the built-in Claude in Chrome server run alongside a deployed `managed-mcp.json`

官方文件
allowedChannelPlugins array

Replace the default allowlist of channel plugins that can push messages

官方文件
allowedHttpHookUrls array

Limit which URLs HTTP hooks can target

官方文件
allowedMcpServers array

Allowlist which MCP servers users can add

官方文件
allowedProviders array

Limit which API providers a machine may use

官方文件
allowManagedHooksOnly boolean

Run only the hooks your organization deploys

官方文件
allowManagedMcpServersOnly boolean

Make the managed MCP allowlist the only one that applies

官方文件
allowManagedPermissionRulesOnly boolean

Make managed settings the only settings source of permission rules

官方文件
alwaysThinkingEnabled boolean

Turn extended thinking off for every session

官方文件
apiKeyHelper string

Generate the API credential with your own command

官方文件 敏感
appendPlugins array

Run your organization's mods after every mod a user installs

官方文件
askUserQuestionTimeout string

Let an unanswered question auto-continue after idle time

官方文件
attribution object

Customize the attribution Claude Code adds to commits and pull requests

官方文件
attribution.commit string

Change or hide the trailer Claude Code adds to commits

官方文件
attribution.pr string

Change or hide the attribution line in pull request descriptions

官方文件
attribution.sessionUrl boolean

Omit the claude.ai session link from cloud and Remote Control commits

官方文件
autoCompactEnabled boolean

Turn automatic compaction off or on

官方文件
autoCompactWindow integer

Set the token threshold from 100000 to 1000000 for automatic context compaction.

官方文件
autoConnectIde boolean

Connect to a running VS Code or JetBrains IDE automatically from an external terminal

官方文件
autoContinueAtUsageLimit boolean

Wait in the open session and continue the task automatically after a claude.ai usage limit resets

官方文件
autoInstallIdeExtension boolean

Turn off automatic install of the IDE extension from a VS Code terminal

官方文件
autoMemoryDirectory string

Store auto memory in a directory you choose

官方文件
autoMemoryEnabled boolean

Turn auto memory off or on

官方文件
autoMode object

Customize automatic permission-mode classification rules.

官方文件
autoMode.classifyAllShell boolean

Send every shell command through the auto mode classifier, even ones a narrow allow rule matches

官方文件
autoScrollEnabled boolean

Follow new output to the bottom in fullscreen rendering

官方文件
autoUpdatesChannel string

Follow the stable release channel instead of latest

官方文件
availableModels array

Restrict which models people can pick

官方文件
availableModelsMatch enum

Make each `availableModels` model ID entry permit only the version it names

官方文件
awaySummaryEnabled boolean

Turn off the session recap shown when you come back to the terminal

官方文件
awsAuthRefresh string

Refresh expired Bedrock credentials in `.aws` with your own command

官方文件 敏感
awsCredentialExport string

Supply Bedrock credentials as JSON from your own command

官方文件 敏感
axScreenReader boolean

Render screen-reader friendly output

官方文件
bashEditDiffEnabled boolean

Record the files that changed while a Bash command ran in every permission mode

官方文件
bashOutputMaxChars number

Set how much of a successful command's output Claude receives inline

官方文件
blockedMarketplaces array

Block plugin marketplace sources for your organization

官方文件
browserExternalPageTools string

Keep Claude's tools off external pages in the desktop Browser pane

官方文件
channelsEnabled boolean

Allow channels for your organization

官方文件
claudeInChromeDefaultEnabled boolean

Turn on Chrome integration when a session starts, in the interactive CLI and the VS Code extension

官方文件
claudeMd string

Inject organization-wide CLAUDE.md instructions from managed settings

官方文件
claudeMdExcludes array

Skip specific CLAUDE.md files when memory loads

官方文件
cleanupPeriodDays integer

Choose how many days Claude Code keeps transcripts before deleting them

官方文件
companyAnnouncements array

Show your organization's announcements at startup

官方文件
copyFullResponse boolean

Make `/copy` copy the full response without showing the picker

官方文件
copyOnSelect boolean

Turn off automatic copying of text you select with the mouse in fullscreen rendering and agent view

官方文件
crossSessionInbound enum

Choose whether inbound cross-session messages are accepted, held for approval, or refused.

官方文件
defaultShell string

Choose whether Bash or PowerShell runs the shell commands you type with the `!` prefix

官方文件
defaultToAgentsView boolean

Open agent view instead of a new conversation when you run `claude` with no arguments

官方文件
deniedMcpServers array

Block specific MCP servers by URL, command, or name

官方文件
deniedModels array

Block specific models, even ones `availableModels` permits

官方文件
desktopSessionCleanupPeriodDays number

Set an age limit in days for Claude Desktop and Cowork transcripts

官方文件
dialogExpiry enum

Set the expiry for dialogs forwarded to Remote Control or SDK hosts.

官方文件
diffTool string

Choose whether Claude's proposed file changes open in the VS Code or JetBrains diff viewer or stay in the terminal

官方文件
disableAgentView boolean

Turn off background agents and agent view

官方文件
disableAllHooks boolean

Turn off hooks, a custom status line, and a custom `@` file suggestion command at once

官方文件
disableArtifact boolean

Deprecated; use `enableArtifact` to turn the Artifact tool off

官方文件
disableAutoMode string

Remove auto mode from the permission mode cycle

官方文件
disableBrowserExternalNavigation boolean

Limit the desktop Browser pane to localhost for people and Claude

官方文件
disableBundledSkills boolean

Turn off the skills and workflows included with Claude Code

官方文件
disableClaudeAiConnectors boolean

Turn off claude.ai connectors so Claude Code doesn't fetch them

官方文件
disableCommandPluginSources boolean

Block plugins that install by running a marketplace-declared command

官方文件
disableDeepLinkRegistration string

Stop Claude Code from registering the `claude-cli://` handler

官方文件
disableDesktopLocalSessions boolean

Turn off Desktop Code sessions that run on the device, leaving SSH to other hosts and cloud

官方文件
disabledMcpjsonServers array

Reject specific servers from a project's `.mcp.json`

官方文件
disableMobileSimulatorTools boolean

Block Claude's tools in the desktop iOS Simulator pane

官方文件
disableRemoteControl boolean

Turn off Remote Control everywhere it can start

官方文件
disableSideloadFlags boolean

Reject the CLI flags that sideload plugins, subagents, and MCP servers

官方文件
disableSkillShellExecution boolean

Stop skills and custom commands from running inline shell

官方文件
disableWorkflows boolean

Turn dynamic workflows off for everyone; use `enableWorkflows` for yourself

官方文件
editorMode string

Use vim key bindings in the input prompt

官方文件
effortLevel string

Set the default reasoning effort level.

官方文件
emojiCompletionEnabled boolean

Turn off `:shortcode:` emoji suggestions and replacement in the prompt input

官方文件
enableAllProjectMcpServers boolean

Approve every server in project `.mcp.json` files without a prompt

官方文件
enableArtifact boolean

Turn the Artifact tool off with a `false` in any file; no file can turn it back on

官方文件
enabledMcpjsonServers array

Approve specific servers from a project's `.mcp.json`

官方文件
enabledPlugins object

Enable or disable plugins by their plugin@marketplace identifier.

官方文件
enableWorkflows boolean

Turn dynamic workflows on or off against your plan's default

官方文件
enforceAvailableModels boolean

Keep the `/model` Default choice inside your `availableModels` allowlist

官方文件
env object

Set environment variables for every Claude Code session; values can contain secrets.

官方文件 敏感
externalEditorContext boolean

Show Claude's last response as comments when you press Ctrl+G to edit

官方文件
extraKnownMarketplaces object

Declare additional plugin marketplaces in team settings.

官方文件
fallbackModel array

Name backup models for when the primary is overloaded

官方文件
fastMode boolean

Turn fast mode on for sessions where it's available

官方文件
fastModePerSessionOptIn boolean

Require people to turn fast mode on each session

官方文件
feedbackDrafts enum

Control whether Claude queues feedback drafts for you to review

官方文件
feedbackSurveyRate number

Change how often the session quality survey appears

官方文件
fileCheckpointingEnabled boolean

Turn off or on the file snapshots that `/rewind` restores

官方文件
fileSuggestion object

Supply `@` file autocomplete from your own command

官方文件
footerLinksRegexes array

Make issue or review IDs in output into clickable links below the input box

官方文件
forceLoginGatewayUrl string

Set the gateway URL the login screen connects to

官方文件
forceLoginMethod string

Restrict login to claude.ai, Claude Console, or a cloud gateway

官方文件
forceLoginOrgUUID object

Pin claude.ai logins to your organization; only a managed source enforces it

官方文件
forceRemoteSettingsRefresh boolean

Block startup until server-managed settings are freshly fetched

官方文件
gatewayInternalNetworks array

Let `/login` reach a cloud gateway on public IPv4 space your organization uses internally

官方文件
gcpAuthRefresh string

Refresh Google Cloud credentials with your own command

官方文件 敏感
hooks object

Register shell, prompt, agent, or HTTP handlers for Claude Code lifecycle events.

官方文件
httpHookAllowedEnvVars array

Limit which env vars HTTP hooks can put in headers

官方文件 敏感
idleCompaction boolean

Stop Claude Code from compacting a long conversation while your terminal session is idle

官方文件
includeCoAuthoredBy boolean

Deprecated; use `attribution` to hide or change commit and PR attribution

官方文件 敏感
includeGitInstructions boolean

Remove the built-in commit and PR instructions from Claude's context

官方文件
inputNeededNotifEnabled boolean

Get a push notification when Claude is waiting on you

官方文件
isolatePeerMachines boolean

Require approval before a reply reaches a Claude Code session on another machine.

官方文件
keybindingFlavor string

Deprecated and has no effect; the word-editing shortcuts always follow readline conventions

官方文件
language string

Have Claude respond in a language other than English

官方文件
leftArrowOpensAgents boolean

Turn off the `←` shortcut that backgrounds the session and opens agent view

官方文件
managedMcpServers array

Provide remote MCP servers to every user alongside the ones they add

官方文件
managedSourcesBehavior enum

Compose every managed source you deploy instead of using the highest-priority one alone

官方文件
maxEffortLevel enum

Cap the effort level for every model or per model, on every provider

官方文件
maxProseWidth number

Cap how wide the prose in Claude's responses runs in a wide terminal

官方文件
minimumVersion string

Keep auto-updates from installing anything below a version

官方文件
model string

Set the default Claude model alias or full model ID.

官方文件
modelOverrides object

Map model IDs to your provider's IDs, such as Bedrock ARNs

官方文件
modelPicker object

Choose which models the `/model` picker lists, in your own order and with your own labels

官方文件
modelPricing object

Report spend at your organization's contracted rates instead of list price

官方文件
modelSettings object

Keep a saved effort level or auto-compact window per model, or cap one model's effort

官方文件
otelHeadersHelper string

Generate rotating OpenTelemetry headers with your own command

官方文件 敏感
outputStyle string

Change Claude's role, tone, and output format with an output style

官方文件
parentSettingsBehavior string

Apply or drop restrictions an SDK or IDE host passes when you deploy managed settings

官方文件
permissionExplainerEnabled boolean

Removed in v2.1.257, together with the `Ctrl+E` command explanation on shell permission prompts

歷史項目
permissions object

Define allow, ask, deny, additional-directory, and permission-mode policy.

官方文件
permissions.additionalDirectories array

Give Claude file access to directories outside the current one

官方文件
permissions.allow array

Approve listed tool uses without a prompt

官方文件
permissions.ask array

Always prompt before listed tool uses

官方文件
permissions.blockReadsOutsideWorkingDirectories boolean

Make the file tools refuse reads outside the working directories in every permission mode

官方文件
permissions.defaultMode enum

Set the permission mode new sessions start in

官方文件
permissions.deny array

Block listed tool uses, including reads of files that hold secrets

官方文件
permissions.disableBypassPermissionsMode string

Prevent anyone from entering bypassPermissions mode

官方文件
plansDirectory string

Choose where plan mode writes plan files

官方文件
pluginConfigs object

Store the answers you gave a plugin's configuration dialog

官方文件
pluginSuggestionMarketplaces array

Choose which marketplaces can surface plugin install suggestions in `/plugin`

官方文件
pluginTrustMessage string

Add your own text to the plugin trust warning

官方文件
policyHelper object

Run an executable that computes managed settings at startup

官方文件
policyHelper.path string

Name the helper executable Claude Code runs

官方文件
policyHelper.refreshIntervalMs integer

Re-run the helper in the background on an interval

官方文件
policyHelper.timeoutMs integer

Set how long Claude Code waits for the helper

官方文件
preferredNotifChannel string

Choose a terminal bell or desktop notification for task completion

官方文件
prefersReducedMotion boolean

Reduce or turn off spinner, shimmer, and flash animations

官方文件
prependPlugins array

Run your organization's mods before every mod a user installs

官方文件
processWrapper string

Run Claude Code's background processes through a corporate launcher on macOS and Linux

官方文件
promptCacheTtl enum

Choose the prompt cache lifetime for the main conversation

官方文件
promptSuggestionEnabled boolean

Show or hide predicted next-prompt suggestions in the input box.

官方文件
prStatusFooterEnabled boolean

Turn off the prompt footer's PR review status badge and the pull request check behind it

官方文件
prUrlTemplate string

Point PR links at an internal code-review tool instead of github.com

官方文件
remote.defaultEnvironmentId string

Pick the default cloud environment for `claude --cloud`; a self-hosted `ccpool_` ID is read only from user and managed settings and `--settings`

官方文件 敏感
remoteControlAtStartup boolean

Connect Remote Control automatically when a session starts

官方文件
requireCoworkFullVmSandbox boolean

Configure Claude Code's requireCoworkFullVmSandbox setting.

官方文件
requiredMaximumVersion string

Refuse to start on a version newer than your organization allows

官方文件
requiredMinimumVersion string

Refuse to start on a version older than your organization requires

官方文件
respectGitignore boolean

Keep gitignored files out of the `@` file picker

官方文件
respondToBashCommands boolean

Stop Claude from responding after a `!` shell command runs

官方文件
sandbox object

Configure filesystem, network, credential, and command sandbox policy.

官方文件
sandbox.allowAppleEvents boolean

Let sandboxed commands send Apple Events on macOS

官方文件
sandbox.allowUnsandboxedCommands boolean

Let Claude retry a blocked command outside the sandbox, or forbid it

官方文件
sandbox.autoAllowBashIfSandboxed boolean

Run sandboxed commands without a permission prompt

官方文件
sandbox.bwrapPath string

Point the sandbox at a bubblewrap binary outside `PATH`

官方文件
sandbox.credentials object

Hide or mask credential files and variables inside the sandbox

官方文件 敏感
sandbox.credentials.allowPlaintextInject boolean

Let masked credentials reach plain HTTP services on trusted test networks

官方文件 敏感
sandbox.credentials.awsPairs array

Link custom-named AWS key variables into one credential for re-signing

官方文件 敏感
sandbox.credentials.envVars array

Unset or mask an environment variable inside the sandbox

官方文件 敏感
sandbox.credentials.files array

Block or mask reads of a credential file inside the sandbox

官方文件 敏感
sandbox.credentials.sigv4 object

Choose whether streaming, presigned, or SigV4A AWS requests fail or pass through

官方文件 敏感
sandbox.enabled boolean

Turn on Bash sandboxing on macOS, Linux, and WSL2

官方文件
sandbox.enableWeakerNestedSandbox boolean

Run the Linux sandbox inside an unprivileged container

官方文件
sandbox.enableWeakerNetworkIsolation boolean

Let `gh`, `gcloud`, and `terraform` verify TLS behind a MITM proxy inside the sandbox on macOS

官方文件
sandbox.excludedCommands array

Name commands Claude Code can run outside the sandbox

官方文件
sandbox.failIfUnavailable boolean

Refuse to start when the sandbox can't, instead of running unsandboxed

官方文件
sandbox.filesystem object

Control which paths sandboxed commands can read and write

官方文件
sandbox.filesystem.allowManagedReadPathsOnly boolean

Stop developers from re-opening read paths your organization blocked

官方文件
sandbox.filesystem.allowRead array

Re-open reading inside a region `denyRead` blocks

官方文件
sandbox.filesystem.allowWrite array

Add paths sandboxed commands can write to

官方文件
sandbox.filesystem.denyRead array

Block sandboxed commands from reading specific paths

官方文件
sandbox.filesystem.denyWrite array

Block sandboxed commands from writing to specific paths

官方文件
sandbox.filesystem.disabled boolean

Turn off filesystem isolation while keeping network isolation

官方文件
sandbox.ignoreViolations object

Silence violation reports for paths a command is expected to probe

官方文件
sandbox.network object

Control which hosts, ports, and sockets sandboxed commands reach

官方文件
sandbox.network.allowAllUnixSockets boolean

Let sandboxed commands connect to every Unix socket

官方文件
sandbox.network.allowedDomains array

Pre-allow domains so sandboxed commands don't prompt for them

官方文件
sandbox.network.allowLocalBinding boolean

Let sandboxed commands listen on network ports and connect to localhost on macOS

官方文件
sandbox.network.allowMachLookup array

Let macOS sandboxed tools like the iOS Simulator or Playwright reach their XPC services

官方文件
sandbox.network.allowManagedDomainsOnly boolean

Lock the network allowlist to managed settings

官方文件
sandbox.network.allowUnixSockets array

List Unix socket paths sandboxed commands can use on macOS

官方文件
sandbox.network.deniedDomains array

Block domains for sandboxed commands, even inside an allowed wildcard

官方文件
sandbox.network.httpProxyPort number

Route sandbox HTTP traffic through your own proxy

官方文件
sandbox.network.socksProxyPort number

Route sandbox SOCKS traffic through your own proxy

官方文件
sandbox.network.strictAllowlist boolean

Deny hosts outside the allowlist instead of prompting

官方文件
sandbox.network.tlsTerminate object

Have the sandbox proxy terminate TLS so it can read HTTPS requests

官方文件
sandbox.ripgrep object

Use your own ripgrep binary inside the sandbox

官方文件
sandbox.socatPath string

Point the sandbox proxy at a `socat` binary outside `PATH`

官方文件
showClearContextOnPlanAccept boolean

Show a "clear context" option on the plan accept screen

官方文件
showThinkingSummaries boolean

See summaries of Claude's thinking instead of a collapsed stub

官方文件
showTurnDuration boolean

Hide the "Cooked for" duration after each response

官方文件
skillListingBudgetFraction number

Reserve more or less context for the skill listing

官方文件
skillListingMaxDescChars integer

Cap each skill's description length in the skill listing

官方文件
skillOverrides object

Hide or collapse a skill without editing its SKILL.md

官方文件
skipAutoPermissionPrompt boolean

Skip the one-time notice Claude Code shows when you first enter auto mode yourself rather than through the built-in default

官方文件
skipDangerousModePermissionPrompt boolean

Skip the confirmation dialog before bypassPermissions mode

官方文件
skippedMarketplaces array

Configure Claude Code's skippedMarketplaces setting.

官方文件
skippedPlugins array

Configure Claude Code's skippedPlugins setting.

官方文件
skipWebFetchPreflight boolean

Skip the WebFetch hostname check when Anthropic is unreachable

官方文件
spellcheck object

Underline misspelled words in the prompt input with a spell checker you install

官方文件
spinnerTipsEnabled boolean

Hide tips in the spinner while Claude works

官方文件
spinnerTipsOverride object

Add your own tips to the spinner rotation, or replace the built-in tips

官方文件
spinnerVerbs object

Add or replace the verbs shown while a turn runs

官方文件
sshConfigs array

Add SSH connections to the Desktop environment selector

官方文件
sshHostAllowlist array

Limit which hosts Desktop SSH sessions can reach

官方文件
statusLine object

Configure a command-backed status line.

官方文件
strictKnownMarketplaces array

Allowlist the marketplace sources users can add and install from

官方文件
strictPluginOnlyCustomization object

Block skills, agents, hooks, and MCP servers from user and project sources

官方文件
strictPluginOnlyCustomization.agents string

Lock agents to plugin and managed sources

官方文件
strictPluginOnlyCustomization.hooks string

Lock hooks to plugin and managed sources

官方文件
strictPluginOnlyCustomization.mcp string

Lock MCP servers to plugin and managed sources

官方文件
strictPluginOnlyCustomization.skills string

Lock skills to plugin and managed sources

官方文件
subagentPromptCacheTtl enum

Choose the prompt cache lifetime for subagents and other requests outside the main conversation

官方文件
subagentStatusLine object

Rewrite rows in the subagent task display with your own command

官方文件
switchModelsOnFlag boolean

Switch models automatically or pause when a safety classifier flags a request

官方文件
syncClaudeAiPlugins boolean

Stop loading the plugins enabled on your claude.ai account and stop downloading new ones

官方文件
syncClaudeAiSkills boolean

Stop loading the skills enabled on your claude.ai account and stop downloading new ones

官方文件
syntaxHighlightingDisabled boolean

Turn off syntax highlighting in diffs and code blocks

官方文件
taskOutputMaxChars integer

Removed in v2.1.277, together with the `TaskOutput` tool it sized

歷史項目
teammateDefaultModel string

Removed in v2.1.234; see Specify teammates and models for how Claude Code picks a teammate's model

歷史項目
teammateMode string

Choose how agent team teammates display

官方文件
terminalProgressBarEnabled boolean

Hide the terminal progress bar in terminals that support it

官方文件
terminalTitleFromRename boolean

Stop `/rename` and `--name` from changing the terminal tab title

官方文件
theme string

Pick the interface color theme, built-in or custom

官方文件
timeFormat enum

Show the times in the interface on a 12-hour or 24-hour clock, in UTC, or with a strftime pattern

官方文件
timeZone string

Show the times in the interface in a time zone other than your system's

官方文件
tui string

Choose the fullscreen or classic terminal renderer

官方文件
ultracode boolean

Have Claude plan a workflow for each substantive task without being asked

官方文件
useAutoModeDuringPlan boolean

Let the auto mode classifier review shell commands in plan mode; set `false` to get prompts instead

官方文件
verbose boolean

Show full tool output instead of truncated summaries; `viewMode` takes precedence when both are set

官方文件
viewMode string

Start every session in default, verbose, or focus view

官方文件
vimInsertModeRemaps object

Map a two-key INSERT-mode sequence such as `jj` to Escape

官方文件
voice object

Turn on voice dictation and pick hold or tap mode

官方文件
voiceEnabled boolean

Turn on voice dictation with the older single-key form

官方文件
wheelScrollAccelerationEnabled boolean

Turn off mouse-wheel acceleration in fullscreen rendering

官方文件
workflowKeywordTriggerEnabled boolean

Let the word `ultracode` in a prompt start a workflow; set `false` to type it without starting one

官方文件
workflowSizeGuideline string

Set the agent count Claude aims for in dynamic workflows

官方文件
worktree object

Configure worktree creation, sparse paths, symlinks, and background isolation.

官方文件
worktree.baseRef string

Branch new worktrees from the remote default branch or your local HEAD

官方文件
worktree.bgIsolation boolean

Let background sessions edit the working copy without a worktree

官方文件
worktree.location string

Choose where Desktop SSH sessions create their worktrees on a remote machine

官方文件
worktree.sparsePaths array

Check out only the directories you need in each worktree

官方文件
worktree.symlinkDirectories array

Symlink large directories into each worktree instead of duplicating them

官方文件
wslInheritsWindowsSettings boolean

Have WSL read managed settings from the Windows policy chain

官方文件
04

環境變數

此版本快照所收錄的完整官方環境變數表。

ANTHROPIC_API_KEY ENV

API key sent as `X-Api-Key` header.

官方文件 敏感
ANTHROPIC_AUTH_TOKEN ENV

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

官方文件 敏感
ANTHROPIC_AWS_API_KEY ENV

Workspace API key for Claude Platform on AWS, generated in the AWS Console.

條件式 敏感
ANTHROPIC_AWS_BASE_URL ENV

Override the Claude Platform on AWS endpoint URL.

條件式
ANTHROPIC_AWS_WORKSPACE_ID ENV

Required for Claude Platform on AWS.

條件式
ANTHROPIC_BASE_URL ENV

Override the API endpoint to route requests through a proxy or gateway.

官方文件
ANTHROPIC_BEDROCK_BASE_URL ENV

Override the Amazon Bedrock endpoint URL.

條件式
ANTHROPIC_BEDROCK_MANTLE_BASE_URL ENV

Override the Amazon Bedrock Mantle endpoint URL.

條件式
ANTHROPIC_BEDROCK_REGION_PREFIX ENV

Cross-region inference profile prefix (`us`, `eu`, `apac`, `jp`, `au`, or `global`) Claude Code tries first instead of the one derived from the AWS region.

條件式
ANTHROPIC_BEDROCK_SERVICE_TIER ENV

Amazon Bedrock service tier (`default`, `flex`, or `priority`).

條件式
ANTHROPIC_BETAS ENV

Comma-separated list of additional `anthropic-beta` header values to include in API requests.

官方文件
ANTHROPIC_CUSTOM_HEADERS ENV

Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers).

官方文件 敏感
ANTHROPIC_CUSTOM_MODEL_OPTION ENV

Model ID to add as a custom entry in the `/model` picker.

官方文件
ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION ENV

Display description for the custom model entry in the `/model` picker.

官方文件
ANTHROPIC_CUSTOM_MODEL_OPTION_NAME ENV

Display name for the custom model entry in the `/model` picker.

官方文件
ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES ENV

Comma-separated list of capabilities the custom model supports, for example `effort,thinking`.

官方文件
ANTHROPIC_DEFAULT_FABLE_MODEL ENV

Model ID that the `fable` alias resolves to, and the ID Claude Code recognizes as a Fable model for automatic model fallback on third-party providers.

官方文件
ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION ENV

Display description for the pinned Fable model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_FABLE_MODEL_NAME ENV

Display name for the pinned Fable model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES ENV

Comma-separated list of capabilities the pinned Fable model supports, for example `effort,thinking`.

官方文件
ANTHROPIC_DEFAULT_HAIKU_MODEL ENV

Model ID that the `haiku` alias resolves to, also used for background functionality.

官方文件
ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION ENV

Display description for the pinned Haiku model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME ENV

Display name for the pinned Haiku model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES ENV

Comma-separated list of capabilities the pinned Haiku model supports, for example `effort,thinking`.

官方文件
ANTHROPIC_DEFAULT_MODEL ENV

Model that new sessions start on by default.

官方文件
ANTHROPIC_DEFAULT_OPUS_MODEL ENV

Model ID that the `opus` alias resolves to, and that `opusplan` uses while Plan Mode is active.

官方文件
ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION ENV

Display description for the pinned Opus model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_OPUS_MODEL_NAME ENV

Display name for the pinned Opus model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES ENV

Comma-separated list of capabilities the pinned Opus model supports, for example `effort,thinking`.

官方文件
ANTHROPIC_DEFAULT_SONNET_MODEL ENV

Model ID that the `sonnet` alias resolves to, and that `opusplan` uses when Plan Mode is not active.

官方文件
ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION ENV

Display description for the pinned Sonnet model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_SONNET_MODEL_NAME ENV

Display name for the pinned Sonnet model in the `/model` picker.

官方文件
ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES ENV

Comma-separated list of capabilities the pinned Sonnet model supports, for example `effort,thinking`.

官方文件
ANTHROPIC_FEDERATION_RULE_ID ENV

Federation rule ID for Workload Identity Federation.

官方文件
ANTHROPIC_FOUNDRY_API_KEY ENV

API key for Microsoft Foundry authentication (see Microsoft Foundry)

條件式 敏感
ANTHROPIC_FOUNDRY_AUTH_TOKEN ENV

Bearer token for Microsoft Foundry authentication, such as a Microsoft Entra access token.

條件式 敏感
ANTHROPIC_FOUNDRY_BASE_URL ENV

Full base URL for the Microsoft Foundry resource (for example, `https://my-resource.services.ai.azure.com/anthropic`).

條件式
ANTHROPIC_FOUNDRY_RESOURCE ENV

Microsoft Foundry resource name (for example, `my-resource`).

條件式
ANTHROPIC_MODEL ENV

Name of the model setting to use (see Model Configuration)

官方文件
ANTHROPIC_ORGANIZATION_ID ENV

Organization ID for Workload Identity Federation.

官方文件
ANTHROPIC_PROFILE ENV

Name of the Anthropic profile to authenticate with, such as one created by `ant auth login` or by signing in to a Console account without an API key.

官方文件
ANTHROPIC_SMALL_FAST_MODEL ENV

\[DEPRECATED] Name of Haiku-class model for background tasks

官方文件
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION ENV

Override AWS region for the Haiku-class model when using Amazon Bedrock or Amazon Bedrock Mantle.

條件式
ANTHROPIC_VERTEX_BASE_URL ENV

Override Google Cloud's Agent Platform endpoint URL.

條件式
ANTHROPIC_VERTEX_PROJECT_ID ENV

GCP project ID that Google Cloud's Agent Platform requests are addressed to.

條件式
ANTHROPIC_WORKSPACE_ID ENV

Workspace ID for workload identity federation.

官方文件
API_FORCE_IDLE_TIMEOUT ENV

Override the 5-minute body idle timeout that aborts a streaming model response when no bytes arrive.

官方文件
API_TIMEOUT_MS ENV

Time in milliseconds that each API request attempt has to receive its response headers.

官方文件
AWS_BEARER_TOKEN_BEDROCK ENV

Amazon Bedrock API key for authentication (see Amazon Bedrock API keys)

條件式
BASH_DEFAULT_TIMEOUT_MS ENV

Default timeout for a foreground Bash or PowerShell tool command, in milliseconds (default: 120000, or 2 minutes).

官方文件
BASH_MAX_OUTPUT_LENGTH ENV

Maximum number of characters of bash output that Claude Code reads back into a command's result (default: 30000; maximum: 150000).

官方文件
BASH_MAX_TIMEOUT_MS ENV

Maximum timeout the model can set for a foreground Bash or PowerShell tool command, in milliseconds (default: 600000, or 10 minutes).

官方文件
BETA_TRACING_ENDPOINT ENV

OTLP/HTTP endpoint for detailed beta tracing: with `ENABLE_BETA_TRACING_DETAILED=1`, logs and traces go there instead of to the configured exporters.

官方文件
CCR_FORCE_BUNDLE ENV

Set to `1` to force `claude --cloud` to bundle and upload your local repository instead of cloning from its remote

官方文件
CLAUDECODE ENV

Set to `1` in subprocesses Claude Code spawns (Bash and PowerShell tools, tmux sessions, hook commands, status line commands, stdio MCP server subprocesses).

官方文件
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS ENV

Set to `1` to disable all built-in subagent types such as Explore and Plan.

官方文件
CLAUDE_AGENT_SDK_MCP_NO_PREFIX ENV

Set to `1` to skip the `mcp__<server>__` prefix on tool names from SDK-created MCP servers.

條件式
CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS ENV

Stall timeout in milliseconds for subagents.

官方文件
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE ENV

Set the percentage (1-100) of the auto-compact window at which auto-compaction triggers.

條件式
CLAUDE_AUTO_BACKGROUND_TASKS ENV

Set to `1` to force-enable automatic backgrounding of long-running agent tasks.

官方文件
CLAUDE_AX_PREPARK_MS ENV

In screen reader mode, how many milliseconds Claude Code waits before it writes a new or changed line.

官方文件
CLAUDE_AX_SCREEN_READER ENV

Set to `1` to render screen-reader friendly output: flat text without decorative borders or animations.

官方文件
CLAUDE_AX_STARTUP_QUIET_MS ENV

In screen reader mode, how many milliseconds Claude Code holds the first interface render after the startup confirmation line, so your screen reader can speak the line in full before new output interrupts it.

官方文件
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR ENV

Return to the original working directory after each Bash or PowerShell command in the main session

官方文件
CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS ENV

Timeout in milliseconds for the byte-level streaming idle watchdog; when set, it takes precedence over `CLAUDE_STREAM_IDLE_TIMEOUT_MS` for that watchdog and leaves the event-level watchdog unchanged.

官方文件
CLAUDE_CLIENT_PRESENCE_FILE ENV

Path to a file that an external tool, such as a screen-lock listener, creates when you unlock your screen and deletes when you lock it.

官方文件
CLAUDE_CODE_ACCESSIBILITY ENV

Set to `1` to keep the native terminal cursor visible and disable the inverted-text cursor indicator.

官方文件
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD ENV

Set to `1` to load memory files from directories specified with `--add-dir`.

官方文件
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT ENV

Set to `1` to repaint the entire screen on every frame in fullscreen rendering instead of sending incremental updates.

官方文件
CLAUDE_CODE_ALWAYS_ENABLE_EFFORT ENV

Set to `1` to send the effort parameter with every request, even when Claude Code does not recognize the model ID as effort-capable.

官方文件
CLAUDE_CODE_API_KEY_HELPER_TTL_MS ENV

Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`)

官方文件 敏感
CLAUDE_CODE_ARTIFACT_AUTO_OPEN ENV

Set to `0` to stop Claude Code from opening the browser automatically when a new artifact is published

官方文件
CLAUDE_CODE_ARTIFACT_COMMENTS ENV

Set to `0` to stop Claude reading and replying to comments on an artifact.

官方文件
CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT ENV

Set to `0` to stop Claude replying on its own to comments sent to it.

官方文件
CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS ENV

Set to `0` to stop Claude from applying small changes to an artifact's file as part of publishing it.

官方文件
CLAUDE_CODE_ATTRIBUTION_HEADER ENV

Set to `0` to omit the attribution block, which carries the client version and a prompt fingerprint, from the start of the system prompt.

官方文件
CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS ENV

Removed in v2.1.283.

官方文件
CLAUDE_CODE_AUTO_COMPACT_WINDOW ENV

Set the auto-compact window, how full the context gets before compaction, from `100000` to `1000000` tokens.

官方文件
CLAUDE_CODE_AUTO_CONNECT_IDE ENV

Override automatic IDE connection.

條件式
CLAUDE_CODE_AUTO_MODE_MODEL ENV

Sets the model for the classifier requests Claude Code sends in auto mode.

官方文件
CLAUDE_CODE_AUTO_MODE_SERVER ENV

Controls whether Claude Code asks the server to review auto mode actions.

官方文件
CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS ENV

Time in milliseconds Claude Code waits for the AWS default credential provider chain to produce credentials before the request fails with `AWS default-chain credential resolve timed out` (default: `60000`).

條件式
CLAUDE_CODE_BASH_EDIT_DIFF ENV

Set to `0` to turn off the diff of the files that changed while a Bash command ran, or `1` to record it in every permission mode.

官方文件
CLAUDE_CODE_BG_TASKS_REPORT_RUNNING ENV

Set to `0` to make a non-interactive session report an idle status to its host at every turn end, even while background work is still running.

官方文件
CLAUDE_CODE_BRIDGE_SESSION_ID ENV

Set automatically in Bash tool and hook command subprocesses while the session has an active Remote Control connection, and removed when the connection ends.

官方文件
CLAUDE_CODE_BS_AS_CTRL_BACKSPACE ENV

Set to `0` to make Claude Code read the `0x08` byte, also written `^H`, as plain Backspace, or `1` to read it as Ctrl+Backspace.

官方文件
CLAUDE_CODE_CERT_STORE ENV

Comma-separated list of CA certificate sources for TLS connections.

官方文件
CLAUDE_CODE_CHILD_SESSION ENV

Set to `1` in subprocesses Claude Code spawns via the Bash, PowerShell, and Monitor tools, hook commands, and status line commands.

官方文件
CLAUDE_CODE_CLIENT_CERT ENV

Path to client certificate file for mTLS authentication

官方文件
CLAUDE_CODE_CLIENT_KEY ENV

Path to client private key file for mTLS authentication

官方文件 敏感
CLAUDE_CODE_CLIENT_KEY_PASSPHRASE ENV

Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional)

官方文件 敏感
CLAUDE_CODE_CONNECT_TIMEOUT_MS ENV

Removed in v2.1.186 and now a no-op.

官方文件
CLAUDE_CODE_DEBUG_LOGS_DIR ENV

Override the debug log file path.

官方文件
CLAUDE_CODE_DEBUG_LOG_LEVEL ENV

Minimum log level written to the debug log file.

官方文件
CLAUDE_CODE_DISABLE_1M_CONTEXT ENV

Set to `1` to turn off 1M context window support.

官方文件
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING ENV

Set to `1` to disable adaptive reasoning on Opus 4.6 and Sonnet 4.6 and fall back to the fixed thinking budget controlled by `MAX_THINKING_TOKENS`.

官方文件
CLAUDE_CODE_DISABLE_ADVISOR_TOOL ENV

Set to `1` to disable the advisor tool.

官方文件
CLAUDE_CODE_DISABLE_AGENT_VIEW ENV

Set to `1` to turn off background agents and agent view: `claude agents`, `--bg`, `/background`, and the on-demand supervisor.

官方文件
CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN ENV

Set to `1` to disable fullscreen rendering and use the classic main-screen renderer.

官方文件
CLAUDE_CODE_DISABLE_ARTIFACT ENV

Set to `1` to turn off the Artifact tool, which publishes session output as a private web page on claude.ai.

官方文件
CLAUDE_CODE_DISABLE_ATTACHMENTS ENV

Set to `1` to disable attachment processing.

官方文件
CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCK ENV

Set to `1` to make a Claude Code process run its `gcpAuthRefresh` or `awsAuthRefresh` command itself instead of waiting while another process runs it.

官方文件
CLAUDE_CODE_DISABLE_AUTO_MEMORY ENV

Set to `1` to disable auto memory.

官方文件
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS ENV

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

官方文件
CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT ENV

Set to `1` to stop Claude Code from treating an Amazon Bedrock streaming response with a missing or empty `Content-Type` header as Amazon Bedrock's binary event stream.

條件式
CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD ENV

Set to `1` to skip the check that an Amazon Bedrock streaming response carries the `application/vnd.amazon.eventstream` content-type.

條件式
CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF ENV

Set to `1` to stop a background session's in-flight work when the supervisor stops, restarts, or updates that session's process, instead of handing it to the session's next process.

官方文件
CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP ENV

Set to `1` to stop Claude Code from terminating background shell commands under memory pressure.

官方文件
CLAUDE_CODE_DISABLE_BUNDLED_SKILLS ENV

Set to `1` to disable the skills and workflows included with Claude Code: bundled skills and workflows are removed entirely, while built-in commands like `/init` stay typable but are hidden from the model.

官方文件
CLAUDE_CODE_DISABLE_CFC_PROMPT ENV

Set to `1` to keep the Claude in Chrome browser tools available while omitting the Chrome section of the system prompt and the `/claude-in-chrome` bundled skill.

官方文件
CLAUDE_CODE_DISABLE_CLAUDE_MDS ENV

Set to `1` to prevent loading any CLAUDE.md memory files into context, including user, project, and auto memory files

官方文件
CLAUDE_CODE_DISABLE_CRON ENV

Set to `1` to disable session-scoped scheduled tasks.

官方文件
CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT ENV

Set to `1` to turn off the time limit on critical-path removal prompts.

官方文件
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS ENV

Set to `1` to strip pre-release `anthropic-beta` request headers, the body fields that pair with them, and beta tool-schema fields such as `defer_loading` and `eager_input_streaming` from API requests.

條件式
CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS ENV

Set to `1` to disable the built-in Explore and Plan subagents.

官方文件
CLAUDE_CODE_DISABLE_FAST_MODE ENV

Set to `1` to disable fast mode

官方文件
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY ENV

Set to `1` to disable the "How is Claude doing?" session quality surveys.

官方文件
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING ENV

Set to `1` to disable file checkpointing.

官方文件
CLAUDE_CODE_DISABLE_FILE_MENTIONS ENV

Set to `1` to stop Claude Code from expanding `@` mentions of files and directories.

官方文件
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS ENV

Set to `1` to remove built-in commit and PR workflow instructions and the git status snapshot from Claude's context.

官方文件
CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT ENV

Set to `1` to stop Claude Code from reading scripts passed to a shell with `-c`, such as `bash -c 'rm -rf ~'`, for critical-path removals.

官方文件
CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP ENV

Set to `1` to prevent automatic remapping of Opus 4 and Opus 4.1 to the current Opus version on the Anthropic API.

官方文件
CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACK ENV

Set to `1` to stop Claude Code on Amazon Bedrock and Google Cloud's Agent Platform from switching to an older model when your account loses access to a session's model mid-session; the refused request fails at once…

官方文件
CLAUDE_CODE_DISABLE_MOUNTED_DRIVE_RM_PROMPT ENV

Set to `1` to turn off the mounted drive prompt for paths such as `/Volumes/USB`.

官方文件
CLAUDE_CODE_DISABLE_MOUSE ENV

Set to `1` to disable mouse tracking in fullscreen rendering.

官方文件
CLAUDE_CODE_DISABLE_MOUSE_CLICKS ENV

Set to `1` to disable click, drag, and hover handling in fullscreen rendering while keeping mouse-wheel scrolling.

官方文件
CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION ENV

Set to `1` to stop Claude Code from re-reading the mTLS client certificate and key when an API request fails with a connection-level error, such as a connection reset or a TLS handshake error.

官方文件
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC ENV

Set to any non-empty value, such as `1`, to disable nonessential network traffic: auto-updates, telemetry, error reporting, the `/feedback` command, Claude-drafted feedback, release notes, the PR and MR status badge…

官方文件
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK ENV

Set to `1` to disable the non-streaming fallback when a streaming request fails mid-stream.

官方文件
CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK ENV

Set to `1` to send the `PushNotification` tool's desktop notification even while you are typing in or focused on the terminal.

官方文件
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL ENV

Set to `1` to disable automatic registration of the official plugin marketplace.

官方文件
CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS ENV

Set to `1` to stop Claude Code from running your `Notification` hooks for unanswered permission requests in sessions where Claude Code sends them to the Agent SDK's `canUseTool` callback, which is how Claude Desktop…

官方文件
CLAUDE_CODE_DISABLE_POLICY_SKILLS ENV

Set to `1` to skip loading skills from the system-wide managed skills directory.

官方文件
CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY ENV

Set to `1` to turn off the PowerShell tool check that denies the `cmd` built-ins `rd`, `rmdir`, `del`, and `erase` on a system path, such as a drive root or your home directory.

條件式
CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK ENV

Set to `1` to turn off the automatic model switch when a safety classifier flags a request, the behavior the `switchModelsOnFlag` setting controls

官方文件
CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS ENV

Set to `1` to stop Claude Code from sending the structured-output `output_config.format` field and the `anthropic-beta` value that pairs with it, for an LLM gateway whose upstream rejects them.

官方文件
CLAUDE_CODE_DISABLE_SUBSTITUTION_RM_PROMPT ENV

Set to `1` to turn off the critical-path check for a recursive `rm` whose target is entirely the output of a command substitution, such as `rm -rf "$(pwd)"`.

官方文件
CLAUDE_CODE_DISABLE_TERMINAL_TITLE ENV

Set to `1` to disable automatic terminal title updates based on conversation context.

官方文件
CLAUDE_CODE_DISABLE_THINKING ENV

Set to `1` to omit the `thinking` parameter from API requests entirely.

官方文件
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT ENV

Set to `1` to skip proactive auto-compaction when Claude Code doesn't recognize the model ID, such as an LLM gateway alias.

官方文件
CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL ENV

Set to `1` to disable virtual scrolling in fullscreen rendering and render every message in the transcript.

官方文件
CLAUDE_CODE_DISABLE_WEB_FETCH ENV

Set to `1` to turn off the WebFetch tool.

官方文件
CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER ENV

Set to `1` to start PowerShell tool commands on Windows directly instead of through the `cmd.exe` launcher.

官方文件
CLAUDE_CODE_DISABLE_WORKFLOWS ENV

Set to `1` to disable workflows.

官方文件
CLAUDE_CODE_EFFORT_LEVEL ENV

Set the effort level for supported models.

官方文件
CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS ENV

Set to `1` to add `session_state_changed` messages, which carry the session's state, to the message stream.

官方文件
CLAUDE_CODE_ENABLE_AUTO_MODE ENV

Accepted for compatibility with older releases and has no effect.

官方文件
CLAUDE_CODE_ENABLE_AWAY_SUMMARY ENV

Override session recap availability.

官方文件
CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH ENV

Set to `1` to refresh plugin state at turn boundaries in non-interactive mode after a background install completes.

官方文件
CLAUDE_CODE_ENABLE_CFC ENV

Set to `1` to start a CLI session with Chrome integration on, or `0` to start with it off.

官方文件
CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL ENV

Set to `1` to route the "How is Claude doing?" session quality survey to your own OpenTelemetry collector when Anthropic-bound nonessential traffic is blocked.

官方文件
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING ENV

Controls whether tool call inputs stream from the API as Claude generates them.

官方文件
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY ENV

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.

官方文件
CLAUDE_CODE_ENABLE_OPUS_4_7_FAST_MODE ENV

Removed in v2.1.142, when the fast mode default moved from Opus 4.6 to Opus 4.7

官方文件
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION ENV

Set to `false` to turn off prompt suggestions, the grayed-out predictions that appear in your prompt input.

官方文件
CLAUDE_CODE_ENABLE_TASKS ENV

Selects which task-tracking tools Claude Code provides in sessions that have them.

官方文件
CLAUDE_CODE_ENABLE_TELEMETRY ENV

Set to `1` to enable OpenTelemetry data collection for metrics and logging.

官方文件
CLAUDE_CODE_ENABLE_TODO_TOOLS ENV

Set to `1` to get the task-tracking tools on every model.

官方文件
CLAUDE_CODE_EXIT_AFTER_STOP_DELAY ENV

Time in milliseconds to wait after the query loop becomes idle before automatically exiting.

官方文件
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS ENV

Set to `1` to enable agent teams.

條件式
CLAUDE_CODE_EXTRA_BODY ENV

JSON object to merge into the top level of every API request body.

官方文件
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS ENV

Override the default token limit for file reads, which is 25,000 tokens.

官方文件
CLAUDE_CODE_FORCE_SESSION_PERSISTENCE ENV

Set to `1` to force transcript persistence, prompt history, and `claude agents` registration even when this `claude` was launched from inside another Claude Code session.

官方文件
CLAUDE_CODE_FORCE_STRIKETHROUGH ENV

Set to `1` to force strikethrough rendering for `~~text~~` in Claude's responses when your terminal supports it but is not auto-detected, such as over SSH without `TERM_PROGRAM` forwarded.

官方文件
CLAUDE_CODE_FORCE_SYNC_OUTPUT ENV

Set to `1` to force-enable DEC private mode 2026 synchronized output when your terminal supports it but is not auto-detected.

官方文件
CLAUDE_CODE_FORCE_TERMINAL_IMAGES ENV

Set to `1` to draw mod `Image` elements as pictures when your terminal draws kitty graphics protocol images with Unicode placeholders and you still see an `Image`'s dimmed `alt` text.

官方文件
CLAUDE_CODE_FORK_SUBAGENT ENV

Controls fork mode, which is on by default and lets Claude start forks on its own.

官方文件
CLAUDE_CODE_FORWARD_SUBAGENT_TEXT ENV

Set to `1` to emit subagent text and thinking blocks in `claude -p --output-format stream-json` output, the same behavior as the `--forward-subagent-text` flag.

官方文件
CLAUDE_CODE_GATEWAY_HINT_HEADERS ENV

Set to `1` to send the gateway hint headers, such as `x-claude-code-request-class` and `x-claude-code-compaction`, on a custom proxy or a third-party provider such as Amazon Bedrock or Claude Platform on AWS.

官方文件
CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS ENV

Timeout in milliseconds for the gateway model discovery request that `CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY` turns on (default: `3000`).

官方文件
CLAUDE_CODE_GIT_BASH_PATH ENV

Windows only: path to the Git Bash executable (`bash.exe`).

官方文件
CLAUDE_CODE_GLOB_HIDDEN ENV

Set to `false` to exclude dotfiles from results when Claude invokes the Glob tool.

官方文件
CLAUDE_CODE_GLOB_NO_IGNORE ENV

Set to `false` to make the Glob tool respect `.gitignore` patterns.

官方文件
CLAUDE_CODE_GLOB_TIMEOUT_SECONDS ENV

Timeout in seconds for Glob tool file discovery.

官方文件
CLAUDE_CODE_GOAL_CHECKIN_MINUTES ENV

How many minutes background work can keep an active goal waiting before Claude Code asks Claude to check on it.

官方文件
CLAUDE_CODE_GZIP_REQUEST_BODIES ENV

Set to `0` to turn off gzip compression of Claude API, telemetry, and artifact publish request bodies sent to `api.anthropic.com`.

官方文件
CLAUDE_CODE_HIDE_CWD ENV

Set to `1` to hide the working directory in the startup logo.

條件式
CLAUDE_CODE_IDE_HOST_OVERRIDE ENV

Override the host address used to connect to the IDE extension.

條件式
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL ENV

Set to `1` to skip auto-installation of IDE extensions.

條件式
CLAUDE_CODE_IDE_SKIP_VALID_CHECK ENV

Set to `1` to skip validation of IDE lockfile entries during connection.

條件式
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS ENV

Context size, in tokens, at which idle compaction applies to a conversation (default: `200000`).

官方文件
CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS ENV

How many subagents can be running in one session before the Agent tool refuses to spawn another (default: 20).

官方文件
CLAUDE_CODE_MAX_CONTEXT_TOKENS ENV

Override the context window size Claude Code assumes for the active model.

官方文件
CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH ENV

Maximum length in characters of MCP tool descriptions and MCP server instructions that Claude Code sends to the model.

條件式
CLAUDE_CODE_MAX_OUTPUT_TOKENS ENV

Set the maximum number of output tokens for most requests.

官方文件
CLAUDE_CODE_MAX_RETRIES ENV

Override the number of times to retry failed API requests (default: 10).

官方文件
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION ENV

Removed in v2.1.224 and now a no-op.

官方文件
CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH ENV

Number of subagent layers allowed below the main conversation (default: 3).

官方文件
CLAUDE_CODE_MAX_TURNS ENV

Cap the number of agentic turns when no explicit limit is passed.

官方文件
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION ENV

Cap on WebSearch calls (default: 200).

官方文件
CLAUDE_CODE_MCP_ALLOWLIST_ENV ENV

Set to `1` to spawn stdio MCP servers with only a safe baseline environment plus the server's configured `env`, instead of inheriting your shell environment

條件式
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS ENV

Elapsed time in milliseconds before a still-running MCP tool call moves to a background task (default: 120000, or 2 minutes).

條件式
CLAUDE_CODE_MCP_STARTUP_WAIT_MS ENV

How long in milliseconds the first turn of a non-interactive session waits for MCP servers that are still connecting, in place of the default first-turn wait.

條件式
CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT ENV

Idle timeout in milliseconds for MCP tool calls.

條件式
CLAUDE_CODE_MESSAGING_SOCKET ENV

Set by Claude Code, not by you: in sessions that bind an inbox socket, Claude Code exports that socket's path to hooks and Bash commands when it binds the socket.

官方文件
CLAUDE_CODE_MESSAGING_TOKEN ENV

Set by Claude Code, not by you: in sessions that bind an inbox socket, Claude Code exports this per-session token to hooks and Bash commands alongside `CLAUDE_CODE_MESSAGING_SOCKET`.

官方文件
CLAUDE_CODE_NATIVE_CURSOR ENV

Set to `1` to show the terminal's own cursor at the input caret instead of a drawn block.

官方文件
CLAUDE_CODE_NEW_INIT ENV

Set to `1` to make `/init` run an interactive setup flow.

官方文件
CLAUDE_CODE_NONBLOCKING_STDOUT ENV

Set to `1` to write terminal output through a second non-blocking file descriptor, so a terminal that stops reading, such as a paused tmux control-mode pane or a stalled SSH connection, can't freeze Claude Code…

官方文件
CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES ENV

Limit how many times Claude Code re-sends a non-streaming request that times out.

官方文件
CLAUDE_CODE_NO_FLICKER ENV

Set to `1` to enable fullscreen rendering, a research preview that reduces flicker and keeps memory flat in long conversations.

官方文件
CLAUDE_CODE_OAUTH_REFRESH_TOKEN ENV

OAuth refresh token for Claude.ai authentication.

官方文件
CLAUDE_CODE_OAUTH_SCOPES ENV

Space-separated OAuth scopes the refresh token was issued with, such as `"user:profile user:inference user:sessions:claude_code"`.

官方文件
CLAUDE_CODE_OAUTH_TOKEN ENV

OAuth access token for claude.ai authentication.

官方文件 敏感
CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE ENV

Removed in v2.1.160 and now a no-op.

條件式
CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH ENV

Maximum length of content-bearing OpenTelemetry attributes (model responses, tool content, system prompts, raw API bodies), truncation marker included, in UTF-16 code units (default: 61440, i.e.

官方文件
CLAUDE_CODE_OTEL_DIAG_STDERR ENV

Set to `1` to write OpenTelemetry exporter diagnostic errors to stderr.

官方文件
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS ENV

Timeout in milliseconds for flushing pending OpenTelemetry spans (default: 5000).

官方文件
CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS ENV

Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes).

官方文件
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS ENV

Timeout in milliseconds for the OpenTelemetry exporter to finish on shutdown (default: 2000).

官方文件
CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS ENV

Starting delay in milliseconds, in place of the default 500, of the exponential backoff between automatic retries of a request that the API rejects with a `529` overloaded error.

官方文件
CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS ENV

Ceiling in milliseconds, in place of the default 32000, on the exponential backoff between automatic retries of a request that the API rejects with a `529` overloaded error.

官方文件
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE ENV

Set to `1` to let Claude Code run your package manager's upgrade command in the background when a new version is available.

官方文件
CLAUDE_CODE_PERFORCE_MODE ENV

Set to `1` to enable Perforce-aware write protection.

條件式
CLAUDE_CODE_PLUGIN_CACHE_DIR ENV

Override the plugins root directory.

官方文件
CLAUDE_CODE_PLUGIN_DIRS ENV

Plugin directories to load for the session, each loaded the way a `--plugin-dir` flag loads it.

官方文件
CLAUDE_CODE_PLUGIN_DIR_WATCH ENV

Controls whether Claude Code reloads a mod when the mod's files change.

官方文件
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS ENV

Timeout in milliseconds for cloning or refreshing a plugin marketplace (default: 120000).

官方文件
CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE ENV

Set to `1` to skip the re-clone attempt and keep using the existing marketplace checkout when a marketplace refresh can't reach or authenticate to the remote.

官方文件
CLAUDE_CODE_PLUGIN_PREFER_HTTPS ENV

Set to `1` to clone GitHub `owner/repo` shorthand sources over HTTPS instead of SSH.

官方文件
CLAUDE_CODE_PLUGIN_SEED_DIR ENV

Path to one or more read-only plugin seed directories, separated by `:` on Unix or `;` on Windows.

官方文件
CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY ENV

Set to `1` to stop Claude Code from passing `-ExecutionPolicy Bypass` when spawning PowerShell for tool calls, hooks, and status line commands, and respect the machine's effective execution policy instead.

條件式
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS ENV

Ceiling in milliseconds on idle waiting for background work, such as subagents and workflows, after the final turn in non-interactive mode with the `-p` flag.

官方文件
CLAUDE_CODE_PROCESS_WRAPPER ENV

Launch the processes Claude Code starts from its own binary, such as the background service that hosts agent view sessions, through a corporate launcher given as an argv prefix like `/opt/corp/launcher`.

官方文件
CLAUDE_CODE_PROJECT_DIR_NAME ENV

Set together with `CLAUDE_CONFIG_DIR` to choose the `projects/` directory name Claude Code stores that session's transcripts and auto memory under, in place of one derived from the working directory path.

官方文件
CLAUDE_CODE_PROMPT_CACHE_TTL ENV

Set `5m` or `1h`, the only values Claude Code accepts, to choose the prompt cache TTL for the main conversation: your interactive, `-p`, and SDK turns, plus the helpers that run inline with them.

官方文件
CLAUDE_CODE_PROPAGATE_TRACEPARENT ENV

Set to `1` to propagate W3C trace context when `ANTHROPIC_BASE_URL` points at a custom proxy.

官方文件
CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST ENV

Set by host platforms that embed Claude Code and manage model provider routing on its behalf.

條件式
CLAUDE_CODE_PROXY_RESOLVES_HOSTS ENV

Set to `1` to allow the proxy to perform DNS resolution instead of the caller.

官方文件
CLAUDE_CODE_REMOTE ENV

Set automatically to `true` when Claude Code is running as a cloud session.

條件式
CLAUDE_CODE_REMOTE_SESSION_ID ENV

Set automatically in cloud sessions to the current session's ID.

條件式
CLAUDE_CODE_RESTRICTED ENV

Set to `1` to start the session in restricted mode, the same as passing `--restricted`.

官方文件
CLAUDE_CODE_RESUME_INTERRUPTED_TURN ENV

Set to `1` to automatically resume if the previous session ended mid-turn.

官方文件
CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS ENV

Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume.

官方文件
CLAUDE_CODE_RESUME_PROMPT ENV

Override the continuation message Claude Code sends to Claude when `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` continues an interrupted turn instead of resending its prompt, or when you resume a deferred tool call with `-p`.

官方文件
CLAUDE_CODE_RETRY_WATCHDOG ENV

Set to `1` for unattended sessions such as eval harnesses, CI jobs, or remote workers.

官方文件
CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS ENV

Maximum time in milliseconds that each API request spends waiting out `429` and `529` errors when `CLAUDE_CODE_RETRY_WATCHDOG` is set.

官方文件
CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS ENV

Minimum interval in milliseconds between checks of whether a usage limit was already lifted, while a request waits for that limit to reset with `CLAUDE_CODE_RETRY_WATCHDOG` set.

官方文件
CLAUDE_CODE_SAFE_MODE ENV

Set to `1` to start in safe mode: CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands and agents, output styles, workflows, custom themes, custom keybindings, status line and file-suggestion commands, LSP…

官方文件
CLAUDE_CODE_SCRIPT_CAPS ENV

JSON object limiting how many times specific scripts may be invoked per session when `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` is set.

官方文件
CLAUDE_CODE_SCROLL_SPEED ENV

Set the mouse wheel scroll multiplier in fullscreen rendering.

官方文件
CLAUDE_CODE_SEND_FEEDBACK ENV

Set to `0` to turn off Claude-drafted feedback for a session.

官方文件
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS ENV

Override the time budget in milliseconds for SessionEnd hooks.

官方文件
CLAUDE_CODE_SESSION_ID ENV

Set automatically to the current session ID in Bash and PowerShell tool subprocesses, hook command subprocesses, and stdio MCP server subprocesses.

官方文件
CLAUDE_CODE_SHELL ENV

Set the shell Claude Code uses to run Bash tool commands.

官方文件
CLAUDE_CODE_SHELL_PREFIX ENV

Command prefix that wraps shell commands Claude Code spawns: Bash tool calls, hook commands, status line commands, and stdio MCP server startup commands.

官方文件
CLAUDE_CODE_SIMPLE ENV

Set to `1` to run with a minimal system prompt and only the Bash, file read, and file edit tools.

官方文件
CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT ENV

Choose between Claude Code's full system prompt and a shorter one with abbreviated tool descriptions.

官方文件
CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH ENV

Skip client-side authentication for Claude Platform on AWS, for gateways that sign requests themselves

條件式
CLAUDE_CODE_SKIP_AWS_CRED_CACHE ENV

Set to `1` to turn off the in-process cache of credentials resolved from the AWS default credential provider chain, so Claude Code resolves the chain on every API request.

條件式
CLAUDE_CODE_SKIP_BEDROCK_AUTH ENV

Skip AWS authentication for Amazon Bedrock (for example, when using an LLM gateway)

條件式
CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS ENV

Set to `1` to treat a failed fast mode availability check as available, for networks that block the check's direct request to `api.anthropic.com`.

官方文件
CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK ENV

Set to `1` to skip the client-side fast mode availability check, for proxies that intercept the check's request rather than refuse it.

官方文件
CLAUDE_CODE_SKIP_FOUNDRY_AUTH ENV

Skip Azure authentication for Microsoft Foundry, for a proxy or gateway that injects its own `Authorization` header.

條件式
CLAUDE_CODE_SKIP_MANTLE_AUTH ENV

Skip AWS authentication for Amazon Bedrock Mantle (for example, when using an LLM gateway)

條件式
CLAUDE_CODE_SKIP_MODEL_ACCESS_MEMORY ENV

The startup model checks on Amazon Bedrock and Google Cloud's Agent Platform remember on this machine which models they found your account can't invoke, for up to a day.

官方文件
CLAUDE_CODE_SKIP_PROMPT_HISTORY ENV

Set to `1` to skip writing prompt history and session transcripts to disk.

官方文件
CLAUDE_CODE_SKIP_VERTEX_AUTH ENV

Skip Google authentication for Google Cloud's Agent Platform (for example, when using an LLM gateway)

條件式
CLAUDE_CODE_STARTUP_FAILURE_RESULTS ENV

Set to `1` to have a session started with `--output-format stream-json` write a result message naming why Claude Code refused to start for startup failures that otherwise end with stderr alone.

官方文件
CLAUDE_CODE_STOP_HOOK_BLOCK_CAP ENV

Maximum number of consecutive times a Stop or SubagentStop hook may block the turn from ending before Claude Code overrides it and ends the turn anyway (default: 8).

官方文件
CLAUDE_CODE_SUBAGENT_MODEL ENV

The default model for subagents, agent team teammates, and workflow agents that aren't assigned a model another way.

官方文件
CLAUDE_CODE_SUBAGENT_MODEL_FORCE ENV

Set to `1` to force one model onto subagents, teammates, and workflow agents.

官方文件
CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL ENV

Set `5m` or `1h`, the only values Claude Code accepts, to choose the prompt cache TTL for requests outside the main conversation, such as subagents, workflows, and background work.

官方文件
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB ENV

Set to `1` to strip credentials from the environments of the subprocesses Claude Code starts, such as Bash commands, hooks, and stdio MCP servers.

官方文件
CLAUDE_CODE_SYNC_PLUGIN_INSTALL ENV

Set to `1` in non-interactive mode (the `-p` flag) to wait for plugin installation to complete before the first query.

官方文件
CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS ENV

Timeout in milliseconds for synchronous plugin installation.

官方文件
CLAUDE_CODE_SYNC_SKILLS ENV

Set to `1` in non-interactive mode with the `-p` flag to make Claude Code download the skills enabled for your claude.ai account in that run and wait for the list of them, up to…

官方文件
CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS ENV

Timeout in milliseconds for the skills resync that runs mid-session when an app built on the Agent SDK reloads skills (default: 30000).

官方文件
CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS ENV

Timeout in milliseconds for the first query to wait for the initial skill list when `CLAUDE_CODE_SYNC_SKILLS` is set (default: 5000).

官方文件
CLAUDE_CODE_SYNTAX_HIGHLIGHT ENV

Set to `false` to disable syntax highlighting in diff output.

官方文件
CLAUDE_CODE_TASK_LIST_ID ENV

Share a task list across sessions.

官方文件
CLAUDE_CODE_TMPDIR ENV

Override the temp directory used for internal temp files.

官方文件
CLAUDE_CODE_TMUX_TRUECOLOR ENV

Set to any non-empty value, such as `1`, to allow 24-bit truecolor output inside tmux.

條件式
CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDE ENV

On Linux and WSL, set to a comma-separated list of the kinds of processes Claude Code excludes from the tool memory cap, such as `mcp` or `lsp`.

官方文件
CLAUDE_CODE_TOOL_MEMORY_LIMIT ENV

On Linux and WSL, set to a size such as `4G` to cap the memory that Bash and PowerShell tool commands can use, and Monitor tool commands on v2.1.246 or later.

官方文件
CLAUDE_CODE_TRANSCRIPT_LOCAL_GC ENV

Set to `1` to limit how large the transcript file of a long `-p` or Agent SDK session grows.

官方文件
CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS ENV

Deadline in milliseconds before Claude Code cancels a dialog it forwards to a remote client such as a Remote Control or SDK host, or the approval dialog for a held cross-session message; permission prompts and…

官方文件
CLAUDE_CODE_USE_ANTHROPIC_AWS ENV

Use Claude Platform on AWS

條件式
CLAUDE_CODE_USE_BEDROCK ENV

Use Amazon Bedrock

條件式
CLAUDE_CODE_USE_FOUNDRY ENV

Use Microsoft Foundry

條件式
CLAUDE_CODE_USE_MANTLE ENV

Use the Amazon Bedrock Mantle endpoint

條件式
CLAUDE_CODE_USE_POWERSHELL_TOOL ENV

Controls the PowerShell tool.

條件式
CLAUDE_CODE_USE_VERTEX ENV

Use Google Cloud's Agent Platform

條件式
CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS ENV

Set to the number of milliseconds WebFetch keeps each fetched URL's response cached.

官方文件
CLAUDE_CODE_WEBFETCH_DEADLINE_MS ENV

Upper bound in milliseconds on how long WebFetch waits for a page to download, including any redirects it follows.

官方文件
CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR ENV

Rate at which a session's WebSearch limit refills, in calls per hour.

官方文件
CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE ENV

When `CLAUDE_AUTO_BACKGROUND_TASKS` is set to `1`, how long Claude Code waits before each reminder to Claude to check on background subagents that are still running.

官方文件
CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS ENV

How many agents a single workflow run executes at once, from `1` to `256`.

官方文件
CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS ENV

Upper bound in milliseconds on how long a workflow agent waits for a same-prefix sibling's first response to begin before sending its own first request.

官方文件
CLAUDE_CODE_YOU_SHOULD_KNOW_DEBUG ENV

Set to `1` to show, above the prompt, a line for each of the last three checks the You should know mod made in this session.

官方文件
CLAUDE_CONFIG_DIR ENV

Override the configuration directory (default: `~/.claude`).

官方文件
CLAUDE_EFFORT ENV

Set automatically in Bash tool subprocesses and hook commands to the effort level in effect when the subprocess starts: `low`, `medium`, `high`, `xhigh`, or `max`.

官方文件
CLAUDE_ENABLE_BYTE_WATCHDOG ENV

Set to `1` to force-enable the byte-level streaming idle watchdog, or set to `0` to force-disable it.

官方文件
CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK ENV

Set to `1` to enable the byte-level streaming idle watchdog on Amazon Bedrock `vnd.amazon.eventstream` responses, which also enables the first-byte deadline on Bedrock streaming requests.

條件式
CLAUDE_ENABLE_STREAM_WATCHDOG ENV

Set to `0` to force-disable the event-level streaming idle watchdog, or set to `1` to force-enable it.

官方文件
CLAUDE_ENV_FILE ENV

Path to a shell script whose contents Claude Code runs before each Bash command in the same shell process, so exports in the file are visible to the command.

官方文件
CLAUDE_JOB_DIR ENV

Set by Claude Code in each background session to that session's `~/.claude/jobs/<id>` directory.

官方文件
CLAUDE_PID ENV

Claude Code sets this to its own process ID in the subprocesses it spawns: Bash and PowerShell tool commands and hook commands.

官方文件
CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX ENV

Prefix for auto-generated Remote Control session names when no explicit name is provided.

條件式
CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS ENV

Deadline in milliseconds for the first response byte of a streaming request, on the connections where the first-byte deadline runs.

官方文件
CLAUDE_STREAM_IDLE_TIMEOUT_MS ENV

Timeout in milliseconds before the event- and byte-level streaming idle watchdogs close a stalled connection.

官方文件
CLAUDE_SUBAGENT_BG_SHELL_MAX_MS ENV

Removed in v2.1.260 and now a no-op.

官方文件
DEBUG ENV

Set to `1` to enable debug mode, equivalent to launching with `--debug`.

官方文件
DISABLE_AUTOUPDATER ENV

Set to `1` to disable automatic background updates.

官方文件
DISABLE_AUTO_COMPACT ENV

Set to `1` to disable automatic compaction when approaching the context limit, along with idle compaction.

官方文件
DISABLE_COMPACT ENV

Set to `1` to disable all compaction: both automatic compaction and the manual `/compact` command

官方文件
DISABLE_COST_WARNINGS ENV

Set to `1` to disable cost warning messages

官方文件
DISABLE_DOCTOR_COMMAND ENV

Set to `1` to hide the `/doctor` setup checkup skill and its `/checkup` alias.

官方文件
DISABLE_ERROR_REPORTING ENV

Set to any non-empty value, such as `1`, to opt out of error reporting.

官方文件
DISABLE_EXTRA_USAGE_COMMAND ENV

Set to `1` to hide the `/usage-credits` command that lets users purchase additional usage beyond rate limits

官方文件
DISABLE_FEEDBACK_COMMAND ENV

Set to `1` to disable the `/feedback` command and Claude-drafted feedback.

官方文件
DISABLE_GROWTHBOOK ENV

Set to `1` or `true` to disable GrowthBook feature-flag fetching and use code defaults for every flag.

官方文件
DISABLE_INSTALLATION_CHECKS ENV

Set to `1` to disable installation warnings.

官方文件
DISABLE_INSTALL_GITHUB_APP_COMMAND ENV

Set to `1` to hide the `/install-github-app` command.

官方文件
DISABLE_INTERLEAVED_THINKING ENV

Set to `1` to prevent sending the interleaved-thinking beta header.

官方文件
DISABLE_LOGIN_COMMAND ENV

Set to `1` to hide the `/login` command.

官方文件
DISABLE_LOGOUT_COMMAND ENV

Set to `1` to hide the `/logout` command

官方文件
DISABLE_PROMPT_CACHING ENV

Set to `1` to disable prompt caching for all models (takes precedence over per-model settings)

官方文件
DISABLE_PROMPT_CACHING_FABLE ENV

Set to `1` to disable prompt caching for Fable models

官方文件
DISABLE_PROMPT_CACHING_HAIKU ENV

Set to `1` to disable prompt caching for the default Haiku model, wherever it runs

官方文件
DISABLE_PROMPT_CACHING_OPUS ENV

Set to `1` to disable prompt caching for the default Opus model

官方文件
DISABLE_PROMPT_CACHING_SONNET ENV

Set to `1` to disable prompt caching for the default Sonnet model

官方文件
DISABLE_TELEMETRY ENV

Set to any non-empty value, such as `1`, to opt out of telemetry.

官方文件
DISABLE_UPDATES ENV

Set to `1` to block all updates including manual `claude update` and `claude install`.

官方文件
DISABLE_UPGRADE_COMMAND ENV

Set to `1` to hide the `/upgrade` command

官方文件
DO_NOT_TRACK ENV

Set to `1` to opt out of telemetry, with the same effect as `DISABLE_TELEMETRY`, including on feature-flag fetching.

官方文件
ENABLE_BETA_TRACING_DETAILED ENV

Set to `1`, and set `BETA_TRACING_ENDPOINT` to your OTLP/HTTP collector endpoint, to turn on detailed beta tracing, which adds content-bearing span attributes and the `claude_code.hook` span.

官方文件
ENABLE_CLAUDEAI_MCP_SERVERS ENV

Set to `false` to stop Claude Code from fetching claude.ai MCP servers.

條件式
ENABLE_PROMPT_CACHING_1H ENV

Set to `1` to request a 1-hour prompt cache TTL instead of the default 5 minutes.

官方文件
ENABLE_PROMPT_CACHING_1H_BEDROCK ENV

Deprecated.

條件式
ENABLE_TOOL_SEARCH ENV

Controls MCP tool search.

官方文件
FORCE_AUTOUPDATE_PLUGINS ENV

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

官方文件
FORCE_HYPERLINK ENV

Set to `1` to enable clickable OSC 8 hyperlinks when your terminal supports them but isn't auto-detected, or `0` to disable them.

官方文件
FORCE_PROMPT_CACHING_5M ENV

Set to `1` to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply.

官方文件
HTTP_PROXY ENV

Specify HTTP proxy server for network connections

官方文件
HTTPS_PROXY ENV

Specify HTTPS proxy server for network connections

官方文件
IS_DEMO ENV

Set to any non-empty value, such as `1`, to enable demo mode: hides your email and organization name from the header and `/status` output, and skips onboarding.

官方文件
MAX_MCP_OUTPUT_TOKENS ENV

Maximum number of tokens allowed in MCP tool responses (default: 25000).

條件式
MAX_STRUCTURED_OUTPUT_RETRIES ENV

Number of attempts Claude Code allows when the model's response fails validation against the `--json-schema` in non-interactive mode with the `-p` flag; after that many failed attempts with no valid output, the run…

官方文件
MAX_THINKING_TOKENS ENV

Fixed token budget for extended thinking.

官方文件
MCP_CLIENT_SECRET ENV

OAuth client secret for MCP servers that require pre-configured credentials.

條件式 敏感
MCP_CONNECTION_NONBLOCKING ENV

Controls whether startup waits for MCP servers to connect before the first query.

條件式
MCP_CONNECT_TIMEOUT_MS ENV

How long blocking MCP startup waits, in milliseconds, for the connection batch before snapshotting the tool list (default: 5000).

條件式
MCP_DISCOVERY_CACHE ENV

Turns the MCP discovery cache on or off.

條件式
MCP_DISCOVERY_CACHE_MAX_STALE_S ENV

Maximum age, in seconds, of a discovery-cache entry (default: 14400, or 4 hours).

條件式
MCP_DISCOVERY_CACHE_STRIKES ENV

At a start where a discovery-cache entry is older than `MCP_DISCOVERY_CACHE_TTL_S`, Claude Code refreshes it in the background.

條件式
MCP_DISCOVERY_CACHE_TTL_S ENV

Seconds for which Claude Code uses a discovery-cache entry without refreshing it (default: 900).

條件式
MCP_OAUTH_CALLBACK_PORT ENV

Fixed port for the OAuth redirect callback, as an alternative to `--callback-port` when adding an MCP server with pre-configured credentials

條件式
MCP_PROTOCOL_NEGOTIATION ENV

On the v2 MCP client runtime only, whether Claude Code probes servers for MCP protocol revision 2026-07-28.

條件式
MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE ENV

Maximum number of remote MCP servers (HTTP/SSE) to connect in parallel during startup (default: 20)

條件式
MCP_SDK_GENERATION ENV

Pin which MCP client runtime this process connects to MCP servers with: `v1`, built on MCP TypeScript SDK 1.x, or `v2`, built on MCP TypeScript SDK 2.0.

條件式
MCP_SERVER_CONNECTION_BATCH_SIZE ENV

Maximum number of local MCP servers (stdio) to connect in parallel during startup (default: 3)

條件式
MCP_TIMEOUT ENV

Timeout in milliseconds for MCP server startup (default: 30000, or 30 seconds)

條件式
MCP_TOOL_TIMEOUT ENV

Timeout in milliseconds for MCP tool execution (default: 100000000, about 28 hours).

條件式
NO_PROXY ENV

List of domains and IPs to which requests will be directly issued, bypassing proxy

官方文件
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT ENV

Standard OpenTelemetry SDK limit on attribute value length.

官方文件
OTEL_LOG_ASSISTANT_RESPONSES ENV

Set to `1` to include the model's response text on `assistant_response` OpenTelemetry log events.

官方文件
OTEL_LOG_MANAGED_SETTINGS ENV

Set to `1` to add the redacted managed settings, and a SHA-256 digest of the settings before redaction, to `managed_settings_resolved` OpenTelemetry log events.

官方文件
OTEL_LOG_RAW_API_BODIES ENV

Emit Anthropic Messages API request and response JSON as `api_request_body` / `api_response_body` log events.

官方文件
OTEL_LOG_TOOL_CONTENT ENV

Set to `1` to include tool content in the `tool.output` OpenTelemetry span event.

官方文件
OTEL_LOG_TOOL_DETAILS ENV

Set to `1` to include tool input arguments; MCP server names; user-authored workflow names; raw error strings on tool failures; the refusal `category` on `api_refusal` events; real agent, skill, plugin, and MCP server…

官方文件
OTEL_LOG_USER_PROMPTS ENV

Set to `1` to include user prompt text in OpenTelemetry traces and logs.

官方文件
OTEL_METRICS_INCLUDE_ACCOUNT_UUID ENV

Set to `false` to exclude account UUID from metrics attributes (default: included).

官方文件
OTEL_METRICS_INCLUDE_ENTRYPOINT ENV

Set to `true` to include the session entrypoint in metrics attributes (default: excluded).

官方文件
OTEL_METRICS_INCLUDE_REPOSITORY ENV

Set to `true` to tag OpenTelemetry metrics and events with `vcs.*` attributes identifying the session's repository (default: excluded).

官方文件
OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES ENV

As of v2.1.161, Claude Code attaches `OTEL_RESOURCE_ATTRIBUTES` keys to metric datapoint labels.

官方文件
OTEL_METRICS_INCLUDE_SESSION_ID ENV

Set to `false` to exclude session ID from metrics attributes (default: included).

官方文件
OTEL_METRICS_INCLUDE_VERSION ENV

Set to `true` to include Claude Code version in metrics attributes (default: excluded).

官方文件
SLASH_COMMAND_TOOL_CHAR_BUDGET ENV

Override the character budget for skill metadata shown to the Skill tool.

官方文件
TASK_MAX_OUTPUT_LENGTH ENV

Removed in v2.1.277 and now a no-op, together with the `TaskOutput` tool it sized.

官方文件
USE_BUILTIN_RIPGREP ENV

Set to `0` to use system-installed `rg` instead of `rg` included with Claude Code

官方文件
VERTEX_REGION_CLAUDE_3_5_HAIKU ENV

Override region for Claude 3.5 Haiku when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_3_5_SONNET ENV

Override region for Claude 3.5 Sonnet when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_3_7_SONNET ENV

Override region for Claude 3.7 Sonnet when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_0_OPUS ENV

Override region for Claude Opus 4 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_0_SONNET ENV

Override region for Claude Sonnet 4 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_1_OPUS ENV

Override region for Claude Opus 4.1 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_5_OPUS ENV

Override region for Claude Opus 4.5 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_5_SONNET ENV

Override region for Claude Sonnet 4.5 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_6_OPUS ENV

Override region for Claude Opus 4.6 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_6_SONNET ENV

Override region for Claude Sonnet 4.6 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_7_OPUS ENV

Override region for Claude Opus 4.7 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_4_8_OPUS ENV

Override region for Claude Opus 4.8 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_5_5_OPUS ENV

Override region for Claude Opus 5.5 when using Google Cloud's Agent Platform.

條件式
VERTEX_REGION_CLAUDE_5_5_SONNET ENV

Override region for Claude Sonnet 5.5 when using Google Cloud's Agent Platform.

條件式
VERTEX_REGION_CLAUDE_5_OPUS ENV

Override region for Claude Opus 5 when using Google Cloud's Agent Platform.

條件式
VERTEX_REGION_CLAUDE_5_SONNET ENV

Override region for Claude Sonnet 5 when using Google Cloud's Agent Platform.

條件式
VERTEX_REGION_CLAUDE_FABLE_5 ENV

Override region for Claude Fable 5 when using Google Cloud's Agent Platform.

條件式
VERTEX_REGION_CLAUDE_FABLE_5_1 ENV

Override region for Claude Fable 5.1 when using Google Cloud's Agent Platform.

條件式
VERTEX_REGION_CLAUDE_HAIKU_4_5 ENV

Override region for Claude Haiku 4.5 when using Google Cloud's Agent Platform

條件式
VERTEX_REGION_CLAUDE_HAIKU_5_5 ENV

Override region for Claude Haiku 5.5 when using Google Cloud's Agent Platform.

條件式
05

操作工作流程

PLAYBOOK 01 已由 runtime 確認

Run Claude Code headlessly

Use print mode with bounded turns, structured output, and explicit permissions for scripts and CI.

  1. Start with a bounded text run一般
    claude -p --max-turns 8 "Review the current diff" Print mode writes the final response and exits.
  2. Request machine-readable output一般
    claude -p --output-format json --json-schema '{"type":"object"}' "Summarize the diff" JSON output and a schema make downstream parsing explicit.
  3. Grant only required tools需檢視
    claude -p --allowed-tools "Read" "Grep" "Bash(git diff *)" "Review this change" Narrow permission rules keep automation bounded.

命令 ID: claude

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

PLAYBOOK 02 已由 runtime 確認

Continue or resume a session

Continue the latest conversation, resume a named session, or attach to a background session.

  1. Continue the latest project session一般
    claude --continue Loads the most recent conversation associated with this directory.
  2. Resume a named session一般
    claude --resume auth-refactor Resumes by session ID or user-assigned name.
  3. Attach to a background session一般
    claude attach 7c5dcf5d Connects the current terminal while the session keeps running.

命令 ID: claude · claude.attach

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

PLAYBOOK 03 已由 runtime 確認

Design permission boundaries

Choose a permission mode, add narrow allow rules, and keep bypass mode visibly high risk.

  1. Start in plan mode一般
    claude --permission-mode plan Plan mode supports repository analysis before edits.
  2. Allow specific read-only commands需檢視
    claude --allowed-tools "Read" "Grep" "Bash(git diff *)" Tool-pattern rules are safer than broad shell access.
  3. Troubleshoot customizations safely一般
    claude --safe-mode Safe mode disables project customizations, hooks, plugins, skills, and MCP.

命令 ID: claude

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference · Official Claude Code all-settings reference

PLAYBOOK 04 已由 runtime 確認

Add and authenticate an MCP server

Register a server at the intended scope, inspect it, and run OAuth separately when required.

  1. Add a remote server需檢視
    claude mcp add --transport http sentry https://mcp.sentry.dev/mcp --scope user Choose local, user, or project scope deliberately.
  2. Inspect approval and health一般
    claude mcp get sentry Unapproved project servers remain pending and are not connected.
  3. Authenticate over SSH需檢視
    claude mcp login sentry --no-browser Prints an authorization URL rather than opening a browser.

命令 ID: claude.mcp.add · claude.mcp.get · claude.mcp.login

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

PLAYBOOK 05 已由 runtime 確認

Install plugins and inspect skills and hooks

Add a trusted marketplace, install at a scope, then inspect the loaded skills and hooks in-session.

  1. Add a marketplace需檢視
    claude plugin marketplace add anthropics/claude-plugins-official Marketplace sources determine which plugins are installable.
  2. Install at project scope需檢視
    claude plugin install code-review@claude-plugins-official --scope project Project scope shares plugin policy with the repository.
  3. Inspect runtime components一般
    Use /skills, /hooks, and /plugin inside Claude Code to verify what loaded.

命令 ID: claude.plugin.marketplace.add · claude.plugin.install

來源: Claude Code 2.1.307 recursive local help · Official Claude Code commands reference · Public Claude Code v2.1.307 plugin assets

PLAYBOOK 06 已由 runtime 確認

Launch and monitor agents

Define a session agent, start work in the background, and inspect active sessions as JSON.

  1. Start a named agent in the background需檢視
    claude --background --agent reviewer "Review the current branch" The command returns a session ID for later management.
  2. List active agents一般
    claude agents --json JSON mode supports external monitoring and orchestration.
  3. Read recent output一般
    claude logs 7c5dcf5d Inspect progress without attaching to the session.

命令 ID: claude · claude.agents · claude.logs

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference

06

版本差異

固定版本 runtime、現行官方文件、公開原始碼資產與歷史介面之間的差異。

claude.drift.docs-flags docs-ahead

The official CLI reference documents flags omitted by Claude Code 2.1.307 root help; they remain docs-confirmed or conditional, never runtime-confirmed by inference.

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference
claude.drift.runtime-flags runtime-ahead

Claude Code 2.1.307 root help and the official CLI reference retain distinct release and documentation surfaces; availability is recorded per source rather than inferred.

來源: Claude Code 2.1.307 recursive local help · Official Claude Code CLI reference
claude.drift.public-repository source-ahead

The public repository contains distributable plugin assets but no built-in CLI implementation source for release 2.1.307.

來源: Public Claude Code v2.1.307 plugin assets · @anthropic-ai/claude-code 2.1.307 package metadata
claude.drift.removed-commands removed

/pr-comments and /vim are retained only as historical documentation entries and must not be presented as current universal commands.

來源: Official Claude Code commands reference
07

證據帳本