Skip to main content

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.

You can configure Claude Code by setting environment variables before starting the process. Most variables are read at startup; some are checked at runtime.
Truthy values are any of 1, true, yes, or on (case-insensitive). Falsy values are 0, false, no, or off.

Authentication

Type: stringYour Anthropic API key. Claude Code reads this to authenticate with the Anthropic API. If not set, Claude Code falls back to stored credentials or the configured apiKeyHelper script.
export ANTHROPIC_API_KEY="sk-ant-..."
Type: string (URL)Overrides the Anthropic API base URL. Use this to point Claude Code at a proxy, gateway, or compatible endpoint.
export ANTHROPIC_BASE_URL="https://my-proxy.example.com"
Type: stringAlternative authentication token (used as a Bearer token). Takes precedence over ANTHROPIC_API_KEY when set and not in a managed OAuth context.
export ANTHROPIC_AUTH_TOKEN="Bearer sk-ant-..."
Type: string (path)Path to a Unix domain socket for the Anthropic API connection. Used in managed environments where the API is exposed over a local socket.
export ANTHROPIC_UNIX_SOCKET="/tmp/anthropic.sock"
Type: stringProvides a claude.ai OAuth access token directly via environment variable. Takes precedence over keychain-stored tokens.
export CLAUDE_CODE_OAUTH_TOKEN="eyJ..."
Type: string (file descriptor number)File descriptor number from which Claude Code reads the OAuth token. Useful for securely passing credentials in scripts without exposing them in the environment.
Type: string (file descriptor number)File descriptor number from which Claude Code reads the API key. Useful for securely passing credentials without exposing them as an environment variable.
Type: number (milliseconds)Time-to-live for API keys fetched by the apiKeyHelper script. After this period, the helper is called again to refresh the key.

Provider Configuration

Type: booleanSet to 1 to use Amazon Bedrock as the API provider instead of the Anthropic API. Requires valid AWS credentials.
export CLAUDE_CODE_USE_BEDROCK=1
Type: booleanSet to 1 to use Google Vertex AI as the API provider.
export CLAUDE_CODE_USE_VERTEX=1
Type: booleanSet to 1 to use Microsoft Azure AI Foundry as the API provider.
export CLAUDE_CODE_USE_FOUNDRY=1
Type: string (URL)Custom endpoint URL for Bedrock. Overrides the default regional Bedrock endpoint.
Type: stringAWS region for Bedrock requests. Defaults to us-east-1 if neither is set.
Type: stringDefault Vertex AI region. Defaults to us-east5 if not set.
Type: stringPer-model Vertex AI region overrides. Set these if a specific model is only available in a region other than CLOUD_ML_REGION.
VariableModel prefix
VERTEX_REGION_CLAUDE_HAIKU_4_5claude-haiku-4-5
VERTEX_REGION_CLAUDE_3_5_HAIKUclaude-3-5-haiku
VERTEX_REGION_CLAUDE_3_5_SONNETclaude-3-5-sonnet
VERTEX_REGION_CLAUDE_3_7_SONNETclaude-3-7-sonnet
VERTEX_REGION_CLAUDE_4_1_OPUSclaude-opus-4-1
VERTEX_REGION_CLAUDE_4_0_OPUSclaude-opus-4
VERTEX_REGION_CLAUDE_4_6_SONNETclaude-sonnet-4-6
VERTEX_REGION_CLAUDE_4_5_SONNETclaude-sonnet-4-5
VERTEX_REGION_CLAUDE_4_0_SONNETclaude-sonnet-4
Type: string (comma-separated)Additional Anthropic beta features to request, comma-separated. These are passed as anthropic-beta headers to the API.
export ANTHROPIC_BETAS="interleaved-thinking-2025-05-14,token-efficient-tools-2025-02-19"

Model Selection

Type: stringOverrides the default main loop model. Takes precedence over the model stored in settings.
export ANTHROPIC_MODEL="claude-opus-4-5-20251101"
Type: stringOverrides the small, fast model used for internal tasks such as web search and lightweight subagent work. Defaults to the latest Haiku model.
export ANTHROPIC_SMALL_FAST_MODEL="claude-haiku-4-5-20251101"
Type: stringAdds a custom Sonnet-tier model to the model picker.
Type: stringAdds a custom Opus-tier model to the model picker.
Type: stringAdds a custom Haiku-tier model to the model picker.
Type: stringAdds a completely custom model entry to the model picker.
Type: numberMaximum number of output tokens per API response. Overrides the default maximum.
Type: numberMaximum context window size in tokens. Overrides the model default.
Type: numberMaximum number of API retry attempts on transient errors. Overrides the built-in default.

