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

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

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_CONNECTION_NONBLOCKINGRuntime MCP connection non-blocking gate.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_AGENTSBuilt-in agent availability gate.Feature gates reference
CLAUDE_CODE_DISABLE_AGENT_VIEWAgent UI/view gate.Feature gates reference

Feature, context, UI, and update gates

VariableEffectOwner
CLAUDE_CODE_DISABLE_CRONDisables scheduled tasks / Kairos cron paths.Agent runtime, scheduling, and completion
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_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.