Skip to content

Environment variables reference

This page centralizes environment variables visible in the analyzed runtime and already documented across model, session, tool, MCP, diagnostics, telemetry, and feature-gate pages.

Scope and caveats

  • This is a source-visible environment-variable reference, not a guarantee that every variable is public, stable, or relevant to every launch mode.
  • Some variables are hard gates; others are provider selectors, credentials, trace context, or runtime integration handoffs.
  • Secret-bearing variables are listed for documentation only. Do not print or log their values in diagnostics.

Source anchors

Semantic aliasString or symbolMeaning
SdkCredentialEnvANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKENEmbedded SDK credential initialization path.
BedrockProviderEnvCLAUDE_CODE_USE_BEDROCKProvider classifier branch.
VertexProviderEnvCLAUDE_CODE_USE_VERTEXVertex provider branch.
MainModelEnvANTHROPIC_MODELModel selection environment variable.
SmallFastModelEnvANTHROPIC_SMALL_FAST_MODELSmall/fast model override.
DebugLogsDirEnvCLAUDE_CODE_DEBUG_LOGS_DIRDebug-log directory override.
DebugLogLevelEnvCLAUDE_CODE_DEBUG_LOG_LEVELDebug-log level override.
EssentialTrafficEnvCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICEssential-traffic-only gate.
DisableTelemetryEnvDISABLE_TELEMETRYTelemetry disable gate.
DoNotTrackEnvDO_NOT_TRACKTelemetry disable gate.
DisableErrorReportingEnvDISABLE_ERROR_REPORTINGError-reporting disable gate.
DisableGrowthBookEnvDISABLE_GROWTHBOOKFeature-evaluation kill switch.
McpToolTimeoutEnvMCP_TIMEOUTMCP tool timeout environment variable.
McpConnectTimeoutEnvMCP_CONNECT_TIMEOUT_MSMCP connection timeout environment variable.
McpHardToolTimeoutEnvMCP_TOOL_TIMEOUTHard wall-clock MCP call timeout when no per-server timeout wins.
McpIdleToolTimeoutEnvCLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUTNo-response/no-progress MCP watchdog; zero disables it.
McpRefreshToolEnvCLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLSAdds RefreshMcpTools to the base tool pool.
ObserverAgentsEnvCLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTSRequired process opt-in for observer-agent declarations.
AgentTeamsEnvCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSExplicit process opt-in for Agent Teams; tengu_amber_flint must also allow the feature.
DisableExplorePlanAgentsEnvCLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTSRemoves both built-in Explore and Plan personas.
DisableSdkBuiltInAgentsEnvCLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTSIn noninteractive sessions, removes the entire built-in agent roster.
AutoModeSiblingContextEnvCLAUDE_CODE_AUTO_MODE_SIBLING_CONTEXTOverrides whether auto-mode classification sees earlier tool calls from the same assistant turn.
SessionAccessTokenEnvCLAUDE_CODE_SESSION_ACCESS_TOKENRemote/session ingress token source.
WebSocketAuthFdEnvCLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTORWebSocket auth file-descriptor handoff.
OtelHeadersEnvOTEL_EXPORTER_OTLP_HEADERSOpenTelemetry exporter env surface.
XaaEnableEnvCLAUDE_CODE_ENABLE_XAAEnables MCP cross-app access when server config requests oauth.xaa.
OtelHeadersHelperDebounceEnvCLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MSDebounce interval for settings-provided OTEL header helper execution.
TraceparentEnvTRACEPARENTTrace-context propagation.
DisableCronEnvCLAUDE_CODE_DISABLE_CRONCron/scheduled-task kill switch.
SafeModeEnvCLAUDE_CODE_SAFE_MODEDisables customizations for recovery startup.
ScreenReaderEnvCLAUDE_AX_SCREEN_READERForces screen-reader-friendly flat rendering.
AttachedProjectEnvCLAUDE_PROJECT_UUIDHost-provided ID of the claude.ai Project attached to this session.
DisableArtifactEnvCLAUDE_CODE_DISABLE_ARTIFACTHard-disables the hosted Artifact tool.
DesignOAuthClientEnvCLAUDE_CODE_DESIGN_OAUTH_CLIENT_IDOverrides the registered OAuth client used by /design-login.
SubagentLimitEnvCLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONSession-wide agent spawn budget (default 200).
WebSearchLimitEnvCLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSIONSession-wide WebSearch budget (default 200).
GatewayLogEnvCLAUDE_GATEWAY_LOG_LEVEL, CLAUDE_GATEWAY_ALLOW_LOOPBACKGateway operator logging and security-sensitive loopback override.
PromptHistoryEnvCLAUDE_CODE_SKIP_PROMPT_HISTORYSuppresses interactive prompt-picker history without disabling transcripts.
AutoModeDecisionEnvAUTOMODE_DECISION_LOGExact 1 enables a best-effort local auto-mode JSONL trace.
PluginEvalGateEnvCLAUDE_CODE_WALNUT_SPIREInternal/early-access gate for plugin eval.

