ANTHROPIC_MODELstring- The model Claude Code uses by default.
ANTHROPIC_SMALL_FAST_MODELstring- The cheaper model used for background work such as summarising. Deprecated: set ANTHROPIC_DEFAULT_HAIKU_MODEL instead.
CLAUDE_CODE_SUBAGENT_MODELstring- The model subagents get when they do not name one themselves.
CLAUDE_CODE_WORKFLOW_SUBAGENT_MODELstringdocumented- The model every workflow agent runs on, while other subagents keep theirs. Added in 2.1.296.
ANTHROPIC_DEFAULT_OPUS_MODELstring- Pins which snapshot "opus" means.
ANTHROPIC_DEFAULT_SONNET_MODELstring- Pins which snapshot "sonnet" means.
ANTHROPIC_DEFAULT_HAIKU_MODELstring- Pins which snapshot "haiku" means.
CLAUDE_CODE_EFFORT_LEVELstring- How much thinking to spend by default.
CLAUDE_CODE_USE_BEDROCKstring- Route through AWS Bedrock instead of the Anthropic API.
CLAUDE_CODE_USE_VERTEXstring- Route through Google Vertex AI instead.
ANTHROPIC_BASE_URLstring- Point the API at a different host, such as a gateway your company runs.
ANTHROPIC_DEFAULT_MODELstring- The model new sessions start on. A /model pick still overrides it and is kept across restarts, unlike ANTHROPIC_MODEL.
CLAUDE_CODE_SUBAGENT_MODEL_FORCEstring- Set to 1 to put every subagent, teammate and workflow agent on one model, ignoring per-agent model choices.
ANTHROPIC_AWS_BASE_URLstringdocumented- Override the Claude Platform on AWS endpoint URL. Use for custom regions or when routing through an LLM gateway.
ANTHROPIC_BEDROCK_BASE_URLstringdocumented- Override the Amazon Bedrock endpoint URL. Use for custom Amazon Bedrock endpoints or when routing through an LLM gateway.
ANTHROPIC_BEDROCK_MANTLE_BASE_URLstringdocumented- Override the Amazon Bedrock Mantle endpoint URL. See Mantle endpoint.
ANTHROPIC_BEDROCK_REGION_PREFIXstringdocumented- 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_TIERstringdocumented- Amazon Bedrock service tier (default, flex, or priority). Sent as the X-Amzn-Bedrock-Service-Tier header.
ANTHROPIC_BETASstringdocumented- Comma-separated list of additional anthropic-beta header values to include in API requests.
ANTHROPIC_CUSTOM_MODEL_OPTIONstringdocumented- Model ID to add as a custom entry in the /model picker. Use this to make a non-standard or gateway-specific model selectable without replacing built-in aliases.
ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTIONstringdocumented- Display description for the custom model entry in the /model picker.
ANTHROPIC_CUSTOM_MODEL_OPTION_NAMEstringdocumented- Display name for the custom model entry in the /model picker.
ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIESstringdocumented- Comma-separated list of capabilities the custom model supports, for example effort,thinking.
ANTHROPIC_DEFAULT_FABLE_MODELstringdocumented- 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_DESCRIPTIONstringdocumented- Display description for the pinned Fable model in the /model picker.
ANTHROPIC_DEFAULT_FABLE_MODEL_NAMEstringdocumented- Display name for the pinned Fable model in the /model picker.
ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIESstringdocumented- Comma-separated list of capabilities the pinned Fable model supports, for example effort,thinking.
ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTIONstringdocumented- Display description for the pinned Haiku model in the /model picker.
ANTHROPIC_DEFAULT_HAIKU_MODEL_NAMEstringdocumented- Display name for the pinned Haiku model in the /model picker.
ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIESstringdocumented- Comma-separated list of capabilities the pinned Haiku model supports, for example effort,thinking.
ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTIONstringdocumented- Display description for the pinned Opus model in the /model picker.
ANTHROPIC_DEFAULT_OPUS_MODEL_NAMEstringdocumented- Display name for the pinned Opus model in the /model picker.
ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIESstringdocumented- Comma-separated list of capabilities the pinned Opus model supports, for example effort,thinking.
ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTIONstringdocumented- Display description for the pinned Sonnet model in the /model picker.
ANTHROPIC_DEFAULT_SONNET_MODEL_NAMEstringdocumented- Display name for the pinned Sonnet model in the /model picker.
ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIESstringdocumented- Comma-separated list of capabilities the pinned Sonnet model supports, for example effort,thinking.
ANTHROPIC_FOUNDRY_BASE_URLstringdocumented- Full base URL for the Microsoft Foundry resource (for example, https://my-resource.services.ai.azure.com/anthropic).
ANTHROPIC_FOUNDRY_RESOURCEstringdocumented- Microsoft Foundry resource name (for example, my-resource). Claude Code refuses a URL or host name.
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGIONstringdocumented- Override AWS region for the Haiku-class model when using Amazon Bedrock or Amazon Bedrock Mantle.
ANTHROPIC_VERTEX_BASE_URLstringdocumented- Override Google Cloud's Agent Platform endpoint URL. Use for custom Google Cloud's Agent Platform endpoints or when routing through an LLM gateway.
ANTHROPIC_VERTEX_PROJECT_IDstringdocumented- GCP project ID that Google Cloud's Agent Platform requests are addressed to.
CLAUDE_CODE_ALWAYS_ENABLE_EFFORTstringdocumented- 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_DISABLE_1M_CONTEXTstringdocumented- Set to 1 to disable 1M context window support. When set, 1M model variants are unavailable in the model picker, and Claude Code holds sessions on models with a native 1M window, such as Sonnet 5.5 and the Fable models, to a 200K window; see Extended context for how the hold is enforced.
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGstringdocumented- 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_TOOLstringdocumented- Set to 1 to disable the advisor tool. The /advisor command becomes unavailable, any configured advisorModel is ignored, and the --advisor flag is accepted but has no effect, so existing scripts that pass it continue to work without errors.
CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULTstringdocumented- 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_GUARDstringdocumented- Set to 1 to skip the check that an Amazon Bedrock streaming response carries the application/vnd.amazon.eventstream content-type.
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASstringdocumented- 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_FAST_MODEstringdocumented- Set to 1 to disable fast mode.
CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAPstringdocumented- Set to 1 to prevent automatic remapping of Opus 4.0 and 4.1 to the current Opus version on the Anthropic API.
CLAUDE_CODE_DISABLE_MODEL_ACCESS_FALLBACKstringdocumented- 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 instead.
CLAUDE_CODE_DISABLE_THINKINGstringdocumented- Set to 1 to omit the thinking parameter from API requests entirely.
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENTstringdocumented- 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_ENABLE_GATEWAY_MODEL_DISCOVERYstringdocumented- 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_EXTRA_BODYstringdocumented- JSON object to merge into the top level of every API request body.
CLAUDE_CODE_GATEWAY_HINT_HEADERSstringdocumented- 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_MSstringdocumented- Timeout in milliseconds for the gateway model discovery request that CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY turns on (default: 3000).
CLAUDE_CODE_PROMPT_CACHE_TTLstringdocumented- 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_SKIP_FAST_MODE_NETWORK_ERRORSstringdocumented- 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_CHECKstringdocumented- 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_MODEL_ACCESS_MEMORYstringdocumented- 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_SUBAGENT_PROMPT_CACHE_TTLstringdocumented- 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_USE_ANTHROPIC_AWSstringdocumented- Use Claude Platform on AWS.
CLAUDE_CODE_USE_FOUNDRYstringdocumented- Use Microsoft Foundry.
CLAUDE_CODE_USE_MANTLEstringdocumented- Use the Amazon Bedrock Mantle endpoint.
CLAUDE_CODE_WEBFETCH_CACHE_TTL_MSstringdocumented- Set to the number of milliseconds WebFetch keeps each fetched URL's response cached.
CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCKstringdocumented- 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.
DISABLE_PROMPT_CACHING_FABLEstringdocumented- Set to 1 to disable prompt caching for Fable models.
DISABLE_PROMPT_CACHING_HAIKUstringdocumented- Set to 1 to disable prompt caching for the default Haiku model, wherever it runs.
DISABLE_PROMPT_CACHING_OPUSstringdocumented- Set to 1 to disable prompt caching for the default Opus model.
DISABLE_PROMPT_CACHING_SONNETstringdocumented- Set to 1 to disable prompt caching for the default Sonnet model.
ENABLE_PROMPT_CACHING_1Hstringdocumented- Set to 1 to request a 1-hour prompt cache TTL instead of the default 5 minutes.
ENABLE_PROMPT_CACHING_1H_BEDROCKstringdocumented- Deprecated. Use ENABLE_PROMPT_CACHING_1H instead.
FALLBACK_FOR_ALL_PRIMARY_MODELSstringdocumented- Set to any non-empty value, such as 1, to make Claude Code stop retrying on repeated overload errors for every model when no fallback model is configured.
FORCE_PROMPT_CACHING_5Mstringdocumented- Set to 1 to force the 5-minute prompt cache TTL even when 1-hour TTL would otherwise apply.
MAX_THINKING_TOKENSstringdocumented- Fixed token budget for extended thinking. Claude Code caps it at one token below the request's max output tokens and never below 1,024.
VERTEX_REGION_CLAUDE_3_5_HAIKUstringdocumented- Override region for Claude 3.5 Haiku when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_3_5_SONNETstringdocumented- Override region for Claude 3.5 Sonnet when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_3_7_SONNETstringdocumented- Override region for Claude 3.7 Sonnet when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_0_OPUSstringdocumented- Override region for Claude 4.0 Opus when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_0_SONNETstringdocumented- Override region for Claude 4.0 Sonnet when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_1_OPUSstringdocumented- Override region for Claude 4.1 Opus when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_5_OPUSstringdocumented- Override region for Claude Opus 4.5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_5_SONNETstringdocumented- Override region for Claude Sonnet 4.5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_6_OPUSstringdocumented- Override region for Claude Opus 4.6 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_6_SONNETstringdocumented- Override region for Claude Sonnet 4.6 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_7_OPUSstringdocumented- Override region for Claude Opus 4.7 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_4_8_OPUSstringdocumented- Override region for Claude Opus 4.8 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_5_5_OPUSstringdocumented- Override region for Claude Opus 5.5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_5_5_SONNETstringdocumented- Override region for Claude Sonnet 5.5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_5_OPUSstringdocumented- Override region for Claude Opus 5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_5_SONNETstringdocumented- Override region for Claude Sonnet 5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_FABLE_5stringdocumented- Override region for Claude Fable 5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_FABLE_5_1stringdocumented- Override region for Claude Fable 5.1 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_HAIKU_4_5stringdocumented- Override region for Claude Haiku 4.5 when using Google Cloud's Agent Platform.
VERTEX_REGION_CLAUDE_HAIKU_5_5stringdocumented- Override region for Claude Haiku 5.5 when using Google Cloud's Agent Platform.
ANTHROPIC_API_KEYstring- An API key, when you are not signed in interactively.
ANTHROPIC_AUTH_TOKENstring- A bearer token used instead of an API key.
CLAUDE_CODE_OAUTH_TOKENstring- A token from `claude setup-token`, for headless runs.
ANTHROPIC_CUSTOM_HEADERSstring- Extra headers on every API request, for a proxy that wants one.
CLAUDE_CODE_API_KEY_HELPER_TTL_MSstring- How long a key from apiKeyHelper is reused before the helper runs again.
ANTHROPIC_AWS_API_KEYstringdocumented- Workspace API key for Claude Platform on AWS, generated in the AWS Console.
ANTHROPIC_AWS_WORKSPACE_IDstringdocumented- Required for Claude Platform on AWS. Sent on every request as the anthropic-workspace-id header.
ANTHROPIC_FEDERATION_RULE_IDstringdocumented- Federation rule ID for Workload Identity Federation. When you set it together with ANTHROPIC_ORGANIZATION_ID, Claude Code selects federation credentials, which rank above your /login credential.
ANTHROPIC_FOUNDRY_API_KEYstringdocumented- API key for Microsoft Foundry authentication (see Microsoft Foundry)
ANTHROPIC_FOUNDRY_AUTH_TOKENstringdocumented- Bearer token for Microsoft Foundry authentication, such as a Microsoft Entra access token.
ANTHROPIC_ORGANIZATION_IDstringdocumented- Organization ID for Workload Identity Federation. Set it together with ANTHROPIC_FEDERATION_RULE_ID.
ANTHROPIC_PROFILEstringdocumented- 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_WORKSPACE_IDstringdocumented- Workspace ID for workload identity federation. Set this when your federation rule is scoped to more than one workspace so the token exchange knows which workspace to target.
AWS_BEARER_TOKEN_BEDROCKstringdocumented- Amazon Bedrock API key for authentication (see Amazon Bedrock API keys)
CLAUDE_CODE_OAUTH_REFRESH_TOKENstringdocumented- OAuth refresh token for Claude.ai authentication. When set, claude auth login exchanges this token directly instead of opening a browser.
CLAUDE_CODE_OAUTH_SCOPESstringdocumented- Space-separated OAuth scopes the refresh token was issued with, such as "user:profile user:inference user:sessions:claude_code".
CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTHstringdocumented- Skip client-side authentication for Claude Platform on AWS, for gateways that sign requests themselves.
CLAUDE_CODE_SKIP_AWS_CRED_CACHEstringdocumented- 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_AUTHstringdocumented- Skip AWS authentication for Amazon Bedrock (for example, when using an LLM gateway)
CLAUDE_CODE_SKIP_FOUNDRY_AUTHstringdocumented- Skip Azure authentication for Microsoft Foundry, for a proxy or gateway that injects its own Authorization header.
CLAUDE_CODE_SKIP_MANTLE_AUTHstringdocumented- Skip AWS authentication for Amazon Bedrock Mantle (for example, when using an LLM gateway)
CLAUDE_CODE_SKIP_VERTEX_AUTHstringdocumented- Skip Google authentication for Google Cloud's Agent Platform (for example, when using an LLM gateway)
CLAUDE_CODE_MAX_OUTPUT_TOKENSstring- Ceiling on how much Claude writes in one reply.
CLAUDE_CODE_MAX_CONTEXT_TOKENSstring- Ceiling on the context window, below whatever the model allows.
CLAUDE_CODE_MAX_TURNSstring- Stop a headless run after this many turns.
CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTSstring- How many subagents may run at once.
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSIONstring- Caps web searches, which are billed separately from tokens.
CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOURstringdocumented- How fast the session's web search limit refills, in calls per hour: 100 by default in a terminal session, 0 (no refill) in a non-interactive one.
CLAUDE_CODE_MAX_RETRIESstring- How many times a failed API call is retried.
CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MSstringdocumented- Starting delay in milliseconds, in place of the default 500, of the backoff between retries of a request the API rejects as overloaded (529).
CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MSstringdocumented- Longest delay, in milliseconds, between retries of a request the API rejects as overloaded (529). Added in 2.1.296.
CLAUDE_CODE_AUTO_COMPACT_WINDOWstring- How full the context gets before it is summarised.
CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTSstring- How many agents one workflow run executes at once, 1 to 256 (16 by default, fewer on small machines).
API_FORCE_IDLE_TIMEOUTstringdocumented- Override the 5-minute body idle timeout that aborts a streaming model response when no bytes arrive.
API_TIMEOUT_MSstringdocumented- Timeout for API requests in milliseconds (default: 600000, or 10 minutes; maximum: 2147483647).
CLAUDE_AFK_COUNTDOWN_MSstringdocumented- How many milliseconds before auto-continue the on-screen countdown appears on an unanswered AskUserQuestion dialog.
CLAUDE_AFK_TIMEOUT_MSstringdocumented- How many milliseconds of idle time before an unanswered AskUserQuestion dialog auto-continues without you.
CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MSstringdocumented- Stall timeout in milliseconds for subagents. Default 600000 (10 minutes); if you raise CLAUDE_STREAM_IDLE_TIMEOUT_MS while the stream watchdog is on, the default rises with it, as Handle slow or stalled API responses describes.
CLAUDE_AX_PREPARK_MSstringdocumented- In screen reader mode, how many milliseconds Claude Code waits before it writes a new or changed line.
CLAUDE_AX_STARTUP_QUIET_MSstringdocumented- 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_BYTE_STREAM_IDLE_TIMEOUT_MSstringdocumented- 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_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MSstringdocumented- 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_MAX_SUBAGENT_SPAWN_DEPTHstringdocumented- Number of subagent layers allowed below the main conversation (default: 3).
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYstringdocumented- Maximum number of read-only tools and subagents that can execute in parallel (default: 10).
CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIESstringdocumented- Limit how many times Claude Code re-sends a non-streaming request that times out.
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MSstringdocumented- 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_RESUME_INTERRUPTED_TURN_MAX_AGE_MSstringdocumented- Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume.
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MSstringdocumented- Override the time budget in milliseconds for SessionEnd hooks.
CLAUDE_CODE_STOP_HOOK_BLOCK_CAPstringdocumented- 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_TEAM_TEARDOWN_PARK_TIMEOUT_MSstringdocumented- Override, in milliseconds, how long a non-interactive session waits at exit for its agent team to finish tearing down.
CLAUDE_CODE_TOOL_MEMORY_LIMITstringdocumented- 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_USER_DIALOG_TIMEOUT_MSstringdocumented- 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 AskUserQuestion questions use their own flows and aren't governed by it.
CLAUDE_CODE_WEBFETCH_DEADLINE_MSstringdocumented- Upper bound in milliseconds on how long WebFetch waits for a page to download, including any redirects it follows.
CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MSstringdocumented- 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_STREAM_FIRST_BYTE_TIMEOUT_MSstringdocumented- 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_MSstringdocumented- Timeout in milliseconds before the event- and byte-level streaming idle watchdogs close a stalled connection.
MAX_STRUCTURED_OUTPUT_RETRIESstringdocumented- 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 fails.
SLASH_COMMAND_TOOL_CHAR_BUDGETstringdocumented- Override the character budget for skill metadata shown to the Skill tool.
BASH_DEFAULT_TIMEOUT_MSstring- How long a Bash command may run before it is stopped.
BASH_MAX_TIMEOUT_MSstring- The longest timeout a command is allowed to ask for.
BASH_MAX_OUTPUT_LENGTHstring- How much output from one command reaches the model before it is truncated.
CLAUDE_CODE_SHELLstring- Which shell to run Bash tool calls through.
CLAUDE_CODE_GIT_BASH_PATHstring- Where Git Bash lives, on Windows.
CLAUDE_CODE_USE_POWERSHELL_TOOLstring- Use PowerShell rather than Bash on Windows.
CLAUDE_CODE_GLOB_TIMEOUT_SECONDSstring- How long a file search may take before it gives up.
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENSstring- How much of a file one read may put into context.
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEstringdocumented- Set the percentage (1-100) of the auto-compact window at which auto-compaction triggers.
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIRstringdocumented- Return to the original working directory after each Bash or PowerShell command in the main session.
CLAUDE_CODE_AUTO_CONNECT_IDEstringdocumented- Override automatic IDE connection. By default, Claude Code connects automatically when launched inside a supported IDE's integrated terminal.
CLAUDE_CODE_BASH_EDIT_DIFFstringdocumented- 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_GLOB_HIDDENstringdocumented- Set to false to exclude dotfiles from results when Claude invokes the Glob tool.
CLAUDE_CODE_GLOB_NO_IGNOREstringdocumented- Set to false to make the Glob tool respect .gitignore patterns.
CLAUDE_CODE_HIDE_CWDstringdocumented- Set to 1 to hide the working directory in the startup logo. Useful for screenshares or recordings where the path exposes your OS username.
CLAUDE_CODE_IDE_HOST_OVERRIDEstringdocumented- Override the host address used to connect to the IDE extension.
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALLstringdocumented- Set to 1 to skip auto-installation of IDE extensions. Equivalent to setting autoInstallIdeExtension to false.
CLAUDE_CODE_IDE_SKIP_VALID_CHECKstringdocumented- Set to 1 to skip validation of IDE lockfile entries during connection.
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATEstringdocumented- 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_MODEstringdocumented- Set to 1 to enable Perforce-aware write protection. When set, Edit, Write, and NotebookEdit fail with a p4 edit <file> hint if the target file lacks the owner-write bit, which Perforce clears on synced files until p4 edit opens them.
CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICYstringdocumented- 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_PROCESS_WRAPPERstringdocumented- 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_PROVIDER_MANAGED_BY_HOSTstringdocumented- Set by host platforms that embed Claude Code and manage model provider routing on its behalf.
CLAUDE_CODE_SHELL_PREFIXstringdocumented- 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_TMPDIRstringdocumented- Override the temp directory used for internal temp files. Claude Code appends /claude-{uid}/ to this path on Unix, or /claude/ on Windows.
CLAUDE_CODE_USE_NATIVE_FILE_SEARCHstringdocumented- Set to 1 to discover custom commands, subagents, and output styles using Node.js file APIs instead of ripgrep.
ENABLE_TOOL_SEARCHstringdocumented- Controls MCP tool search. Unset, Claude Code defers all MCP tools by default.
USE_BUILTIN_RIPGREPstringdocumented- Set to 0 to use system-installed rg instead of rg included with Claude Code.
MCP_TIMEOUTstring- How long an MCP server has to start before it is given up on.
MCP_TOOL_TIMEOUTstring- How long one MCP tool call may take.
MCP_CONNECT_TIMEOUT_MSstring- How long to wait for the connection itself.
CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTHstring- Characters of each MCP tool description and server instruction sent to the model (4096 by default since 2.1.296, 2048 before).
CLAUDE_CODE_MCP_STARTUP_WAIT_MSstring- How long the first turn of a non-interactive session waits for MCP servers still connecting; 0 means do not wait.
CLAUDE_AGENT_SDK_MCP_NO_PREFIXstringdocumented- Set to 1 to skip the mcp__<server>__ prefix on tool names from SDK-created MCP servers.
CLAUDE_CODE_MCP_ALLOWLIST_ENVstringdocumented- 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_MSstringdocumented- Elapsed time in milliseconds before a still-running MCP tool call moves to a background task (default: 120000, or 2 minutes).
CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUTstringdocumented- Idle timeout in milliseconds for MCP tool calls. When a stdio, HTTP, SSE, WebSocket, or claude.ai connector MCP server sends no response and no progress notification for this long, the tool call aborts with an error instead of waiting for the overall MCP_TOOL_TIMEOUT.
ENABLE_CLAUDEAI_MCP_SERVERSstringdocumented- Set to false to stop Claude Code from fetching claude.ai MCP servers.
MAX_MCP_OUTPUT_TOKENSstringdocumented- Maximum number of tokens allowed in MCP tool responses (default: 25000).
MCP_CLIENT_SECRETstringdocumented- OAuth client secret for MCP servers that require pre-configured credentials.
MCP_CONNECTION_NONBLOCKINGstringdocumented- Controls whether startup waits for MCP servers to connect before the first query.
MCP_DISCOVERY_CACHEstringdocumented- Turns the MCP discovery cache on or off. With the cache on, a remote HTTP or SSE server you've used before can show the cached status, and Claude Code connects it on its first tool call instead of at startup.
MCP_DISCOVERY_CACHE_MAX_STALE_Sstringdocumented- Maximum age, in seconds, of a discovery-cache entry (default: 14400, or 4 hours).
MCP_DISCOVERY_CACHE_STRIKESstringdocumented- 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_Sstringdocumented- Seconds for which Claude Code uses a discovery-cache entry without refreshing it (default: 900).
MCP_OAUTH_CALLBACK_PORTstringdocumented- Fixed port for the OAuth redirect callback, as an alternative to --callback-port when adding an MCP server with pre-configured credentials.
MCP_PROTOCOL_NEGOTIATIONstringdocumented- On the v2 MCP client runtime only, whether Claude Code probes servers for MCP protocol revision 2026-07-28.
MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZEstringdocumented- Maximum number of remote MCP servers (HTTP/SSE) to connect in parallel during startup (default: 20)
MCP_SDK_GENERATIONstringdocumented- 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_SIZEstringdocumented- Maximum number of local MCP servers (stdio) to connect in parallel during startup (default: 3)
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICstring- Switches off telemetry, error reporting and update checks together. The one to set if you only set one.
DISABLE_TELEMETRYstring- Usage telemetry off.
DISABLE_ERROR_REPORTINGstring- Crash reporting off.
DISABLE_AUTOUPDATERstring- Stops Claude Code updating itself.
DISABLE_COST_WARNINGSstring- Hides the spend warnings.
DISABLE_AUTO_COMPACTstring- Never summarise the conversation automatically. It will run out of context instead.
DISABLE_INTERLEAVED_THINKINGstring- Turns off thinking between tool calls.
DISABLE_PROMPT_CACHINGstring- Turns off prompt caching. This makes everything more expensive, so it is for debugging.
CLAUDE_CODE_DISABLE_CLAUDE_MDSstring- Ignores every CLAUDE.md. Useful for finding out whether one of them is the problem.
CLAUDE_CODE_DISABLE_WEB_FETCHstring- Set to 1 to turn off the WebFetch tool. WebSearch stays available.
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTSstringdocumented- Set to 1 to disable all built-in subagent types such as Explore and Plan.
CLAUDE_CODE_DISABLE_ADMIN_ENV_UNIONstringdocumented- Set to 1 to stop Claude Code from merging managed settings env blocks per key across admin sources, so only the highest-priority source's whole env block applies, as before v2.1.223.
CLAUDE_CODE_DISABLE_AGENT_VIEWstringdocumented- Set to 1 to turn off background agents and agent view: claude agents, --bg, /background, and the on-demand supervisor.
CLAUDE_CODE_DISABLE_ALTERNATE_SCREENstringdocumented- Set to 1 to disable fullscreen rendering and use the classic main-screen renderer.
CLAUDE_CODE_DISABLE_ARTIFACTstringdocumented- Set to 1 to turn off the Artifact tool, which publishes session output as a private web page on claude.ai.
CLAUDE_CODE_DISABLE_ATTACHMENTSstringdocumented- Set to 1 to disable attachment processing. File mentions with @ syntax are sent as plain text instead of being expanded into file content.
CLAUDE_CODE_DISABLE_AUTH_REFRESH_LOCKstringdocumented- 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_MEMORYstringdocumented- Set to 1 to disable auto memory. Set to 0 to force auto memory on even when --bare mode or autoMemoryEnabled: false would otherwise disable it.
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSstringdocumented- 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_BG_EXIT_HANDOFFstringdocumented- Set to 1 to stop a background session's running background shell commands, dynamic workflows, and, as of v2.1.198, background subagents when the supervisor stops, restarts, or updates that session's process, instead of handing them to the session's next process.
CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAPstringdocumented- Set to 1 to stop Claude Code from terminating background shell commands under memory pressure.
CLAUDE_CODE_DISABLE_CFC_PROMPTstringdocumented- 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_CRONstringdocumented- Set to 1 to disable scheduled tasks. The /loop skill and cron tools become unavailable and any already-scheduled tasks stop firing, including tasks that are already running mid-session.
CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUTstringdocumented- Set to 1 to turn off the time limit on critical-path removal prompts.
CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTSstringdocumented- Set to 1 to disable the built-in Explore and Plan subagents.
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYstringdocumented- Set to 1 to disable the "How is Claude doing?" session quality surveys.
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGstringdocumented- Set to 1 to disable file checkpointing. The /rewind command will not be able to restore code changes.
CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONSstringdocumented- 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_PROMPTstringdocumented- 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_MOUSEstringdocumented- Set to 1 to disable mouse tracking in fullscreen rendering. Keyboard scrolling with PgUp and PgDn still works.
CLAUDE_CODE_DISABLE_MOUSE_CLICKSstringdocumented- Set to 1 to disable click, drag, and hover handling in fullscreen rendering while keeping mouse-wheel scrolling.
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACKstringdocumented- Set to 1 to disable the non-streaming fallback when a streaming request fails mid-stream.
CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECKstringdocumented- 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_PERMISSION_PROMPT_NOTIFY_HOOKSstringdocumented- 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 and the VS Code extension host Claude Code.
CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENYstringdocumented- 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_FALLBACKstringdocumented- 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_OUTPUTSstringdocumented- 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_PROMPTstringdocumented- 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_TITLEstringdocumented- Set to 1 to disable automatic terminal title updates based on conversation context.
CLAUDE_CODE_ENABLE_CFCstringdocumented- Set to 1 to start a session with Chrome integration on, or 0 to start with it off. Beats the claudeInChromeDefaultEnabled setting; --chrome and --no-chrome beat both.
CLAUDE_CODE_DISABLE_VIRTUAL_SCROLLstringdocumented- Set to 1 to disable virtual scrolling in fullscreen rendering and render every message in the transcript.
CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHERstringdocumented- Set to 1 to start PowerShell tool commands on Windows directly instead of through the cmd.exe launcher.
CLAUDE_CODE_DISABLE_WORKFLOWSstringdocumented- Set to 1 to disable workflows. Equivalent to the disableWorkflows setting.
CLAUDE_DISABLE_ADOPTstringdocumented- Set to 1 to stop in-flight background work instead of carrying it over when you background a session by pressing the Left arrow key or with /background.
DISABLE_COMPACTstringdocumented- Set to 1 to disable all compaction: both automatic compaction and the manual /compact command.
DISABLE_DOCTOR_COMMANDstringdocumented- Set to 1 to hide the /doctor setup checkup skill and its /checkup alias.
DISABLE_EXTRA_USAGE_COMMANDstringdocumented- Set to 1 to hide the /usage-credits command that lets users purchase additional usage beyond rate limits.
DISABLE_FEEDBACK_COMMANDstringdocumented- Set to 1 to disable the /feedback command and Claude-drafted feedback.
DISABLE_GROWTHBOOKstringdocumented- Set to 1 or true to disable GrowthBook feature-flag fetching and use code defaults for every flag.
DISABLE_INSTALLATION_CHECKSstringdocumented- Set to 1 to disable installation warnings. Use only when manually managing the installation location, as this can mask issues with standard installations.
DISABLE_INSTALL_GITHUB_APP_COMMANDstringdocumented- Set to 1 to hide the /install-github-app command. Already hidden when using third-party providers (Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry)
DISABLE_LOGIN_COMMANDstringdocumented- Set to 1 to hide the /login command. Useful when authentication is handled externally via API keys or apiKeyHelper.
DISABLE_LOGOUT_COMMANDstringdocumented- Set to 1 to hide the /logout command.
DISABLE_UPDATESstringdocumented- Set to 1 to block all updates including manual claude update and claude install.
DISABLE_UPGRADE_COMMANDstringdocumented- Set to 1 to hide the /upgrade command.
CLAUDE_CODE_ENABLE_TELEMETRYstring- The switch. Nothing below is read until this is 1.
OTEL_METRICS_EXPORTERstring- Where metrics go: otlp, prometheus, or console for a look at what is being sent.
OTEL_LOGS_EXPORTERstring- Where events go. The security-interesting half: every tool decision is an event, not a metric.
OTEL_TRACES_EXPORTERstring- Traces, which link a prompt to the API call and the tool calls under it.
OTEL_EXPORTER_OTLP_PROTOCOLstring- grpc, http/protobuf or http/json. Match whatever your collector accepts.
OTEL_EXPORTER_OTLP_ENDPOINTstring- Your collector. One endpoint for everything unless you override per signal.
OTEL_EXPORTER_OTLP_HEADERSstring- Headers for the collector, which is usually where the auth token goes. It is a credential.
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTstring- Metrics to somewhere other than the shared endpoint.
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTstring- Events to somewhere other than the shared endpoint, which is how the SIEM and the usage dashboard get separated.
OTEL_METRIC_EXPORT_INTERVALstring- Milliseconds between metric exports. Shorter means fresher dashboards and more traffic.
OTEL_LOGS_EXPORT_INTERVALstring- Milliseconds between event exports. This is the delay on your detections.
OTEL_SERVICE_NAMEstring- The service name every signal is tagged with.
OTEL_RESOURCE_ATTRIBUTESstring- Extra attributes on everything, which is how you tell teams or environments apart.
BETA_TRACING_ENDPOINTstringdocumented- OTLP/HTTP endpoint for detailed beta tracing: with ENABLE_BETA_TRACING_DETAILED=1, logs and traces go there instead of to the configured exporters.
CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTHstringdocumented- 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. 60 KB).
CLAUDE_CODE_OTEL_DIAG_STDERRstringdocumented- Set to 1 to write OpenTelemetry exporter diagnostic errors to stderr.
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MSstringdocumented- Timeout in milliseconds for flushing pending OpenTelemetry spans (default: 5000).
CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MSstringdocumented- Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes).
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MSstringdocumented- Timeout in milliseconds for the OpenTelemetry exporter to finish on shutdown (default: 2000).
CLAUDE_CODE_PROPAGATE_TRACEPARENTstringdocumented- Set to 1 to propagate W3C trace context when ANTHROPIC_BASE_URL points at a custom proxy.
DO_NOT_TRACKstringdocumented- Set to 1 to opt out of telemetry, with the same effect as DISABLE_TELEMETRY, including on feature-flag fetching.
ENABLE_BETA_TRACING_DETAILEDstringdocumented- 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.
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMITstringdocumented- Standard OpenTelemetry SDK limit on attribute value length. Claude Code caps content-bearing telemetry attributes at the smaller of this and CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH, so the truncation marker stays within the SDK limit.
OTEL_LOG_MANAGED_SETTINGSstringdocumented- 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_METRICS_INCLUDE_ENTRYPOINTstringdocumented- Set to true to include the session entrypoint in metrics attributes (default: excluded).
OTEL_METRICS_INCLUDE_REPOSITORYstringdocumented- Set to true to tag OpenTelemetry metrics and events with vcs.* attributes identifying the session's repository (default: excluded).
OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTESstringdocumented- As of v2.1.161, Claude Code attaches OTEL_RESOURCE_ATTRIBUTES keys to metric datapoint labels.
OTEL_LOG_USER_PROMPTSstring- Records what people typed. Without it the prompt field is literally <REDACTED>. It also turns on assistant-response logging unless you set that one to false yourself, so it captures both halves of the conversation.
OTEL_LOG_ASSISTANT_RESPONSESstring- Records what Claude replied. Defaults to whatever OTEL_LOG_USER_PROMPTS is, so set it to false explicitly if you want prompts and not replies.
OTEL_LOG_TOOL_DETAILSstring- Records which tool ran with which parameters, so a command line reaches your collector.
OTEL_LOG_TOOL_CONTENTstring- Records what tools returned, which includes the contents of files that were read.
OTEL_LOG_RAW_API_BODIESstring- Records whole request and response bodies. The most complete and the most dangerous: it is the entire context window, in your log store, including anything a file put there.
OTEL_METRICS_INCLUDE_SESSION_IDstring- Session id on metrics. On by default.
OTEL_METRICS_INCLUDE_VERSIONstring- Claude Code version on metrics. Off by default.
OTEL_METRICS_INCLUDE_ACCOUNT_UUIDstring- Account uuid on metrics, which is what makes per-person attribution possible. On by default.
CLAUDE_CODE_HTTP_PROXYstring- Proxy for plain HTTP.
CLAUDE_CODE_HTTPS_PROXYstring- Proxy for HTTPS.
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBstring- Keeps named variables out of the environment given to hooks and tools.
CLAUDE_CODE_CERT_STOREstringdocumented- Comma-separated list of CA certificate sources for TLS connections. bundled is the Mozilla CA set shipped with Claude Code. system is the operating system trust store, read only on runtimes with tls.getCACertificates: the native binary, or Node 22.15 or later for npm installs.
CLAUDE_CODE_CLIENT_CERTstringdocumented- Path to client certificate file for mTLS authentication.
CLAUDE_CODE_CLIENT_KEYstringdocumented- Path to client private key file for mTLS authentication.
CLAUDE_CODE_CLIENT_KEY_PASSPHRASEstringdocumented- Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional)
CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTIONstringdocumented- 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_PROXY_RESOLVES_HOSTSstringdocumented- Set to 1 to allow the proxy to perform DNS resolution instead of the caller.
HTTPS_PROXYstringdocumented- Specify HTTPS proxy server for network connections.
HTTP_PROXYstringdocumented- Specify HTTP proxy server for network connections.
NO_PROXYstringdocumented- List of domains and IPs to which requests will be directly issued, bypassing proxy.
CCR_FORCE_BUNDLEstringdocumented- Set to 1 to force claude --cloud to bundle and upload your local repository instead of cloning from its remote.
CLAUDE_AUTO_BACKGROUND_TASKSstringdocumented- Set to 1 to force-enable automatic backgrounding of long-running agent tasks.
CLAUDE_CLIENT_PRESENCE_FILEstringdocumented- 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_ADDITIONAL_DIRECTORIES_CLAUDE_MDstringdocumented- Set to 1 to load memory files from directories specified with --add-dir.
CLAUDE_CODE_ARTIFACT_AUTO_OPENstringdocumented- Set to 0 to stop Claude Code from opening the browser automatically when a new artifact is published.
CLAUDE_CODE_ARTIFACT_COMMENTSstringdocumented- Set to 0 to stop Claude reading and replying to comments on an artifact.
CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACTstringdocumented- Set to 0 to stop Claude replying on its own to comments sent to it.
CLAUDE_CODE_ATTRIBUTION_HEADERstringdocumented- 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_MODE_SERVERstringdocumented- Controls whether Claude Code asks the server to review auto mode actions.
CLAUDE_CODE_BG_TASKS_REPORT_RUNNINGstringdocumented- 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_DEBUG_LOGS_DIRstringdocumented- Override the debug log file path. Despite the name, this is a file path, not a directory.
CLAUDE_CODE_DEBUG_LOG_LEVELstringdocumented- Minimum log level written to the debug log file. Values: verbose, debug (default), info, warn, error.
CLAUDE_CODE_EMIT_SESSION_STATE_EVENTSstringdocumented- Set to 1 to add session_state_changed messages, which carry the session's state, to the message stream.
CLAUDE_CODE_ENABLE_AWAY_SUMMARYstringdocumented- Override session recap availability. Set to 0 to force recaps off regardless of the /config toggle.
CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTELstringdocumented- 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_STREAMINGstringdocumented- Controls whether tool call inputs stream from the API as Claude generates them.
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONstringdocumented- Set to false to turn off prompt suggestions, the grayed-out predictions that appear in your prompt input.
CLAUDE_CODE_ENABLE_TASKSstringdocumented- Selects which task-tracking tools Claude Code provides in sessions that have them.
CLAUDE_CODE_ENABLE_TODO_TOOLSstringdocumented- Set to 1 to get the task-tracking tools on every model. Without it, Claude Code provides them by default only on the models listed under Task tool availability.
CLAUDE_CODE_EXIT_AFTER_STOP_DELAYstringdocumented- Time in milliseconds to wait after the query loop becomes idle before automatically exiting.
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSstringdocumented- Set to 1 to enable agent teams. Agent teams are experimental and disabled by default.
CLAUDE_CODE_FORCE_SESSION_PERSISTENCEstringdocumented- 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_FORK_SUBAGENTstringdocumented- Controls fork mode, which lets Claude spawn forked subagents itself and is on by default in interactive sessions only.
CLAUDE_CODE_FORWARD_SUBAGENT_TEXTstringdocumented- 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_GOAL_CHECKIN_MINUTESstringdocumented- How many minutes background work can keep an active goal waiting before Claude Code asks Claude to check on it.
CLAUDE_CODE_GZIP_REQUEST_BODIESstringdocumented- Set to 0 to turn off gzip compression of Claude API, telemetry, and artifact publish request bodies sent to api.anthropic.com.
CLAUDE_CODE_NEW_INITstringdocumented- Set to 1 to make /init run an interactive setup flow. The flow asks which files to generate, including CLAUDE.md, skills, and hooks, before exploring the codebase and writing them.
CLAUDE_CODE_PROJECT_DIR_NAMEstringdocumented- 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_RESTRICTEDstringdocumented- Set to 1 to start the session in restricted mode, the same as passing --restricted.
CLAUDE_CODE_RESUME_INTERRUPTED_TURNstringdocumented- Set to 1 to automatically resume if the previous session ended mid-turn.
CLAUDE_CODE_RESUME_PROMPTstringdocumented- 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_WATCHDOGstringdocumented- Set to 1 for unattended sessions such as eval harnesses, CI jobs, or remote workers.
CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MSstringdocumented- Longest time, in milliseconds, each request spends waiting out 429 and 529 errors when CLAUDE_CODE_RETRY_WATCHDOG is set.
CLAUDE_CODE_SAFE_MODEstringdocumented- 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 servers, and auto memory do not load, for troubleshooting a broken configuration.
CLAUDE_CODE_SCRIPT_CAPSstringdocumented- JSON object limiting how many times specific scripts may be invoked per session when CLAUDE_CODE_SUBPROCESS_ENV_SCRUB is set.
CLAUDE_CODE_SEND_FEEDBACKstringdocumented- Set to 0 to turn off Claude-drafted feedback for a session. Set to 1 to turn it on where your account already has access; the variable can't grant access itself, and the other switches that turn feedback off, such as DISABLE_FEEDBACK_COMMAND and the feedbackDrafts setting's off value, still apply.
CLAUDE_CODE_SIMPLEstringdocumented- Set to 1 to run with a minimal system prompt and only the Bash, file read, and file edit tools.
CLAUDE_CODE_SIMPLE_SYSTEM_PROMPTstringdocumented- Set to 1 to use a shorter system prompt and abbreviated tool descriptions on any model.
CLAUDE_CODE_SKIP_PROMPT_HISTORYstringdocumented- Set to 1 to skip writing prompt history and session transcripts to disk.
CLAUDE_CODE_STARTUP_FAILURE_RESULTSstringdocumented- 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_TASK_LIST_IDstringdocumented- Share a task list across sessions. Set the same ID in multiple Claude Code instances to coordinate on a shared task list, in sessions that have the Task tools.
CLAUDE_CODE_TOOL_MEMORY_CGROUP_EXCLUDEstringdocumented- 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_TRANSCRIPT_LOCAL_GCstringdocumented- Set to 1 to limit how large the transcript file of a long -p or Agent SDK session grows.
CLAUDE_CODE_WORKER_CHECKIN_SCHEDULEstringdocumented- 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_CONFIG_DIRstringdocumented- Override the configuration directory (default: ~/.claude). All settings, session history, and plugins are stored under this path.
CLAUDE_ENABLE_BYTE_WATCHDOGstringdocumented- Set to 1 to force-enable the byte-level streaming idle watchdog, or set to 0 to force-disable it. 0 also turns off the first-byte deadline on the connections where that deadline runs.
CLAUDE_ENABLE_STREAM_WATCHDOGstringdocumented- Set to 0 to force-disable the event-level streaming idle watchdog, or set to 1 to force-enable it.
CLAUDE_ENV_FILEstringdocumented- 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_REMOTE_CONTROL_SESSION_NAME_PREFIXstringdocumented- Prefix for auto-generated Remote Control session names when no explicit name is provided.
DEBUGstringdocumented- Set to 1 to enable debug mode, equivalent to launching with --debug.
CLAUDE_AX_SCREEN_READERstringdocumented- Set to 1 to render screen-reader friendly output: flat text without decorative borders or animations.
CLAUDE_CODE_ACCESSIBILITYstringdocumented- Set to 1 to keep the native terminal cursor visible and disable the inverted-text cursor indicator.
CLAUDE_CODE_ALT_SCREEN_FULL_REPAINTstringdocumented- Set to 1 to repaint the entire screen on every frame in fullscreen rendering instead of sending incremental updates.
CLAUDE_CODE_BS_AS_CTRL_BACKSPACEstringdocumented- 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_FORCE_STRIKETHROUGHstringdocumented- 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_OUTPUTstringdocumented- Set to 1 to force-enable DEC private mode 2026 synchronized output when your terminal supports it but is not auto-detected.
CLAUDE_CODE_NATIVE_CURSORstringdocumented- Set to 1 to show the terminal's own cursor at the input caret instead of a drawn block.
CLAUDE_CODE_NONBLOCKING_STDOUTstringdocumented- 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 mid-session.
CLAUDE_CODE_NO_FLICKERstringdocumented- Set to 1 to enable fullscreen rendering, a research preview that reduces flicker and keeps memory flat in long conversations.
CLAUDE_CODE_SCROLL_SPEEDstringdocumented- Set the mouse wheel scroll multiplier in fullscreen rendering.
CLAUDE_CODE_SYNTAX_HIGHLIGHTstringdocumented- Set to false to disable syntax highlighting in diff output. Useful when colors interfere with your terminal setup.
CLAUDE_CODE_TMUX_TRUECOLORstringdocumented- Set to any non-empty value, such as 1, to allow 24-bit truecolor output inside tmux.
FORCE_HYPERLINKstringdocumented- Set to 1 to enable clickable OSC 8 hyperlinks when your terminal supports them but isn't auto-detected, or 0 to disable them.
IS_DEMOstringdocumented- 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.
CLAUDE_CODE_DISABLE_BUNDLED_SKILLSstringdocumented- 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. /doctor stays typable like the built-in commands; hide it with DISABLE_DOCTOR_COMMAND instead.
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALLstringdocumented- Set to 1 to disable automatic registration of the official plugin marketplace.
CLAUDE_CODE_DISABLE_POLICY_SKILLSstringdocumented- Set to 1 to skip loading skills from the system-wide managed skills directory.
CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESHstringdocumented- Set to 1 to refresh plugin state at turn boundaries in non-interactive mode after a background install completes.
CLAUDE_CODE_PLUGIN_CACHE_DIRstringdocumented- Override the plugins root directory. Despite the name, this sets the parent directory, not the cache itself: marketplaces and the plugin cache live in subdirectories under this path.
CLAUDE_CODE_PLUGIN_DIRSstringdocumented- Plugin directories to load for the session, each loaded the way a --plugin-dir flag loads it.
CLAUDE_CODE_FORCE_TERMINAL_IMAGESstringdocumented- Set to 1 to draw mod images as pictures in a terminal that supports kitty graphics with Unicode placeholders but is not detected.
CLAUDE_CODE_PLUGIN_DIR_WATCHstringdocumented- Whether a mod loaded with --plugin-dir reloads when its files change: 1 also in non-interactive sessions, 0 never.
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MSstringdocumented- Timeout in milliseconds for cloning or refreshing a plugin marketplace (default: 120000).
CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILUREstringdocumented- 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_HTTPSstringdocumented- Set to 1 to clone GitHub owner/repo shorthand sources over HTTPS instead of SSH.
CLAUDE_CODE_PLUGIN_SEED_DIRstringdocumented- Path to one or more read-only plugin seed directories, separated by : on Unix or ; on Windows.
CLAUDE_CODE_SYNC_PLUGIN_INSTALLstringdocumented- 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_MSstringdocumented- Timeout in milliseconds for synchronous plugin installation.
CLAUDE_CODE_SYNC_SKILLSstringdocumented- 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_WAIT_TIMEOUT_MS, before it runs the first query.
CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MSstringdocumented- 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_MSstringdocumented- Timeout in milliseconds for the first query to wait for the initial skill list when CLAUDE_CODE_SYNC_SKILLS is set (default: 5000).
FORCE_AUTOUPDATE_PLUGINSstringdocumented- Set to 1 to force plugin auto-updates even when the main auto-updater is disabled via DISABLE_AUTOUPDATER.