Behavior & Modes

Type: booleanSet to 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.
export CLAUDE_CODE_REMOTE=true
When set, Node.js memory limit is automatically raised to 8 GiB (--max-old-space-size=8192).
Type: booleanEnables “bare” or simple mode. In this mode, Claude Code skips hooks, LSP integration, plugin sync, skill directory scanning, attribution tracking, background prefetches, and all keychain/credential reads. Authentication is handled exclusively by ANTHROPIC_API_KEY or the apiKeyHelper from --settings.You can also enable this mode with the --bare CLI flag.
export CLAUDE_CODE_SIMPLE=1
Type: booleanWhen set, bash commands reset to the project working directory after each command, preventing cd commands from persisting across tool calls.
export CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1
Type: string (path)Override the shell used to execute bash commands. Defaults to the user’s SHELL environment variable or /bin/sh.
export CLAUDE_CODE_SHELL=/bin/zsh
Type: string (path)Directory for Claude Code’s temporary files. Defaults to /tmp.
Type: string (path)Override the Claude configuration directory. Defaults to ~/.claude.
export CLAUDE_CONFIG_DIR=/custom/config/dir
Type: string (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

Type: booleanDisables the /compact command and automatic context compaction.
export DISABLE_COMPACT=1
Type: booleanDisables automatic compaction when the context window is nearly full, while keeping the /compact command available.
Type: booleanDisables Anthropic prompt caching entirely.
Type: booleanDisables automatic updates.
Type: booleanDisables the /doctor command.
Type: booleanDisables the /upgrade command.
Type: booleanDisables the /feedback (and /bug) command.
Type: booleanDisables background task support for both Bash and Task tools. When set, run_in_background is ignored and all commands run in the foreground.
export CLAUDE_CODE_DISABLE_BACKGROUND_TASKS=1
Type: booleanDisables extended thinking (Claude’s reasoning process) even on models that support it.
Type: booleanDisables adaptive thinking budget calculation, using a fixed budget instead.
Type: booleanDisables fast mode even when it would otherwise be available.
Type: booleanForces Claude Code to use the default context window size rather than the 1M-token extended context window.
Type: booleanDisables loading of CLAUDE.md memory files entirely.
Type: booleanDisables automatic creation and management of memory files.
Type: booleanDisables file and image attachment support.
Type: booleanDisables the command injection security check for bash commands. Use with caution.
Type: booleanDisables all experimental API beta headers, including token-efficient tools and interleaved thinking.
Type: booleanDisables the non-streaming fallback path used when streaming responses fail.
Type: booleanDisables non-essential network requests such as fetching the MCP official registry.
Type: booleanDisables the advisor tool that suggests plugins and skills.
Type: booleanDisables skills loaded from policy/managed directories.
Type: numberMaximum number of tool calls that can run concurrently. Defaults to 10.
export CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=5
Type: booleanWhen set, Claude also searches additional directories for CLAUDE.md memory files beyond the default locations.

Debugging

Type: booleanEnables debug mode. Equivalent to passing --debug on the CLI. Causes detailed diagnostic output to be written to a log file.
export DEBUG=1
claude
# or
claude --debug
Type: booleanEnables debug logging specifically for the Anthropic SDK layer, including raw API requests and responses.
Type: string (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.
export CLAUDE_CODE_DEBUG_LOG_LEVEL=verbose
Type: string (path)Override the directory where debug log files are written. Defaults to ~/.claude/logs/.
export CLAUDE_CODE_DEBUG_LOGS_DIR=/tmp/claude-debug
Type: booleanEnables debug overlays for terminal UI repaint operations. Used for diagnosing rendering issues.
Type: booleanEnables terminal session recording in asciicast format.
Type: booleanWhen set, the Bash tool displays a SandboxedBash label in the UI instead of Bash when a command runs inside the sandbox.
Type: booleanDisables installation-type mismatch checks in the /doctor command. Useful in managed environments (e.g., HFI) where the installation method is unconventional.

Client Certificate Authentication

Type: string (path)Path to a PEM-encoded client certificate file for mutual TLS authentication with the API endpoint.
Type: string (path)Path to the private key file corresponding to CLAUDE_CODE_CLIENT_CERT.

Build docs developers (and LLMs) love