Authentication and credential handoff

VariablePurposeOwner
ANTHROPIC_API_KEYAPI-key credential source.Models, providers, and auth
ANTHROPIC_AUTH_TOKENBearer/OAuth-style credential source.Models, providers, and auth
CLAUDE_CODE_OAUTH_TOKENOAuth token input surface.Models, providers, and auth
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOROAuth token via file descriptor.Models, providers, and auth
CLAUDE_CODE_API_KEY_FILE_DESCRIPTORAPI key via file descriptor.Models, providers, and auth
CLAUDE_CODE_ENABLE_XAAEnables the MCP cross-app access OAuth branch when a server config uses oauth.xaa.Models, providers, and auth
MCP_CLIENT_SECRETSecret input used when mcp add --client-secret configures an HTTP/SSE server. Do not log it; successful storage moves it into the credential store rather than normal MCP JSON.MCP, plugins, and hooks
MCP_XAA_IDP_CLIENT_SECRETSecret input for mcp xaa setup --client-secret; stored through the credential store for the shared IdP connection.MCP, plugins, and hooks
CLAUDE_CODE_SESSION_ACCESS_TOKENRemote/session ingress token.Remote control and teleport
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTORWebSocket auth handoff for bridge/session transports.Session API, events, and storage

Provider and model selection

VariableEffectOwner
CLAUDE_CODE_USE_BEDROCKSelects Bedrock provider branch.Models, providers, and auth
CLAUDE_CODE_USE_VERTEXSelects Vertex provider branch.Models, providers, and auth
CLAUDE_CODE_USE_FOUNDRYSelects Foundry provider branch.Models, providers, and auth
CLAUDE_CODE_USE_ANTHROPIC_AWSSelects Anthropic AWS provider branch.Models, providers, and auth
CLAUDE_CODE_USE_MANTLESelects Mantle provider branch.Models, providers, and auth
ANTHROPIC_MODELEnvironment-level main model override.Model selection, calls, usage, quota, and billing
ANTHROPIC_SMALL_FAST_MODELSmall/fast helper model override.Model selection, calls, usage, quota, and billing
AWS_REGION, AWS_DEFAULT_REGIONAWS-region selection surfaces for AWS-like provider paths.Models, providers, and auth
CLOUD_ML_REGIONGoogle/Vertex region surface.Models, providers, and auth
ANTHROPIC_BASE_URLCustom API/base URL surface.Models, providers, and auth

Diagnostics, telemetry, and tracing

VariableEffectOwner
DEBUG, DEBUG_SDKEnables debug behavior in selected paths.Diagnostics and debug logs
CLAUDE_CODE_DEBUG_LOGS_DIROverrides debug log directory.Diagnostics and debug logs
CLAUDE_CODE_DEBUG_LOG_LEVELSets debug log level threshold when recognized.Diagnostics and debug logs
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICSwitches to essential-traffic mode.Telemetry and tracing
DISABLE_TELEMETRYDisables telemetry.Telemetry and tracing
DO_NOT_TRACKDisables telemetry.Telemetry and tracing
DISABLE_ERROR_REPORTINGDisables error reporting.Telemetry and tracing
DISABLE_GROWTHBOOKDisables GrowthBook feature evaluation.Feature gates reference
TRACEPARENT, TRACESTATEW3C trace-context propagation.Telemetry and tracing
BETA_TRACING_ENDPOINTBeta trace/log exporter endpoint base.Telemetry and tracing
OTEL_*OpenTelemetry metrics/logs/traces exporter configuration.Telemetry and tracing
CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MSDebounces otelHeadersHelper command execution.Telemetry and tracing
OTEL_LOG_TOOL_DETAILS, OTEL_LOG_TOOL_CONTENT, OTEL_LOG_USER_PROMPTSControls how much tool/user detail may be logged.Telemetry and tracing
OTEL_LOG_ASSISTANT_RESPONSESControls assistant-response content logs; when unset it follows OTEL_LOG_USER_PROMPTS.Telemetry and tracing
CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTHOverrides the default 60 KB OTel content-attribute truncation limit.Telemetry and tracing
AUTOMODE_DECISION_LOGExact value 1 appends {ts,...callerFields} rows to <cwd>/.automode_decisions.jsonl. The writer has no lock, retry, rotation, or error reporting.Diagnostics and debug logs

