You can configure Claude Code by setting environment variables before starting the process. Most variables are read at startup; some are checked at runtime.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/VineeTagarwal-code/claude-code/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
ANTHROPIC_API_KEY
ANTHROPIC_API_KEY
apiKeyHelper script.ANTHROPIC_BASE_URL
ANTHROPIC_BASE_URL
ANTHROPIC_AUTH_TOKEN
ANTHROPIC_AUTH_TOKEN
ANTHROPIC_API_KEY when set and not in a managed OAuth context.ANTHROPIC_UNIX_SOCKET
ANTHROPIC_UNIX_SOCKET
CLAUDE_CODE_OAUTH_TOKEN
CLAUDE_CODE_OAUTH_TOKEN
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR
CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR
CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR
CLAUDE_CODE_API_KEY_HELPER_TTL_MS
CLAUDE_CODE_API_KEY_HELPER_TTL_MS
apiKeyHelper script. After this period, the helper is called again to refresh the key.Provider Configuration
CLAUDE_CODE_USE_BEDROCK
CLAUDE_CODE_USE_BEDROCK
1 to use Amazon Bedrock as the API provider instead of the Anthropic API. Requires valid AWS credentials.CLAUDE_CODE_USE_VERTEX
CLAUDE_CODE_USE_VERTEX
1 to use Google Vertex AI as the API provider.CLAUDE_CODE_USE_FOUNDRY
CLAUDE_CODE_USE_FOUNDRY
1 to use Microsoft Azure AI Foundry as the API provider.ANTHROPIC_BEDROCK_BASE_URL
ANTHROPIC_BEDROCK_BASE_URL
AWS_REGION / AWS_DEFAULT_REGION
AWS_REGION / AWS_DEFAULT_REGION
us-east-1 if neither is set.CLOUD_ML_REGION
CLOUD_ML_REGION
us-east5 if not set.VERTEX_REGION_* (per-model overrides)
VERTEX_REGION_* (per-model overrides)
CLOUD_ML_REGION.| Variable | Model prefix |
|---|---|
VERTEX_REGION_CLAUDE_HAIKU_4_5 | claude-haiku-4-5 |
VERTEX_REGION_CLAUDE_3_5_HAIKU | claude-3-5-haiku |
VERTEX_REGION_CLAUDE_3_5_SONNET | claude-3-5-sonnet |
VERTEX_REGION_CLAUDE_3_7_SONNET | claude-3-7-sonnet |
VERTEX_REGION_CLAUDE_4_1_OPUS | claude-opus-4-1 |
VERTEX_REGION_CLAUDE_4_0_OPUS | claude-opus-4 |
VERTEX_REGION_CLAUDE_4_6_SONNET | claude-sonnet-4-6 |
VERTEX_REGION_CLAUDE_4_5_SONNET | claude-sonnet-4-5 |
VERTEX_REGION_CLAUDE_4_0_SONNET | claude-sonnet-4 |
ANTHROPIC_BETAS
ANTHROPIC_BETAS
anthropic-beta headers to the API.Model Selection
ANTHROPIC_MODEL
ANTHROPIC_MODEL
ANTHROPIC_SMALL_FAST_MODEL
ANTHROPIC_SMALL_FAST_MODEL
ANTHROPIC_DEFAULT_SONNET_MODEL
ANTHROPIC_DEFAULT_SONNET_MODEL
ANTHROPIC_DEFAULT_OPUS_MODEL
ANTHROPIC_DEFAULT_OPUS_MODEL
ANTHROPIC_DEFAULT_HAIKU_MODEL
ANTHROPIC_DEFAULT_HAIKU_MODEL
ANTHROPIC_CUSTOM_MODEL_OPTION
ANTHROPIC_CUSTOM_MODEL_OPTION
CLAUDE_CODE_MAX_OUTPUT_TOKENS
CLAUDE_CODE_MAX_OUTPUT_TOKENS
CLAUDE_CODE_MAX_CONTEXT_TOKENS
CLAUDE_CODE_MAX_CONTEXT_TOKENS
CLAUDE_CODE_MAX_RETRIES
CLAUDE_CODE_MAX_RETRIES
Behavior & Modes
CLAUDE_CODE_REMOTE
CLAUDE_CODE_REMOTE
true to start Claude Code in remote mode. Remote mode changes the UI to show a QR code and session URL for connecting from a mobile or web client.--max-old-space-size=8192).CLAUDE_CODE_SIMPLE
CLAUDE_CODE_SIMPLE
ANTHROPIC_API_KEY or the apiKeyHelper from --settings.You can also enable this mode with the --bare CLI flag.CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR
cd commands from persisting across tool calls.CLAUDE_CODE_SHELL
CLAUDE_CODE_SHELL
SHELL environment variable or /bin/sh.CLAUDE_CODE_TMPDIR
CLAUDE_CODE_TMPDIR
/tmp.CLAUDE_CONFIG_DIR
CLAUDE_CONFIG_DIR
~/.claude.CLAUDE_CODE_HOST_PLATFORM
CLAUDE_CODE_HOST_PLATFORM
win32 | darwin | linux)Override the reported host platform for analytics. Useful in container or remote environments where process.platform reports the container OS but the actual host differs.Feature Flags & Disables
DISABLE_COMPACT
DISABLE_COMPACT
/compact command and automatic context compaction.DISABLE_AUTO_COMPACT
DISABLE_AUTO_COMPACT
/compact command available.DISABLE_PROMPT_CACHING
DISABLE_PROMPT_CACHING
DISABLE_AUTOUPDATER
DISABLE_AUTOUPDATER
DISABLE_DOCTOR_COMMAND
DISABLE_DOCTOR_COMMAND
/doctor command.DISABLE_UPGRADE_COMMAND
DISABLE_UPGRADE_COMMAND
/upgrade command.DISABLE_FEEDBACK_COMMAND / DISABLE_BUG_COMMAND
DISABLE_FEEDBACK_COMMAND / DISABLE_BUG_COMMAND
/feedback (and /bug) command.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS
Bash and Task tools. When set, run_in_background is ignored and all commands run in the foreground.CLAUDE_CODE_DISABLE_THINKING
CLAUDE_CODE_DISABLE_THINKING
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING
CLAUDE_CODE_DISABLE_FAST_MODE
CLAUDE_CODE_DISABLE_FAST_MODE
CLAUDE_CODE_DISABLE_1M_CONTEXT
CLAUDE_CODE_DISABLE_1M_CONTEXT
CLAUDE_CODE_DISABLE_CLAUDE_MDS
CLAUDE_CODE_DISABLE_CLAUDE_MDS
CLAUDE.md memory files entirely.CLAUDE_CODE_DISABLE_AUTO_MEMORY
CLAUDE_CODE_DISABLE_AUTO_MEMORY
CLAUDE_CODE_DISABLE_ATTACHMENTS
CLAUDE_CODE_DISABLE_ATTACHMENTS
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC
CLAUDE_CODE_DISABLE_ADVISOR_TOOL
CLAUDE_CODE_DISABLE_ADVISOR_TOOL
CLAUDE_CODE_DISABLE_POLICY_SKILLS
CLAUDE_CODE_DISABLE_POLICY_SKILLS
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY
10.CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD
CLAUDE.md memory files beyond the default locations.Debugging
DEBUG
DEBUG
--debug on the CLI. Causes detailed diagnostic output to be written to a log file.DEBUG_SDK
DEBUG_SDK
CLAUDE_CODE_DEBUG_LOG_LEVEL
CLAUDE_CODE_DEBUG_LOG_LEVEL
verbose | debug | info | warn | error)Sets the minimum log level for debug output. Defaults to debug, which filters out verbose messages. Set to verbose to include high-volume diagnostics such as full shell output and stdout/stderr for every command.CLAUDE_CODE_DEBUG_LOGS_DIR
CLAUDE_CODE_DEBUG_LOGS_DIR
~/.claude/logs/.CLAUDE_CODE_DEBUG_REPAINTS
CLAUDE_CODE_DEBUG_REPAINTS
CLAUDE_CODE_TERMINAL_RECORDING
CLAUDE_CODE_TERMINAL_RECORDING
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR
Bash tool displays a SandboxedBash label in the UI instead of Bash when a command runs inside the sandbox.DISABLE_INSTALLATION_CHECKS
DISABLE_INSTALLATION_CHECKS
/doctor command. Useful in managed environments (e.g., HFI) where the installation method is unconventional.Client Certificate Authentication
CLAUDE_CODE_CLIENT_CERT
CLAUDE_CODE_CLIENT_CERT
CLAUDE_CODE_CLIENT_KEY
CLAUDE_CODE_CLIENT_KEY
CLAUDE_CODE_CLIENT_CERT.