The Complete List of Claude Code Environment Variables (500+)#

Published on March 17, 2026

Part of the Claude Code Version Tracker series. | Official Env Vars

Claude Code has over 500 environment variables scattered across its binary. Most are undocumented. This is the definitive reference — cross-compiled from our binary extraction series, community research, and the comprehensive gist by unkn0wncode.

Jump to what you need:

Not listed here: CI/CD detection vars (GitHub Actions, GitLab CI, etc.), terminal emulator detection, cloud platform detection, system/runtime vars, Node.js/Bun internals, gRPC config, and Azure Identity vars. These are read-only environment detection — you wouldn't set them yourself. See the full gist for the complete unfiltered list.


API & Authentication#

VariablePurposeDefault
ANTHROPIC_API_KEYPrimary API key for Claude API
ANTHROPIC_AUTH_TOKENAlternative bearer token; takes priority over API key
ANTHROPIC_BASE_URLCustom endpoint for Anthropic servicesapi.anthropic.com
ANTHROPIC_CUSTOM_HEADERSCustom HTTP headers (newline-separated Key: Value)
ANTHROPIC_BETASComma-separated beta feature headers
ANTHROPIC_LOGSDK internal logging level
API_TIMEOUT_MSRequest timeout in milliseconds600000 (10 min)

Tip: If you run Claude Code through a proxy like claude-code-router, set ANTHROPIC_BASE_URL and consider CLAUDE_CODE_ATTRIBUTION_HEADER=0 to prevent the billing header from breaking prompt caching. For a deep dive on this issue — including Bedrock 400 errors and step-by-step fixes — see our CLAUDE_CODE_ATTRIBUTION_HEADER guide.

Model Configuration#

VariablePurposeDefault
ANTHROPIC_MODELOverride the default Claude model
ANTHROPIC_SMALL_FAST_MODELOverride small/fast model for quick operationsHaiku
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGIONAWS region for small fast model on Bedrock
ANTHROPIC_DEFAULT_HAIKU_MODELOverride Haiku model IDhaiku-4.5
ANTHROPIC_DEFAULT_SONNET_MODELOverride Sonnet model IDsonnet-4.6
ANTHROPIC_DEFAULT_OPUS_MODELOverride Opus model IDopus-4.6
CLAUDE_CODE_SUBAGENT_MODELForce a specific model for sub-agent (Task tool) operations
CLAUDE_CODE_MAX_OUTPUT_TOKENSMaximum output tokens for responses; validated per-model
MAX_THINKING_TOKENSMaximum tokens for extended thinking; enables thinking when > 0
CLAUDE_CODE_EFFORT_LEVELReasoning effort: low, medium, highhigh

Tip: CLAUDE_CODE_SUBAGENT_MODEL is useful for cost control — set subagents to use Haiku while keeping the main conversation on Opus/Sonnet.

AWS Bedrock#

VariablePurpose
CLAUDE_CODE_USE_BEDROCKRoute API calls through AWS Bedrock
CLAUDE_CODE_SKIP_BEDROCK_AUTHSkip AWS authentication for Bedrock
BEDROCK_BASE_URLCustom Bedrock API endpoint
ANTHROPIC_BEDROCK_BASE_URLAlternative Bedrock endpoint (alias)
AWS_ACCESS_KEY_IDAWS access key
AWS_SECRET_ACCESS_KEYAWS secret key
AWS_SESSION_TOKENAWS session token for temporary credentials
AWS_REGIONAWS region for Bedrock
AWS_DEFAULT_REGIONFallback AWS region
AWS_PROFILEAWS profile for credential selection
AWS_BEARER_TOKEN_BEDROCKBearer token for Bedrock authentication
AWS_EXECUTION_ENVAWS execution environment identifier (e.g. Lambda)
AWS_LAMBDA_FUNCTION_NAMELambda function name (auto-detected in Lambda)
AWS_LAMBDA_BENCHMARK_MODEEnable Lambda benchmark mode
AWS_LOGIN_CACHE_DIRECTORYCustom directory for AWS login cache
ENABLE_PROMPT_CACHING_1H_BEDROCKEnable 1-hour prompt caching on Bedrock
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMINGEnable fine-grained (eager) input streaming for tools