MCP, plugins, and agents

VariableEffectOwner
MCP_TIMEOUTMCP tool-call timeout, with a documented default fallback.MCP, plugins, and hooks
MCP_CONNECT_TIMEOUT_MSMCP connection timeout.MCP, plugins, and hooks
MCP_TOOL_TIMEOUTHard wall-clock MCP tool-call limit; per-server timeout at or above one second takes precedence.MCP, plugins, and hooks
CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUTGlobal no-response/no-progress limit, bounded by the hard timeout; 0 disables the idle watchdog.MCP, plugins, and hooks
MCP_CONNECTION_NONBLOCKINGRuntime MCP connection non-blocking gate.MCP, plugins, and hooks
CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLSIncludes RefreshMcpTools; the tool then re-lists only already-connected servers.MCP, plugins, and hooks
CLAUDE_CODE_PLUGIN_PREFER_HTTPSPlugin transport preference gate.Feature gates reference
CLAUDE_CODE_PLUGIN_USE_ZIP_CACHEPlugin zip-cache gate.Feature gates reference
CLAUDE_CODE_SYNC_PLUGIN_INSTALLSynchronous plugin installation behavior.Feature gates reference
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTSWhen true in a noninteractive session, getBuiltInAgents() returns []; interactive CLI sessions do not take this early return.Agents, tasks, and subagents
CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTSRemoves the paired built-in Explore and Plan definitions before the normal roster is returned.Agents, tasks, and subagents
CLAUDE_CODE_DISABLE_AGENT_VIEWAgent UI/view gate.Feature gates reference
CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTSEnables parsing/arming observer declarations; the GrowthBook observer gate must also pass.Observer agents
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSEnables the implicit-team startup/spawn path when tengu_amber_flint is not false. Child teammate processes set this to 1.Agent Teams
CLAUDE_CODE_FORWARD_SUBAGENT_TEXTForwards subagent text/thinking into stream-JSON output with parent linkage.SDK query, session API, and subagent surface
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSIONSets the spawn budget; default 200 and reset by /clear.Agents, tasks, and subagents
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSIONSets the WebSearch call budget; default 200.Tool inventory and schemas
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSChanges/disables the foreground duration before a long MCP call becomes a background task.MCP, plugins, and hooks
CLAUDE_CODE_PROCESS_WRAPPERCorporate launcher prefix for the background supervisor/workers and covered self-spawns.Daemon and background service
CLAUDE_CODE_WALNUT_SPIREInternal/early-access opt-in checked by plugin eval; source presence is not a stable public feature commitment.Plugin lifecycle and configuration

Hosted projects, artifacts, and design

VariableEffectOwner
CLAUDE_PROJECT_UUIDBinds the session to one claude.ai Project; without it the Projects tool is hidden. Usually supplied by the host rather than typed manually.Hosted Projects and knowledge
CLAUDE_CODE_DISABLE_ARTIFACTHard-disables Artifact eligibility before account, policy, preference, or feature gates are evaluated.Artifact publishing and live pages
CLAUDE_CODE_DESIGN_OAUTH_CLIENT_IDSelects the OAuth client used for the separate design credential flow.Claude Design and design-system sync

Enterprise gateway and remote-runner handoffs

This table deliberately labels process-wiring variables. Only the two CLAUDE_GATEWAY_* entries are ordinary gateway-operator controls; the remaining names coordinate a hosted runner and should not be treated as a stable local configuration API.

