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 aliasSourceApproximate locationString or symbolMeaning
SdkCredentialEnvcli.jsline ~43, byte 0x264c0ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKENEmbedded SDK credential initialization path.
BedrockProviderEnvcli.jsline ~253, byte 0x1ed452CLAUDE_CODE_USE_BEDROCKProvider classifier branch.
VertexProviderEnvcli.jsline ~253, byte 0x1ed523CLAUDE_CODE_USE_VERTEXVertex provider branch.
MainModelEnvcli.jsline ~253, byte 0x20ed29ANTHROPIC_MODELModel selection environment variable.
SmallFastModelEnvcli.jsline ~253, byte 0x20eb73ANTHROPIC_SMALL_FAST_MODELSmall/fast model override.
DebugLogsDirEnvcli.jsline ~62, byte 0x311eaCLAUDE_CODE_DEBUG_LOGS_DIRDebug-log directory override.
DebugLogLevelEnvcli.jsline ~62, byte 0x31362CLAUDE_CODE_DEBUG_LOG_LEVELDebug-log level override.
EssentialTrafficEnvcli.jsline ~133, byte 0xea146CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICEssential-traffic-only gate.
DisableTelemetryEnvcli.jsline ~133, byte 0xea198DISABLE_TELEMETRYTelemetry disable gate.
DoNotTrackEnvcli.jsline ~133, byte 0xea1d1DO_NOT_TRACKTelemetry disable gate.
DisableErrorReportingEnvcli.jsline ~133, byte 0xea692DISABLE_ERROR_REPORTINGError-reporting disable gate.
DisableGrowthBookEnvcli.jsline ~432, byte 0x2fe03eDISABLE_GROWTHBOOKFeature-evaluation kill switch.
McpToolTimeoutEnvcli.jsline ~4980, byte 0x937240MCP_TIMEOUTMCP tool timeout environment variable.
McpConnectTimeoutEnvcli.jsline ~4980, byte 0x9372a0MCP_CONNECT_TIMEOUT_MSMCP connection timeout environment variable.
SessionAccessTokenEnvcli.jsline ~2624, byte 0x6519e7CLAUDE_CODE_SESSION_ACCESS_TOKENRemote/session ingress token source.
WebSocketAuthFdEnvcli.jsline ~2624, byte 0x6516a5CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTORWebSocket auth file-descriptor handoff.
OtelHeadersEnvcli.jsline ~2630, byte 0x654a73OTEL_EXPORTER_OTLP_HEADERSOpenTelemetry exporter env surface.
TraceparentEnvcli.jsline ~2027, byte 0x526c31TRACEPARENTTrace-context propagation.
DisableCronEnvcli.jsline ~1091, byte 0x4806fdCLAUDE_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_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
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.