Fix: Bedrock "eager_input_streaming" 400 Error#

If you use Claude Code with AWS Bedrock and see this error:

API Error: 400 tools.0.custom.eager_input_streaming: Extra inputs are not permitted

This is caused by Claude Code adding eager_input_streaming: true to tool definitions in API requests. Bedrock's Converse API may reject this as an unrecognized parameter, depending on your Bedrock configuration and region.

CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING controls the tool streaming behavior. Try toggling it:

# Option 1: Explicitly enable fine-grained streaming (uses compatible code path)
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING=1 CLAUDE_CODE_USE_BEDROCK=1 claude

# Option 2: Disable it if your Bedrock config rejects the parameter
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING=0 CLAUDE_CODE_USE_BEDROCK=1 claude

# Or add to your shell profile
export CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING=1

Background: This issue first surfaced in Claude Code v2.1.72 (#32765), which started sending eager_input_streaming to Bedrock before the API fully supported it. The feature request originated from #26941, where users reported 10–20 second permission prompt latency on Bedrock — fine-grained streaming reduces this to 1–3 seconds. Anthropic has since made fine-grained tool streaming GA across all platforms including Bedrock, but some configurations may still need this env var toggled.

If toggling this var doesn't help, also check that you're on the latest Claude Code version (v2.1.73+ includes the fix).

Google Vertex AI#

VariablePurpose
CLAUDE_CODE_USE_VERTEXRoute API calls through Vertex AI
CLAUDE_CODE_SKIP_VERTEX_AUTHSkip GCP authentication for Vertex AI
VERTEX_BASE_URLCustom Vertex AI endpoint
ANTHROPIC_VERTEX_PROJECT_IDGoogle Cloud project ID
CLOUD_ML_REGIONGoogle Cloud ML region
GOOGLE_APPLICATION_CREDENTIALSPath to GCP service account JSON
GOOGLE_CLOUD_PROJECTGoogle Cloud project identifier
GOOGLE_CLOUD_QUOTA_PROJECTQuota/billing project
GCLOUD_PROJECTAlternative GCP project identifier

Azure Foundry#

VariablePurpose
CLAUDE_CODE_USE_FOUNDRYRoute API calls through Azure Foundry
CLAUDE_CODE_SKIP_FOUNDRY_AUTHSkip Azure authentication
ANTHROPIC_FOUNDRY_API_KEYFoundry API key
ANTHROPIC_FOUNDRY_BASE_URLCustom Foundry endpoint
ANTHROPIC_FOUNDRY_RESOURCEFoundry resource name

OAuth & Login#

VariablePurpose
CLAUDE_CODE_OAUTH_TOKENPre-configured OAuth access token
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTORFile descriptor for OAuth token
CLAUDE_CODE_OAUTH_REFRESH_TOKENOAuth refresh token
CLAUDE_CODE_OAUTH_SCOPESOAuth scopes for refresh token
CLAUDE_CODE_OAUTH_CLIENT_IDCustom OAuth client ID
CLAUDE_CODE_CUSTOM_OAUTH_URLCustom OAuth server URL
CLAUDE_CODE_API_KEY_FILE_DESCRIPTORFile descriptor for API key
CLAUDE_CODE_API_KEY_HELPER_TTL_MSCache TTL for API key helper
CLAUDE_CODE_SESSION_ACCESS_TOKENSession-scoped access token
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTORFile descriptor for WebSocket auth
USE_LOCAL_OAUTHUse local OAuth server for development
USE_STAGING_OAUTHUse staging OAuth server

Core Configuration#

VariablePurposeDefault
CLAUDE_CONFIG_DIRCustom config directory~/.claude
CLAUDE_CODE_TMPDIRTemp directory for operations/tmp (Unix)
CLAUDE_TMPDIRAlternative temp directory (fallback)
CLAUDE_CODE_SHELLOverride shell for Bash tool (must be bash or zsh)auto-detected
CLAUDE_CODE_SHELL_PREFIXPrefix command for shell execution
CLAUDE_CODE_ENTRYPOINTApplication entrypoint: cli, sdk-ts, sdk-py, vscodeauto-detected
CLAUDE_CODE_SIMPLESimplified mode; disables CLAUDE.md and attachments
CLAUDE_CODE_EXTRA_BODYAdditional JSON merged into API request bodies
CLAUDE_CODE_BASE_REFGit base ref for diff operations
CLAUDE_CODE_TAGSCustom tags for telemetry events
CLAUDE_CODE_CONTAINER_IDContainer/pod identifier
CLAUDE_CODE_ACCOUNT_UUIDPre-configured account UUID
CLAUDE_CODE_USER_EMAILPre-configured user email
CLAUDE_CODE_ORGANIZATION_UUIDOrganization UUID
CLAUDE_CODE_ATTRIBUTION_HEADERControls x-anthropic-billing-header. Set to 0 to disable — fixes prompt caching issues with proxies. See our complete attribution header guide for Bedrock 400 errors and proxy fixesenabled
CLAUDE_CODE_MAX_RETRIESMaximum API request retries
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDEToken limit override for input blocking
CLAUDE_CODE_FORCE_FULL_LOGOForce full ASCII logo on startup
CLAUDE_CODE_STREAMING_TEXTEnable streaming text display
CLAUDE_CODE_SYNTAX_HIGHLIGHTSet to false to disable syntax highlightingenabled
CLAUDE_CODE_ACCESSIBILITYEnable accessibility mode; disables cursor hiding
CLAUDE_CODE_RESUME_INTERRUPTED_TURNAuto-resume an interrupted agent turn
CLAUDE_CODE_HOST_PLATFORMOverride platform detection: win32, darwin, linuxauto-detected
CLAUDE_CODE_ACTIONIndicates running as GitHub Action
CLAUDE_ENV_FILEPath to environment file for session variables
CLAUDE_DEBUGEnable debug logging
CLAUDECODESet to 1 in child shell processes (auto-set)1
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MDAdditional directories to scan for CLAUDE.md files (colon-separated)
CLAUDE_CODE_ADDITIONAL_PROTECTIONEnable additional safety protections
CLAUDE_CODE_SAVE_HOOK_ADDITIONAL_CONTEXTExtra context passed to save hooks
CLAUDE_CODE_API_BASE_URLCustom Claude Code API base URL (distinct from ANTHROPIC_BASE_URL)
CLAUDE_CODE_EAGER_FLUSHEagerly flush output buffers
CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGESInclude partial/streaming messages in output
CLAUDE_CODE_EXIT_AFTER_FIRST_RENDERExit after first UI render (testing)
CLAUDE_CODE_EXIT_AFTER_STOP_DELAYDelay before exit after stop signal (ms)
CLAUDE_CODE_FORCE_GLOBAL_CACHEForce use of global cache directory
CLAUDE_CODE_WORKER_EPOCHWorker epoch for versioning internal state
CLAUDE_CODE_BUBBLEWRAPEnable Bubblewrap sandboxing (Linux)
CLAUDE_REPL_MODERun in REPL (interactive) mode
CLAUDE_FORCE_DISPLAY_SURVEYForce display of feedback survey
CLAUBBITInternal flag for Claubbit integration

Tip: CLAUDE_CODE_EXTRA_BODY is powerful for advanced users — it merges arbitrary JSON into every API request body. Useful for passing provider-specific parameters.

Feature Flags (Enable)#

VariablePurpose
ENABLE_LSP_TOOLEnable Language Server Protocol tool
ENABLE_TOOL_SEARCHTool search/deferred loading: auto, true, false, or 0–100%
ENABLE_SESSION_BACKGROUNDINGEnable session backgrounding
ENABLE_BTWEnable "by the way" suggestions
ENABLE_CLAUDEAI_MCP_SERVERSEnable Claude.ai-hosted MCP servers
ENABLE_MCP_LARGE_OUTPUT_FILESEnable large output files for MCP
ENABLE_CLAUDE_CODE_SM_COMPACTEnable session memory compaction
CLAUDE_CODE_ENABLE_CFCEnable Claude for Chrome browser automation
CLAUDE_CODE_ENABLE_TASKSEnable task list tools
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMINGEnable fine-grained (eager) input streaming — fixes Bedrock 400 errors
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONEnable prompt suggestions. Set to false or 1
CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTINGEnable file checkpointing in SDK mode
CLAUDE_CODE_ENABLE_TELEMETRYEnable telemetry collection
CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENTAttach token usage info to messages
CLAUDE_ENABLE_STREAM_WATCHDOGEnable stream health monitoring
CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIESEmit tool use summary events
FALLBACK_FOR_ALL_PRIMARY_MODELSEnable fallback for all primary models
FORCE_AUTOUPDATE_PLUGINSForce auto-update plugins
ENABLE_BETA_TRACING_DETAILEDEnable detailed beta tracing
ENABLE_ENHANCED_TELEMETRY_BETAEnable enhanced telemetry (beta)
CLAUDE_CODE_ENHANCED_TELEMETRY_BETAEnhanced telemetry beta flag (alias)
RIPGREP_EMBEDDEDUse embedded ripgrep binary
USE_BUILTIN_RIPGREPForce use of built-in ripgrep

Feature Flags (Disable)#

VariableWhat It Disables
CLAUDE_CODE_DISABLE_1M_CONTEXTExtended 1M token context window
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGAdaptive thinking mode
CLAUDE_CODE_DISABLE_ATTACHMENTSFile/image attachments
CLAUDE_CODE_DISABLE_AUTO_MEMORYAutomatic memory (MEMORY.md)
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSBackground task functionality
CLAUDE_CODE_DISABLE_CLAUDE_MDSLoading CLAUDE.md files
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECKCommand injection security check
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASExperimental beta API features
CLAUDE_CODE_DISABLE_FAST_MODEFast mode (/fast toggle)
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYFeedback survey popup
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGGit-based file checkpointing
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICNon-critical network requests
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALLAuto-install official plugins
CLAUDE_CODE_DISABLE_TERMINAL_TITLETerminal title updates
CLAUDE_CODE_DISABLE_THINKINGExtended thinking completely
CLAUDE_CODE_DONT_INHERIT_ENVChild shell inherits parent environment
CLAUDE_CODE_SKIP_PROMPT_HISTORYPrompt history saving
DISABLE_INTERLEAVED_THINKINGInterleaved thinking beta
DISABLE_PROMPT_CACHINGPrompt caching globally
DISABLE_PROMPT_CACHING_HAIKUPrompt caching for Haiku
DISABLE_PROMPT_CACHING_OPUSPrompt caching for Opus
DISABLE_PROMPT_CACHING_SONNETPrompt caching for Sonnet
DISABLE_ERROR_REPORTINGAutomatic error reporting
DISABLE_TELEMETRYAll telemetry
DISABLE_MICROCOMPACTMicro-compaction (small context cleanups)

Tip: CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 is useful in CI/CD or when running automated pipelines where you don't want memory files created. CLAUDE_CODE_DISABLE_CLAUDE_MDS=1 is useful for testing without project instructions.

Bash & Shell#

VariablePurposeDefault
BASH_MAX_OUTPUT_LENGTHMax bash output character length30000 (max: 150000)
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATORShow sandbox mode indicator
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIRMaintain consistent working directory across commands
FORCE_CODE_TERMINALForce terminal/CLI mode

Tool Configuration#

VariablePurposeDefault
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYMax concurrent tool executions10
CLAUDE_CODE_GLOB_TIMEOUT_SECONDSGlob operation timeout20 (WSL: 60)
CLAUDE_CODE_GLOB_HIDDENInclude hidden files in glob results
CLAUDE_CODE_GLOB_NO_IGNOREIgnore .gitignore rules in glob
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENSMax tokens for file Read tool output
SLASH_COMMAND_TOOL_CHAR_BUDGETCharacter budget for slash command tool outputcomputed
TASK_MAX_OUTPUT_LENGTHMax output length for Task tool results

MCP (Model Context Protocol)#

VariablePurposeDefault
MCP_TIMEOUTMCP server connection timeout30000 (30s)
MCP_TOOL_TIMEOUTIndividual MCP tool execution timeout
MAX_MCP_OUTPUT_TOKENSMax tokens for MCP tool output25000
MCP_SERVER_CONNECTION_BATCH_SIZEConcurrent MCP server connections3
MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZERemote MCP connection batch size20
MCP_CONNECTION_NONBLOCKINGMake MCP connections non-blocking
MCP_CLIENT_SECRETClient secret for MCP OAuth
MCP_OAUTH_CALLBACK_PORTOAuth callback server portrandom

Tip: If you have many MCP servers configured and startup is slow, increase MCP_SERVER_CONNECTION_BATCH_SIZE to connect to more servers in parallel.

Plugin System#

VariablePurpose
CLAUDE_CODE_PLUGIN_CACHE_DIRPlugin cache directory (default: ~/.claude/plugins)
CLAUDE_CODE_PLUGIN_SEED_DIRSeed directory for pre-installed plugins
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MSGit clone timeout for plugin installation
CLAUDE_CODE_PLUGIN_USE_ZIP_CACHEUse zip-based caching instead of git
CLAUDE_CODE_SYNC_PLUGIN_INSTALLInstall plugins synchronously (block until done)
CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MSTimeout for synchronous plugin install
CLAUDE_CODE_USE_COWORK_PLUGINSUse cowork_plugins directory instead of default

Context & Compaction#

VariablePurpose
DISABLE_COMPACTDisable all context compaction
DISABLE_AUTO_COMPACTDisable automatic compaction only
DISABLE_CLAUDE_CODE_SM_COMPACTDisable session memory compaction
ENABLE_CLAUDE_CODE_SM_COMPACTForce enable session memory compaction
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEOverride auto-compaction trigger percentage (0–100 float). Default is 92%
CLAUDE_CODE_SKIP_PRECOMPACT_LOADOptimize large session file loading
CLAUDE_AFTER_LAST_COMPACTRequest only logs after last compaction
USE_API_CONTEXT_MANAGEMENTEnable server-side context management
CLAUDE_CODE_DISABLE_1M_CONTEXTDisable extended 1M token context

Tip: CLAUDE_AUTOCOMPACT_PCT_OVERRIDE is particularly useful. The default auto-compaction triggers at ~83% context usage (values above this are silently capped). If you want earlier compaction (preserving more space for responses), try CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=75. See the complete CLAUDE_AUTOCOMPACT_PCT_OVERRIDE guide for recommended values by use case, the cap bug details, and related compaction variables.

Agent Teams & Cowork#

VariablePurpose
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSEnable Agent Teams (multi-agent with independent Git worktrees)
CLAUDE_CODE_PLAN_MODE_REQUIREDRequire agents to use plan mode
CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASEEnable interview phase in plan mode
CLAUDE_CODE_PLAN_V2_AGENT_COUNTNumber of agents for Plan v2 (1–10)
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNTNumber of explore agents (1–10, default: 3)
CLAUDE_CODE_TASK_LIST_IDTask list ID for agent coordination
CLAUDE_CODE_IS_COWORKIndicates running in collaborative/cowork mode
CLAUDE_AUTO_BACKGROUND_TASKSAuto-launch background tasks

Remote / Server Mode#

VariablePurpose
CLAUDE_CODE_REMOTEIndicates remote/server mode
CLAUDE_CODE_REMOTE_SESSION_IDRemote session identifier
CLAUDE_CODE_REMOTE_MEMORY_DIRMemory directory for remote mode
CLAUDE_CODE_REMOTE_SEND_KEEPALIVESSend periodic keepalive pings
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPERemote environment type
CLAUDE_CODE_USE_CCR_V2Use Claude Code Router v2 protocol (HTTP-based)
CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2Use POST-based session ingress v2
SESSION_INGRESS_URLSession ingress URL
CLAUDE_CODE_ENVIRONMENT_KINDEnvironment: byoc, anthropic_cloud, bridge
CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSIONEnvironment runner version
LOCAL_BRIDGEEnable local bridge mode for remote connections

IDE Integration#

VariablePurpose
CLAUDE_CODE_AUTO_CONNECT_IDEAuto-connect to IDE on startup
CLAUDE_CODE_IDE_HOST_OVERRIDECustom IDE communication host
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALLSkip automatic IDE extension install
CLAUDE_CODE_IDE_SKIP_VALID_CHECKBypass IDE validation checks
VSCODE_GIT_ASKPASS_MAINVS Code Git credential helper (auto-detected)
CURSOR_TRACE_IDCursor editor trace ID for debugging
CLAUDE_CHROME_PERMISSION_MODEPermission mode for Claude for Chrome

OpenTelemetry (OTEL)#

VariablePurpose
OTEL_EXPORTER_OTLP_ENDPOINTOTLP exporter endpoint URL
OTEL_EXPORTER_OTLP_HEADERSOTLP exporter headers
OTEL_EXPORTER_OTLP_PROTOCOLOTLP protocol: grpc or http/protobuf
OTEL_EXPORTER_OTLP_INSECUREAllow insecure OTLP connections
OTEL_EXPORTER_OTLP_LOGS_PROTOCOLProtocol for logs exporter
OTEL_EXPORTER_OTLP_METRICS_PROTOCOLProtocol for metrics exporter
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCEMetrics temporality: cumulative or delta
OTEL_EXPORTER_OTLP_TRACES_PROTOCOLProtocol for traces exporter
OTEL_EXPORTER_PROMETHEUS_HOSTPrometheus exporter host
OTEL_EXPORTER_PROMETHEUS_PORTPrometheus exporter port
OTEL_LOGS_EXPORTERLogs exporter type: otlp, console
OTEL_METRICS_EXPORTERMetrics exporter type
OTEL_TRACES_EXPORTERTraces exporter type
OTEL_LOG_USER_PROMPTSInclude user prompts in telemetry
OTEL_LOG_TOOL_CONTENTInclude tool input/output in telemetry
OTEL_LOG_TOOL_DETAILSInclude tool execution details
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MSOTEL shutdown timeout (default: 2000ms)
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MSOTEL flush timeout (default: 5000ms)
CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MSDebounce for OTEL headers helper
OTEL_LOGS_EXPORT_INTERVALLogs export interval (ms)
OTEL_METRIC_EXPORT_INTERVALMetrics export interval (ms)
OTEL_TRACES_EXPORT_INTERVALTraces export interval (ms)
ANALYTICS_LOG_TOOL_DETAILSInclude tool details in analytics logs
BETA_TRACING_ENDPOINTCustom endpoint for beta tracing
CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MSDatadog metrics flush interval (ms)

Tip: OTEL support makes Claude Code observable in enterprise environments. Point OTEL_EXPORTER_OTLP_ENDPOINT at your Grafana/Datadog/Honeycomb and get full traces of every tool call, API request, and thinking step.

Proxy & TLS#

VariablePurpose
HTTP_PROXYHTTP proxy server URL
HTTPS_PROXYHTTPS proxy server URL
NO_PROXYDomains to bypass proxy (comma-separated)
CLAUDE_CODE_PROXY_RESOLVES_HOSTSProxy handles DNS resolution (skip local DNS)
CLAUDE_CODE_CLIENT_CERTClient TLS certificate path (for mTLS)
CLAUDE_CODE_CLIENT_KEYClient TLS private key path
CLAUDE_CODE_CLIENT_KEY_PASSPHRASEEncrypted key passphrase
NODE_EXTRA_CA_CERTSAdditional CA certificates path
NODE_TLS_REJECT_UNAUTHORIZEDSet to 0 to disable TLS verification (not recommended)
NODE_USE_SYSTEM_CAUse system CA certificate store

Tip: Enterprise users behind corporate proxies: set CLAUDE_CODE_CLIENT_CERT and CLAUDE_CODE_CLIENT_KEY for mutual TLS. If your proxy intercepts TLS, point NODE_EXTRA_CA_CERTS at your corporate CA bundle.

Debug & Profiling#

VariablePurpose
CLAUDE_DEBUGEnable verbose debug logging
CLAUDE_CODE_DEBUG_LOGS_DIRCustom debug log directory
CLAUDE_CODE_DIAGNOSTICS_FILEPath for diagnostics output
CLAUDE_CODE_PROFILE_STARTUPProfile startup performance
CLAUDE_CODE_PROFILE_QUERYProfile per-query performance
CLAUDE_CODE_PERFETTO_TRACEEnable Perfetto trace output to file
CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MSThreshold for slow filesystem operation warnings
CLAUDE_CODE_FRAME_TIMING_LOGEnable per-frame render timing logs
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MSTimeout for session-end hooks before force-exit

Tip: Start debugging with CLAUDE_DEBUG=1 claude. If you need deeper diagnostics, add CLAUDE_CODE_PROFILE_STARTUP=1 and check the output for slow initialization steps. See our debugging guide for common issues.

Command Disablers#

These disable specific Claude Code CLI commands:

VariableDisables
DISABLE_AUTOUPDATERAutomatic update checker
DISABLE_BUG_COMMAND/bug command
DISABLE_COST_WARNINGSAPI cost warnings
DISABLE_DOCTOR_COMMAND/doctor diagnostic command
DISABLE_EXTRA_USAGE_COMMANDExtra usage display
DISABLE_FEEDBACK_COMMAND/feedback command
DISABLE_INSTALL_GITHUB_APP_COMMANDGitHub app install command
DISABLE_INSTALLATION_CHECKSInstallation verification
DISABLE_LOGIN_COMMAND/login command
DISABLE_LOGOUT_COMMAND/logout command
DISABLE_UPGRADE_COMMAND/upgrade command
DISABLE_AUTO_MIGRATE_TO_NATIVENative installer migration

Agent SDK#

VariablePurpose
CLAUDE_AGENT_SDK_VERSIONAgent SDK version sent in User-Agent header
CLAUDE_AGENT_SDK_CLIENT_APPClient application name
CLAUDE_AGENT_SDK_MCP_NO_PREFIXDon't prefix MCP tool names with server name
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTSDisable built-in agent types
DEBUG_SDKEnable SDK debug logging

Tmux Integration#

VariablePurpose
CLAUDE_CODE_TMUX_SESSIONTmux session name shown in UI header
CLAUDE_CODE_TMUX_PREFIXTmux prefix key shown in detach instructions
CLAUDE_CODE_TMUX_PREFIX_CONFLICTSShow prefix twice when key conflicts
TMUXTmux session path (auto-detected when running inside tmux)
TMUX_PANECurrent tmux pane ID (auto-detected)

Internal & Sandbox#

These are used internally by Claude Code for demo environments, testing, and specialized deployments:

VariablePurpose
IS_DEMOIndicates demo mode
IS_SANDBOXIndicates sandbox mode
DEMO_VERSIONDemo environment version
SAFEUSERSafe user context for sandboxed execution

Quick Start Recipes#

# Debug mode
CLAUDE_DEBUG=1 claude

# Custom API proxy
ANTHROPIC_BASE_URL=https://my-proxy.com/v1 CLAUDE_CODE_ATTRIBUTION_HEADER=0 claude

# Bedrock with streaming fix
CLAUDE_CODE_USE_BEDROCK=1 CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING=1 claude

# Cost-effective subagents
CLAUDE_CODE_SUBAGENT_MODEL=claude-haiku-4-5-20251001 claude

# Earlier context compaction (at 80%)
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=80 claude

# CI/CD mode — minimal noise
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1 DISABLE_AUTOUPDATER=1 claude -p "run tests"

# Enterprise with mTLS proxy
HTTPS_PROXY=https://proxy.corp.com:8443 CLAUDE_CODE_CLIENT_CERT=/path/to/cert.pem CLAUDE_CODE_CLIENT_KEY=/path/to/key.pem claude

# Agent Teams
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 claude

Sources#

This reference was compiled from:

For version-by-version changelogs, see the Claude Code Version Tracker.

This analysis is conducted for independent security research and interoperability purposes under fair use principles. All trademarks belong to their respective owners. The information presented here documents publicly observable behavior of installed software and is not intended to circumvent any technological protection measures, infringe on intellectual property rights, or encourage unauthorized use. Use these findings at your own discretion.

Related: Context Window Management Guide | Claude Code Productivity Tips | Debugging Claude Code Issues