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 alias | Source | Approximate location | String or symbol | Meaning |
|---|---|---|---|---|
| SdkCredentialEnv | cli.js | line ~43, byte 0x264c0 | ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN | Embedded SDK credential initialization path. |
| BedrockProviderEnv | cli.js | line ~253, byte 0x1ed452 | CLAUDE_CODE_USE_BEDROCK | Provider classifier branch. |
| VertexProviderEnv | cli.js | line ~253, byte 0x1ed523 | CLAUDE_CODE_USE_VERTEX | Vertex provider branch. |
| MainModelEnv | cli.js | line ~253, byte 0x20ed29 | ANTHROPIC_MODEL | Model selection environment variable. |
| SmallFastModelEnv | cli.js | line ~253, byte 0x20eb73 | ANTHROPIC_SMALL_FAST_MODEL | Small/fast model override. |
| DebugLogsDirEnv | cli.js | line ~62, byte 0x311ea | CLAUDE_CODE_DEBUG_LOGS_DIR | Debug-log directory override. |
| DebugLogLevelEnv | cli.js | line ~62, byte 0x31362 | CLAUDE_CODE_DEBUG_LOG_LEVEL | Debug-log level override. |
| EssentialTrafficEnv | cli.js | line ~133, byte 0xea146 | CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Essential-traffic-only gate. |
| DisableTelemetryEnv | cli.js | line ~133, byte 0xea198 | DISABLE_TELEMETRY | Telemetry disable gate. |
| DoNotTrackEnv | cli.js | line ~133, byte 0xea1d1 | DO_NOT_TRACK | Telemetry disable gate. |
| DisableErrorReportingEnv | cli.js | line ~133, byte 0xea692 | DISABLE_ERROR_REPORTING | Error-reporting disable gate. |
| DisableGrowthBookEnv | cli.js | line ~432, byte 0x2fe03e | DISABLE_GROWTHBOOK | Feature-evaluation kill switch. |
| McpToolTimeoutEnv | cli.js | line ~4980, byte 0x937240 | MCP_TIMEOUT | MCP tool timeout environment variable. |
| McpConnectTimeoutEnv | cli.js | line ~4980, byte 0x9372a0 | MCP_CONNECT_TIMEOUT_MS | MCP connection timeout environment variable. |
| SessionAccessTokenEnv | cli.js | line ~2624, byte 0x6519e7 | CLAUDE_CODE_SESSION_ACCESS_TOKEN | Remote/session ingress token source. |
| WebSocketAuthFdEnv | cli.js | line ~2624, byte 0x6516a5 | CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR | WebSocket auth file-descriptor handoff. |
| OtelHeadersEnv | cli.js | line ~2630, byte 0x654a73 | OTEL_EXPORTER_OTLP_HEADERS | OpenTelemetry exporter env surface. |
| TraceparentEnv | cli.js | line ~2027, byte 0x526c31 | TRACEPARENT | Trace-context propagation. |
| DisableCronEnv | cli.js | line ~1091, byte 0x4806fd | CLAUDE_CODE_DISABLE_CRON | Cron/scheduled-task kill switch. |
Authentication and credential handoff
| Variable | Purpose | Owner |
|---|---|---|
ANTHROPIC_API_KEY | API-key credential source. | Models, providers, and auth |
ANTHROPIC_AUTH_TOKEN | Bearer/OAuth-style credential source. | Models, providers, and auth |
CLAUDE_CODE_OAUTH_TOKEN | OAuth token input surface. | Models, providers, and auth |
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR | OAuth token via file descriptor. | Models, providers, and auth |
CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR | API key via file descriptor. | Models, providers, and auth |
CLAUDE_CODE_SESSION_ACCESS_TOKEN | Remote/session ingress token. | Remote control and teleport |
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR | WebSocket auth handoff for bridge/session transports. | Session API, events, and storage |
Provider and model selection
| Variable | Effect | Owner |
|---|---|---|
CLAUDE_CODE_USE_BEDROCK | Selects Bedrock provider branch. | Models, providers, and auth |
CLAUDE_CODE_USE_VERTEX | Selects Vertex provider branch. | Models, providers, and auth |
CLAUDE_CODE_USE_FOUNDRY | Selects Foundry provider branch. | Models, providers, and auth |
CLAUDE_CODE_USE_ANTHROPIC_AWS | Selects Anthropic AWS provider branch. | Models, providers, and auth |
CLAUDE_CODE_USE_MANTLE | Selects Mantle provider branch. | Models, providers, and auth |
ANTHROPIC_MODEL | Environment-level main model override. | Model selection, calls, usage, quota, and billing |
ANTHROPIC_SMALL_FAST_MODEL | Small/fast helper model override. | Model selection, calls, usage, quota, and billing |
AWS_REGION, AWS_DEFAULT_REGION | AWS-region selection surfaces for AWS-like provider paths. | Models, providers, and auth |
CLOUD_ML_REGION | Google/Vertex region surface. | Models, providers, and auth |
ANTHROPIC_BASE_URL | Custom API/base URL surface. | Models, providers, and auth |
Diagnostics, telemetry, and tracing
| Variable | Effect | Owner |
|---|---|---|
DEBUG, DEBUG_SDK | Enables debug behavior in selected paths. | Diagnostics and debug logs |
CLAUDE_CODE_DEBUG_LOGS_DIR | Overrides debug log directory. | Diagnostics and debug logs |
CLAUDE_CODE_DEBUG_LOG_LEVEL | Sets debug log level threshold when recognized. | Diagnostics and debug logs |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Switches to essential-traffic mode. | Telemetry and tracing |
DISABLE_TELEMETRY | Disables telemetry. | Telemetry and tracing |
DO_NOT_TRACK | Disables telemetry. | Telemetry and tracing |
DISABLE_ERROR_REPORTING | Disables error reporting. | Telemetry and tracing |
DISABLE_GROWTHBOOK | Disables GrowthBook feature evaluation. | Feature gates reference |
TRACEPARENT, TRACESTATE | W3C trace-context propagation. | Telemetry and tracing |
BETA_TRACING_ENDPOINT | Beta 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_PROMPTS | Controls how much tool/user detail may be logged. | Telemetry and tracing |
MCP, plugins, and agents
| Variable | Effect | Owner |
|---|---|---|
MCP_TIMEOUT | MCP tool-call timeout, with a documented default fallback. | MCP, plugins, and hooks |
MCP_CONNECT_TIMEOUT_MS | MCP connection timeout. | MCP, plugins, and hooks |
MCP_CONNECTION_NONBLOCKING | Runtime MCP connection non-blocking gate. | MCP, plugins, and hooks |
CLAUDE_CODE_PLUGIN_PREFER_HTTPS | Plugin transport preference gate. | Feature gates reference |
CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE | Plugin zip-cache gate. | Feature gates reference |
CLAUDE_CODE_SYNC_PLUGIN_INSTALL | Synchronous plugin installation behavior. | Feature gates reference |
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS | Built-in agent availability gate. | Feature gates reference |
CLAUDE_CODE_DISABLE_AGENT_VIEW | Agent UI/view gate. | Feature gates reference |
Feature, context, UI, and update gates
| Variable | Effect | Owner |
|---|---|---|
CLAUDE_CODE_DISABLE_CRON | Disables scheduled tasks / Kairos cron paths. | Agent runtime, scheduling, and completion |
CLAUDE_CODE_DISABLE_ADVISOR_TOOL | Advisor/permission-adjacent tool gate. | Feature gates reference |
CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL | Experimental advisor tool gate. | Feature gates reference |
CLAUDE_CODE_DISABLE_1M_CONTEXT | Context-window feature gate. | Feature gates reference |
DISABLE_COMPACT | Context compaction gate. | Feature gates reference |
DISABLE_INTERLEAVED_THINKING | Interleaved-thinking gate. | Feature gates reference |
USE_API_CONTEXT_MANAGEMENT | API-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_TITLE | Terminal rendering/accessibility gates. | Feature gates reference |
DISABLE_UPDATES, DISABLE_AUTOUPDATER, FORCE_AUTOUPDATE_PLUGINS | Native/plugin updater behavior gates. | Updater and doctor |
Interpretation rules
- Treat credential and token variables as sensitive; never capture values in examples or logs.
- Prefer this page for variable names, and the owner pages for call paths and semantics.
- Treat
CLAUDE_CODE_USE_*provider variables as provider selectors; do not assume multiple provider selectors compose safely. - Treat
tengu_*strings as feature/telemetry signals, not user-settable environment variables unless an explicit env var is visible.
Related docs
Created and maintained by Yingting Huang.