VariableClassificationEffectOwner
CLAUDE_GATEWAY_LOG_LEVELGateway operatorSelects debug, info, warn, or error stderr output; absent/invalid uses info.Enterprise gateway server
CLAUDE_GATEWAY_ALLOW_LOOPBACKGateway operator, security-sensitiveAllows loopback/unspecified outbound targets normally rejected by gateway SSRF checks. It does not make metadata/link-local targets generally safe.Enterprise gateway server
CLAUDE_CODE_REMOTEHost mode signalActivates remote-runner initialization, including eligible proxy setup.Remote-environment egress and file staging
CCR_AGENT_PROXY_ENABLEDHost-internal gateEnables the remote agent-proxy branch.Remote-environment egress and file staging
AGENT_PROXY_URLSensitive host handoffOverrides the relay base in standalone mode and is immediately removed from process env after read.Remote-environment egress and file staging
AGENT_PROXY_AUTH_TOKENSecret host handoffSupplies relay auth when present and is immediately removed from process env after read. Never capture its value.Remote-environment egress and file staging
CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG, CLAUDE_CODE_AGENT_PROXY_GH_SHIMInternal deployment armsSelect tool-scoped governed Git config and/or the per-session gh shim.Remote-environment egress and file staging
CLAUDE_CODE_DISABLE_WORKING_SYNCInternal kill switchPrevents the eligible remote SDK runner from starting working-file synchronization.Remote-environment egress and file staging
CLAUDE_CODE_ENVIRONMENT_KINDHost runner classificationSuppresses working sync and synced-file staging on specialized runner kinds.Remote-environment egress and file staging
CLAUDE_CODE_WORKER_EPOCHHost protocol fieldIncluded in synchronized-file PUT requests.Remote-environment egress and file staging
CLAUDE_STAGE_FILE_ROOTHost stage-root overrideSelects ordinary stage destination behavior; an explicit value disables the implicit read-only-mount no-op.Remote-environment egress and file staging
CLAUDE_CODE_REMOTE_MEMORY_DIRHost memory-root handoffRemaps user and local Agent-memory roots in hosted environments; project scope remains in the working tree.Persistent scoped Agent memory

Feature, context, UI, and update gates

VariableEffectOwner
CLAUDE_CODE_DISABLE_CRONDisables scheduled tasks / Kairos cron paths.Cron and scheduled tasks
CLAUDE_CODE_SAFE_MODEEnvironment equivalent of --safe-mode; disables user/project customizations but not managed policy.Safe mode and recovery
CLAUDE_CODE_SKIP_PROMPT_HISTORYSkips history.jsonl/paste-history recording for interactive prompts; main session transcript persistence is unaffected.Terminal UI renderer and input lifecycle
CLAUDE_IMPORT_CONVERSATIONSInternal migration gate for hidden import-conversations; not an advertised public command toggle.Session resume and transcripts
CLAUDE_AX_SCREEN_READEROverrides the axScreenReader setting and --ax-screen-reader selection.Accessibility and screen-reader mode
CLAUDE_CODE_DISABLE_MOUSE_CLICKSDisables click/drag/hover while retaining wheel scrolling.Feature gates reference
CLAUDE_CLIENT_PRESENCE_FILEMarker file that suppresses mobile push notifications while the user is present at the machine.Feature gates reference
CLAUDE_ENABLE_STREAM_WATCHDOGEnables/disables the provider stream idle watchdog (enabled by default in this build).Headless streaming and resilience
CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAPDisables memory-pressure reaping of idle background shell commands.Daemon and background service
CLAUDE_CODE_DISABLE_WORKFLOWS, CLAUDE_CODE_WORKFLOWSDisables or explicitly selects workflow availability.Dynamic workflows
CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS, CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENSTunes workflow-size warning thresholds.Dynamic workflows
CLAUDE_CODE_DISABLE_ADVISOR_TOOLAdvisor/permission-adjacent tool gate.Feature gates reference
CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOLExperimental advisor tool gate.Feature gates reference
CLAUDE_CODE_AUTO_MODE_SIBLING_CONTEXTOverrides the tengu_auto_mode_config.sameTurnSiblingContext value; when enabled, auto-mode’s classifier receives earlier tool calls from the same assistant turn.Built-in tools and permissions
CLAUDE_CODE_DISABLE_1M_CONTEXTContext-window feature gate.Feature gates reference
DISABLE_COMPACTContext compaction gate.Feature gates reference
DISABLE_INTERLEAVED_THINKINGInterleaved-thinking gate.Feature gates reference
USE_API_CONTEXT_MANAGEMENTAPI-side context-management gate.Feature gates reference
CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN, CLAUDE_CODE_NO_FLICKER, CLAUDE_CODE_DISABLE_MOUSE, CLAUDE_CODE_FORCE_SYNC_OUTPUT, CLAUDE_CODE_ACCESSIBILITY, CLAUDE_CODE_DISABLE_TERMINAL_TITLETerminal rendering/accessibility gates.Feature gates reference
DISABLE_UPDATES, DISABLE_AUTOUPDATER, FORCE_AUTOUPDATE_PLUGINSNative/plugin updater behavior gates.Updater and doctor

Interpretation rules

  1. Treat credential and token variables as sensitive; never capture values in examples or logs.
  2. Prefer this page for variable names, and the owner pages for call paths and semantics.
  3. Treat CLAUDE_CODE_USE_* provider variables as provider selectors; do not assume multiple provider selectors compose safely.
  4. Treat tengu_* strings as feature/telemetry signals, not user-settable environment variables unless an explicit env var is visible.

Created and maintained by Yingting Huang.