155 pages for /env.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Track cost and usage
Claude Code CLI · in the page
agent-sdk/cost-tracking
…our TTL on cache writes, set the [`ENABLE_PROMPT_CACHING_1H`](/docs/en/env-vars) environment variable. You can export it in your shell or container environment, or pass it through `options.env`. The…
Connect to external tools with MCP
Claude Code CLI · in the page
agent-sdk/mcp
…a cached tool list | Yes, until it connects | [`MCP_TIMEOUT`](/docs/en/env-vars), 30 seconds by default; the connection fails at that deadline | | Remote server with a cached tool list, saved by Claud…
Modifying system prompts
Claude Code CLI · in the page
agent-sdk/modifying-system-prompts
…orter system prompt; set [`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT`](/docs/en/env-vars#variables) to `0` to select the full prompt on any model. Keep them when your agent is still doing software engineering…
Observability with OpenTelemetry
Claude Code CLI · in the page
agent-sdk/observability
…rface exporter errors, set [`CLAUDE_CODE_OTEL_DIAG_STDERR=1`](/docs/en/env-vars) alongside the exporter variables and read the diagnostics through the SDK's `stderr` callback (Python) or `stderr` opti…
Plugins in the SDK
Claude Code CLI · in the page
agent-sdk/plugins
…().catch(console.error); ``` ```python Python theme={null} #!/usr/bin/env python3 """Example demonstrating how to use plugins with the Agent SDK.""" import asyncio from pathlib import Path from cla…
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…he inherited process environment. See [Environment variables](/docs/en/env-vars) for variables the underlying CLI reads, and [Handle slow or stalled API responses](#handle-slow-or-stalled-api-response…
Work with sessions
Claude Code CLI · in the page
agent-sdk/sessions
…the call. In Python, set [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/docs/en/env-vars) in the `env` option to suppress transcript writes instead. | ### Continue, resume, and fork Continue, resume, and for…
Subagents in the SDK
Claude Code CLI · in the page
agent-sdk/subagents
…ur own. Setting [`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1`](/docs/en/env-vars) removes that default, and such a call fails with [`subagent_type is required`](/docs/en/errors#subagent-type-is-require…
Scale to many tools with tool search
Claude Code CLI · in the page
agent-sdk/tool-search
…y turn. | Setting [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](/docs/en/env-vars) keeps tool search off. You can't override it by setting `ENABLE_TOOL_SEARCH` yourself. On Claude Code v2.1.227 or later…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…de applies it to this server in place of [`MCP_TOOL_TIMEOUT`](/docs/en/env-vars). Pass a whole number of at least 1000. Claude Code ignores other values. Requires TypeScript Agent SDK v0.3.248 or late…
Manage multiple agents with agent view
Claude Code CLI · in the page
agent-view
…port, for example over SSH or tmux. Set [`FORCE_HYPERLINK=0`](/docs/en/env-vars) to render the label as plain text. * After you send a follow-up to the session, Claude Code keeps the label while the r…
Claude Code on Amazon Bedrock
Claude Code CLI · in the page
amazon-bedrock
…`$CLAUDE_CONFIG_DIR/settings.json` when [`CLAUDE_CONFIG_DIR`](/docs/en/env-vars#variables) is set. ## Set up manually To configure Amazon Bedrock through environment variables instead of the wizard,…
Share session output as artifacts
Claude Code CLI · in the page
artifacts
…e can read these artifacts only while [feature-flag fetching](/docs/en/env-vars#features-that-need-feature-flag-fetching) is on. * **Unconfirmed owner or network setting**: when Claude Code can't conf…
Authentication
Claude Code CLI · in the page
authentication
…ctory. When you start `claude`, set the [`CLAUDE_CONFIG_DIR`](/docs/en/env-vars#variables) environment variable to the directory for the account you want to use. Each directory has its own settings, s…
Configure auto mode
Claude Code CLI · in the page
auto-mode-config
…, see the [setups where later sessions also start without it](/docs/en/env-vars#first-session-after-an-install-or-upgrade). * **Outdated version**: run `claude --version` in your shell. If the version…
Channels reference
Claude Code CLI · in the page
channels-reference
…as a channel event. ```ts title="webhook.ts" theme={null} #!/usr/bin/env bun import { Server } from '@modelcontextprotocol/sdk/server/index.js' import { StdioServerTransport } from '@modelcontextpro…
Use Claude Code with Chrome
Claude Code CLI · in the page
chrome
…ecks-with-bypasspermissions-mode) and [feature-flag fetching](/docs/en/env-vars#features-that-need-feature-flag-fetching) is off, these calls run without a prompt. A `tabs_context_mcp` call also prom…
Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry
Claude Code CLI · in the page
claude-apps-gateway
…gateway sessions. [Features that need feature-flag fetching](/docs/en/env-vars#features-that-need-feature-flag-fetching) lists what that turns off | | Standard prompt caching | Available | The gatewa…
Claude apps gateway deployment and operations
Claude Code CLI · in the page
claude-apps-gateway-deploy
…run of `504` errors, raise [`CLAUDE_STREAM_IDLE_TIMEOUT_MS`](/docs/en/env-vars) in a gateway policy. For example, with a 240-second idle timeout on the proxy, the run is 10 requests, each cut at 240…
Use Claude Code in the cloud
Claude Code CLI · in the page
claude-code-on-the-web
…acity. Cloud sessions set [`CLAUDE_AUTOCOMPACT_PCT_OVERRIDE`](/docs/en/env-vars) themselves, so compaction triggers partway through the [auto-compact window](/docs/en/model-config#set-the-auto-compact…
Explore the .claude directory
Claude Code CLI · in the page
claude-directory
…to `%USERPROFILE%\.claude`. If you set [`CLAUDE_CONFIG_DIR`](/docs/en/env-vars), every `~/.claude` path on this page lives under that directory instead. Most users only edit `CLAUDE.md` and `setting…
Let Claude coordinate ongoing work with Projects
Claude Code CLI · in the page
claude-projects
…ached the cap on agentic turns that [`CLAUDE_CODE_MAX_TURNS`](/docs/en/env-vars) sets. Send another message to continue, or raise or remove that variable where it's set | ## Related resources * [Use…
CLI reference
Claude Code CLI · in the page
cli-reference
…S. Also unavailable when you turn off [feature-flag fetching](/docs/en/env-vars#features-that-need-feature-flag-fetching). Requires Claude Code v2.1.213 or later…
Configure cloud environments
Claude Code CLI · in the page
cloud-environments
…ns, add [`BASH_DEFAULT_TIMEOUT_MS` and `BASH_MAX_TIMEOUT_MS`](/docs/en/env-vars#variables) to its [environment variables](#set-environment-variables). Both take milliseconds. For example, `BASH_DEFAUL…
Code Review
Claude Code CLI · in the page
code-review
…ractively) * You set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](/docs/en/env-vars) to `1`, which also turns off every other background task feature ### Let Claude start the review Claude can start `/c…
Review locally with /code-review
Claude Code CLI · in the page
code-review-local
…nteractively). * Set [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](/docs/en/env-vars) to `1`, which also turns off every other background task feature * Run `/code-review` again while an earlier review is…
Commands
Claude Code CLI · in the page
commands
…ays queued it in a session that doesn't [fetch feature flags](/docs/en/env-vars#features-that-need-feature-flag-fetching), such as on a [third-party provider](/docs/en/third-party-integrations). Works…
Common workflows
Claude Code CLI · in the page
common-workflows
…directory listings, set [`CLAUDE_CODE_DISABLE_FILE_MENTIONS`](/docs/en/env-vars#variables) to `1` in your shell or in the [`env` block](/docs/en/env-vars#set-variables-in-settings-files) of user setti…
Run Claude Code behind a corporate launcher
Claude Code CLI · in the page
corporate-launcher
…kens for the launcher to `exec`. [`CLAUDE_CODE_SHELL_PREFIX`](/docs/en/env-vars) wraps the shell commands Claude runs on your behalf, such as Bash tool calls, hooks, and the commands that start stdio…
Manage costs effectively
Claude Code CLI · in the page
costs
…t by setting the `MAX_THINKING_TOKENS` [environment variable](/docs/en/env-vars), for example `MAX_THINKING_TOKENS=8000`. Adaptive-reasoning models ignore nonzero budgets, so use effort levels there i…
Message your other Claude Code sessions
Claude Code CLI · in the page
cross-session-messaging
…ks) and Bash commands as the [`CLAUDE_CODE_MESSAGING_SOCKET`](/docs/en/env-vars#variables) environment variable: * In a session that starts with messaging on, Claude Code exports the variable before…
Debug your configuration
Claude Code CLI · in the page
debug-your-config
…also be set by command-line flags or [environment variables](/docs/en/env-vars), which act as another override layer. When a setting doesn't seem to apply, the value you set is usually being overridd…
Desktop application
Claude Code CLI · in the page
desktop
…a variable for every local session, add it to the [`env` key](/docs/en/env-vars#set-variables-in-settings-files) in your `~/.claude/settings.json` file. Claude Code [ignores the value](/docs/en/settin…
Schedule recurring tasks in Claude Code Desktop
Claude Code CLI · in the page
desktop-scheduled-tasks
…at `scheduled-tasks/<task-name>/` under [`CLAUDE_CONFIG_DIR`](/docs/en/env-vars) if you set that variable. To remove that folder, delete it yourself. You can also list, create, edit, and pause tasks…
Development containers
Claude Code CLI · in the page
devcontainer
…t a named volume at `~/.claude` and set [`CLAUDE_CONFIG_DIR`](/docs/en/env-vars) to the same path so Claude Code writes `.claude.json` inside the volume. The following example mounts the volume and se…
Error reference
Claude Code CLI · in the page
errors
…ult | Effect | | :- | :- | :- | | [`CLAUDE_CODE_MAX_RETRIES`](/docs/en/env-vars) | 10 | Number of retry attempts. Capped at 15 as of v2.1.186; as of v2.1.199 `CLAUDE_CODE_RETRY_WATCHDOG` raises the de…
Speed up responses with fast mode
Claude Code CLI · in the page
fast-mode
…CLAUDE_CODE_DISABLE_FAST_MODE=1`. See [Environment variables](/docs/en/env-vars). ### Use fast mode behind proxies and LLM gateways Before offering fast mode, Claude Code checks your organization's…
Fullscreen rendering
Claude Code CLI · in the page
fullscreen
…- | :- | | You set [`CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1`](/docs/en/env-vars) or `CLAUDE_CODE_NO_FLICKER=0` | Classic | | You set `CLAUDE_CODE_NO_FLICKER=1` | Fullscreen | | Claude Code [turned ful…
Run Claude Code through a gateway
Claude Code CLI · in the page
gateways
…ions aren't used or charged. Setting [`ANTHROPIC_AUTH_TOKEN`](/docs/en/env-vars) for a gateway you run, or signing in to a Claude apps gateway with `/login`, turns off subscription login for that sess…
Keep Claude working toward a goal
Claude Code CLI · in the page
goal
…tomatic retries off, set [`CLAUDE_CODE_GOAL_CHECKIN_MINUTES`](/docs/en/env-vars) to `0`, which also turns [check-ins](#background-work-defers-evaluation) off. ### Background work defers evaluation I…
Claude Code on Google Cloud's Agent Platform
Claude Code CLI · in the page
google-vertex-ai
…`$CLAUDE_CONFIG_DIR/settings.json` when [`CLAUDE_CONFIG_DIR`](/docs/en/env-vars#variables) is set. ## Region configuration Claude Code supports Google Cloud's Agent Platform [global](https://cloud.g…
Run Claude Code programmatically
Claude Code CLI · in the page
headless
…e 10-minute cap, set [`CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS`](/docs/en/env-vars), or set it to `0` to wait without one. The run waits for background work such as background commands, subagents and wo…
Hooks reference
Claude Code CLI · in the page
hooks
…de v2.1.199 and later sets [`$CLAUDE_CODE_BRIDGE_SESSION_ID`](/docs/en/env-vars) to the [Remote Control](/docs/en/remote-control) session ID while the local session has an active Remote Control connec…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…verge, raise the cap with [`CLAUDE_CODE_STOP_HOOK_BLOCK_CAP`](/docs/en/env-vars). ### Hook JSON has no effect Your hook prints valid JSON, but the decision doesn't take effect and no error appears i…
Interactive mode
Claude Code CLI · in the page
interactive-mode
…round tasks off with [`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`](/docs/en/env-vars#variables) or by starting in [bare mode](/docs/en/headless#start-faster-with-bare-mode), the command stops at its timeou…
Customize keyboard shortcuts
Claude Code CLI · in the page
keybindings
…on your terminal and the [`CLAUDE_CODE_BS_AS_CTRL_BACKSPACE`](/docs/en/env-vars) environment variable | | Caps Lock | Not delivered to terminal applications | ## Terminal conflicts Some shortcuts ma…
Connect Claude Code to an LLM gateway
Claude Code CLI · in the page
llm-gateway-connect
…a routing key. To send one, set [`ANTHROPIC_CUSTOM_HEADERS`](/docs/en/env-vars) with one `Name: Value` pair per line. The example below adds a routing header named `X-Org-Route`: **Bash or Zsh** ``…
Claude Code gateway compatibility guide
Claude Code CLI · in the page
llm-gateway-protocol
…. To receive them, set [`CLAUDE_CODE_GATEWAY_HINT_HEADERS=1`](/docs/en/env-vars) for your developers, for example in the `env` block of [managed settings](/docs/en/managed-settings) * Any other backen…
Roll out an LLM gateway for your organization
Claude Code CLI · in the page
llm-gateway-rollout
…ts | Sessions that [don't fetch feature flags from Anthropic](/docs/en/env-vars#features-that-need-feature-flag-fetching), such as sessions on a cloud provider or with telemetry turned off, use the fl…
Deploy managed settings
Claude Code CLI · in the page
managed-settings
…reaches. The variable also turns off [feature-flag fetching](/docs/en/env-vars#features-that-need-feature-flag-fetching) for those developers. For Remote Control, see the [Remote Control requirements…