This file documents environment variables visible in the checked-in source of this repository snapshot. It is not guaranteed to be exhaustive for the full product, because many imported files are not present here.
For each variable, this document gives:
- the visible purpose in code
- the rough subsystem it belongs to
- whether it appears likely to be hidden from normal user documentation
Documented/public-looking: likely intended for normal users or administratorsAdvanced/likely underdocumented: visible and meaningful, but more operational than mainstreamInternal/hidden: appears intended for Anthropic-internal, testing, bridge/runtime, or diagnostic useUnknown: name is visible, but this snapshot does not show enough behavior to classify confidently
ANTHROPIC_API_KEY— API key auth source; also shows up in auth-status output and managed env handling. Visibility:Documented/public-lookingANTHROPIC_AUTH_TOKEN— auth token source used alongside other provider-managed auth vars. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_OAUTH_TOKEN— OAuth token env source and GitHub Actions secret name. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_OAUTH_REFRESH_TOKEN— lets auth login skip browser flow and exchange a refresh token directly incli/handlers/auth.ts:138. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_OAUTH_SCOPES— required companion toCLAUDE_CODE_OAUTH_REFRESH_TOKEN; scopes are space-separated. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_USE_BEDROCK— switch provider routing to Bedrock. Visibility:Documented/public-lookingCLAUDE_CODE_USE_VERTEX— switch provider routing to Vertex. Visibility:Documented/public-lookingCLAUDE_CODE_USE_FOUNDRY— switch provider routing to Foundry. Visibility:Documented/public-lookingCLAUDE_CODE_SKIP_BEDROCK_AUTH— skip Bedrock auth helper path. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_SKIP_VERTEX_AUTH— skip Vertex auth helper path. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_SKIP_FOUNDRY_AUTH— skip Foundry auth helper path. Visibility:Advanced/likely underdocumentedANTHROPIC_BASE_URL— override first-party API endpoint. Security-sensitive perutils/managedEnvConstants.ts:94. Visibility:Advanced/likely underdocumentedANTHROPIC_BEDROCK_BASE_URL— Bedrock endpoint override. Visibility:Advanced/likely underdocumentedANTHROPIC_VERTEX_BASE_URL— Vertex endpoint override. Visibility:Advanced/likely underdocumentedANTHROPIC_FOUNDRY_BASE_URL— Foundry endpoint override. Visibility:Advanced/likely underdocumentedANTHROPIC_FOUNDRY_RESOURCE— Foundry project/resource selector. Security-sensitive. Visibility:Advanced/likely underdocumentedANTHROPIC_VERTEX_PROJECT_ID— Vertex project selection. Visibility:Advanced/likely underdocumentedAWS_BEARER_TOKEN_BEDROCK— Bedrock auth credential. Visibility:Advanced/likely underdocumentedANTHROPIC_FOUNDRY_API_KEY— Foundry auth credential. Visibility:Advanced/likely underdocumented
ANTHROPIC_MODEL— default model override. Visibility:Documented/public-lookingCLAUDE_CODE_SUBAGENT_MODEL— override model for subagents/worker agents. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_MAX_OUTPUT_TOKENS— maximum output tokens; validated in doctor UI and used in API code. Visibility:Advanced/likely underdocumentedMAX_THINKING_TOKENS— thinking budget control. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_EFFORT_LEVEL— effort setting override used by/effort. Visibility:Advanced/likely underdocumentedMAX_STRUCTURED_OUTPUT_RETRIES— retry limit for structured output recovery inQueryEngine.ts:1011. Visibility:Advanced/likely underdocumented
CLAUDE_CODE_ENABLE_TELEMETRY— explicitly enable telemetry. Visibility:Documented/public-lookingDISABLE_TELEMETRY— disable telemetry. Visibility:Documented/public-lookingDISABLE_ERROR_REPORTING— disable error reporting. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC— reduce nonessential traffic. Visibility:Advanced/likely underdocumentedOTEL_EXPORTER_OTLP_HEADERSand relatedOTEL_*header/protocol/export vars — OpenTelemetry transport/logging tuning; treated as safe but still advanced. Visibility:Advanced/likely underdocumented
ENABLE_TOOL_SEARCH— enables tool search support. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_DISABLE_TERMINAL_TITLE— disable terminal title management. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_IDE_SKIP_AUTO_INSTALL— skip IDE auto-install flow. Visibility:Advanced/likely underdocumentedUSE_BUILTIN_RIPGREP— prefer builtin ripgrep path. Visibility:Advanced/likely underdocumentedBASH_DEFAULT_TIMEOUT_MS,BASH_MAX_TIMEOUT_MS,BASH_MAX_OUTPUT_LENGTH— bash tool limits. Visibility:Advanced/likely underdocumentedMAX_MCP_OUTPUT_TOKENS,MCP_TIMEOUT,MCP_TOOL_TIMEOUT— MCP/tool execution limits. Visibility:Advanced/likely underdocumented
DISABLE_COMPACT— disables/compactincommands/compact/index.ts:9. Visibility:Advanced/likely underdocumentedDISABLE_DOCTOR_COMMAND— disables/doctorincommands/doctor/index.ts:7. Visibility:Advanced/likely underdocumentedDISABLE_EXTRA_USAGE_COMMAND— disables extra-usage command. Visibility:Advanced/likely underdocumentedDISABLE_FEEDBACK_COMMAND— disables feedback UI/command. Visibility:Advanced/likely underdocumentedDISABLE_BUG_COMMAND— disables bug/feedback-related flows. Visibility:Advanced/likely underdocumented
CLAUDE_CODE_REMOTE— marks CCR/remote runtime; used for memory sizing and transport behavior inentrypoints/cli.tsx:9,cli/print.ts:512,cli/transports/WebSocketTransport.ts:771. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_SIMPLE— simplified tool mode; also one of the ablation-forced vars inentrypoints/cli.tsx:22. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_DISABLE_THINKING— disables thinking behavior; referenced in ablation bootstrap. Visibility:Advanced/likely underdocumentedDISABLE_INTERLEAVED_THINKING— related thinking-mode toggle. Visibility:Advanced/likely underdocumentedDISABLE_AUTO_COMPACT— disables auto-compaction. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_DISABLE_AUTO_MEMORY— disables automatic memory behavior. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_DISABLE_BACKGROUND_TASKS— disables background task behavior. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_SESSION_ID— session identifier env propagated to subprocesses incommands/clear/conversation.ts:205. Visibility:Internal/hiddenCLAUDE_CODE_EAGER_FLUSH— forces eager transcript/storage flushing inQueryEngine.ts:457. Visibility:Internal/hiddenCLAUDE_CODE_IS_COWORK— cowork-specific eager flush behavior inQueryEngine.ts:458. Visibility:Internal/hiddenCLAUDE_CODE_RESUME_INTERRUPTED_TURN— resume-related behavior in headless/print flow. Visibility:Advanced/likely underdocumentedENABLE_SESSION_PERSISTENCE— gates session persistence handling in remote/CCR flow. Visibility:Internal/hidden
These mostly appear tied to specialized remote-control, bridge, or environment-runner systems.
CLAUDE_CODE_USE_CCR_V2— switches to CCR v2 transport behavior in multiple transport files. Visibility:Internal/hiddenCLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2— changes session-ingress transport selection. Visibility:Internal/hiddenCLAUDE_CODE_CCR_MIRROR— enables mirror mode in bridge code. Visibility:Internal/hiddenCLAUDE_CODE_WORKER_EPOCH— worker epoch for CCR client state. Visibility:Internal/hiddenCLAUDE_CODE_ENVIRONMENT_KIND— environment runner kind, withbridgeexplicitly checked incli/remoteIO.ts:96. Visibility:Internal/hiddenCLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION— runner version reporting incli/remoteIO.ts:66. Visibility:Internal/hiddenCLAUDE_CODE_SESSION_ACCESS_TOKEN— referenced in bridge comments as a sensitive worker/session token. Visibility:Internal/hiddenCLAUDE_BRIDGE_OAUTH_TOKEN— ant-only bridge auth token inbridge/bridgeConfig.ts:20. Visibility:Internal/hiddenCLAUDE_BRIDGE_BASE_URL— ant-only bridge base URL. Visibility:Internal/hiddenCLAUDE_BRIDGE_USE_CCR_V2— bridge-side override for CCR v2 usage. Visibility:Internal/hiddenCLAUDE_BRIDGE_SESSION_INGRESS_URL— ant-only custom session ingress URL. Visibility:Internal/hidden
CLAUDE_CODE_SYNC_PLUGIN_INSTALL— enables sync plugin install path incli/print.ts:1739and affects setup prefetch behavior. Visibility:Internal/hiddenCLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS— timeout for sync plugin install. Visibility:Internal/hiddenCLAUDE_CODE_ENABLE_PROMPT_SUGGESTION— prompt suggestion toggle in headless/print flow. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_PROACTIVE— enables proactive behavior if proactive module is present. Visibility:Internal/hiddenCLAUDE_CODE_STREAMLINED_OUTPUT— alternate streamlined output mode forstream-json. Visibility:Internal/hiddenCLAUDE_CODE_EXIT_AFTER_FIRST_RENDER— ant-only/debug render exit shortcut. Visibility:Internal/hidden
CLAUDE_CODE_NEW_INIT— opt into new/initbehavior incommands/init.ts:231. Visibility:Advanced/likely underdocumentedCLAUDE_CODE_ABLATION_BASELINE— bootstrap flag that auto-forces a package of simplification toggles inentrypoints/cli.tsx:21. Visibility:Internal/hiddenCLAUDE_CODE_VERIFY_PLAN— env-controlled loading ofVerifyPlanExecutionToolintools.ts:89. Visibility:Internal/hiddenOVERFLOW_TEST_TOOLis a feature flag, not an env var, but it behaves similarly at surface level; noted here to avoid confusion. Visibility: n/a
From utils/swarm/constants.ts and related code:
CLAUDE_CODE_TEAMMATE_COMMAND— override the executable used to spawn teammate instances. Visibility:Internal/hiddenCLAUDE_CODE_AGENT_COLOR— assigns a spawned teammate color. Visibility:Internal/hiddenCLAUDE_CODE_PLAN_MODE_REQUIRED— forces spawned teammates to require plan mode before implementation. Visibility:Internal/hiddenCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS— safe env var related to experimental agent-team support. Visibility:Internal/hidden
CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST— prevents settings-sourced routing vars from overriding a host-managed provider configuration inutils/managedEnvConstants.ts:5. Visibility:Internal/hiddenCLAUDE_CONFIG_DIR— visible in spawn-utils allowlists and likely controls config directory location. Visibility:Advanced/likely underdocumentedCLAUDE_PLUGIN_ROOT,CLAUDE_PLUGIN_DATA— plugin environment paths in plugin integration code. Visibility:Internal/hiddenCLAUDE_CODE_API_KEY_HELPER_TTL_MS— TTL for apiKeyHelper-derived auth. Visibility:Advanced/likely underdocumentedCLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR— bash/project cwd behavior. Visibility:Advanced/likely underdocumented
These are not Claude-specific, but Claude Code reads or sets them.
USER_TYPE— major internal/external surface gate throughout commands, tools, bridge, and debug behavior. Visibility:Internal/hiddenNODE_ENV— used in several code paths to change test behavior. Visibility:Documented/public-lookingNODE_OPTIONS— read for debugger detection and set in remote mode to raise heap size inentrypoints/cli.tsx:11. Visibility:Documented/public-lookingCOREPACK_ENABLE_AUTO_PIN— forcibly set to0at startup to avoid Corepack auto-pinning inentrypoints/cli.tsx:5. Visibility:Internal/hiddenSAFEUSERandUSER— read in commit/PR command logic. Visibility:UnknownIS_DEMO— affects onboarding/setup visibility ininteractiveHelpers.tsx:105and other places. Visibility:Internal/hiddenIS_SANDBOX— used in security checks around bypass-permissions insetup.ts:406. Visibility:Internal/hiddenCLAUBBIT— bypasses trust dialog path ininteractiveHelpers.tsx:131. Visibility:Internal/hidden
utils/managedEnvConstants.ts is especially important because it acts like a security policy file.
The comments explicitly call out endpoint, proxy, and TLS variables as dangerous when set via remote managed settings, including:
ANTHROPIC_BASE_URLANTHROPIC_BEDROCK_BASE_URLANTHROPIC_FOUNDRY_BASE_URLANTHROPIC_VERTEX_BASE_URLHTTP_PROXY,HTTPS_PROXY,NO_PROXYand lowercase formsOTEL_EXPORTER_OTLP_ENDPOINTand related endpoint varsNODE_TLS_REJECT_UNAUTHORIZEDNODE_EXTRA_CA_CERTS- auth and resource selectors like
ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKEN,AWS_BEARER_TOKEN_BEDROCK,ANTHROPIC_FOUNDRY_RESOURCE
These are not all directly consumed in the visible files, but the code explicitly treats them as sensitive to trust boundaries.
Are these hidden from documentation?
Broadly:
ANTHROPIC_API_KEY, provider-selection vars, and a few obvious UX toggles look public or semi-public- many routing, OAuth refresh, model-limit, and tool-tuning vars look real but probably underdocumented
- bridge, CCR, teammate, ablation, verify-plan, worker, and ant-only vars are almost certainly internal/hidden
USER_TYPEis one of the most important hidden variables because it changes the entire product surface
Most interesting hidden variables
If you only care about the most non-obvious ones, these stand out:
USER_TYPECLAUDE_CODE_VERIFY_PLANCLAUDE_CODE_ABLATION_BASELINECLAUDE_CODE_USE_CCR_V2CLAUDE_CODE_SESSION_ACCESS_TOKENCLAUDE_BRIDGE_*CLAUDE_CODE_TEAMMATE_COMMANDCLAUDE_CODE_PLAN_MODE_REQUIREDCLAUDE_CODE_EAGER_FLUSHCLAUDE_CODE_SYNC_PLUGIN_INSTALL