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:
- API & Authentication — API keys, tokens, custom endpoints
- Model Configuration — model overrides, output tokens, thinking
- AWS Bedrock — Bedrock setup, streaming fix for 400 errors
- Google Vertex AI
- Azure Foundry
- OAuth & Login
- Core Configuration — shell, config dir, entrypoint
- Feature Flags (Enable) — opt-in features
- Feature Flags (Disable) — opt-out features
- Bash & Shell
- Tool Configuration — concurrency, glob, timeouts
- MCP (Model Context Protocol)
- Plugin System
- Context & Compaction — auto-compaction, context window
- Agent Teams & Cowork
- Remote / Server Mode
- IDE Integration
- OpenTelemetry (OTEL)
- Proxy & TLS — enterprise proxy, mTLS
- Debug & Profiling
- Command Disablers
- Agent SDK
- Tmux Integration
- Internal & Sandbox
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#
| Variable | Purpose | Default |
|---|---|---|
ANTHROPIC_API_KEY | Primary API key for Claude API | — |
ANTHROPIC_AUTH_TOKEN | Alternative bearer token; takes priority over API key | — |
ANTHROPIC_BASE_URL | Custom endpoint for Anthropic services | api.anthropic.com |
ANTHROPIC_CUSTOM_HEADERS | Custom HTTP headers (newline-separated Key: Value) | — |
ANTHROPIC_BETAS | Comma-separated beta feature headers | — |
ANTHROPIC_LOG | SDK internal logging level | — |
API_TIMEOUT_MS | Request timeout in milliseconds | 600000 (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#
| Variable | Purpose | Default |
|---|---|---|
ANTHROPIC_MODEL | Override the default Claude model | — |
ANTHROPIC_SMALL_FAST_MODEL | Override small/fast model for quick operations | Haiku |
ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION | AWS region for small fast model on Bedrock | — |
ANTHROPIC_DEFAULT_HAIKU_MODEL | Override Haiku model ID | haiku-4.5 |
ANTHROPIC_DEFAULT_SONNET_MODEL | Override Sonnet model ID | sonnet-4.6 |
ANTHROPIC_DEFAULT_OPUS_MODEL | Override Opus model ID | opus-4.6 |
CLAUDE_CODE_SUBAGENT_MODEL | Force a specific model for sub-agent (Task tool) operations | — |
CLAUDE_CODE_MAX_OUTPUT_TOKENS | Maximum output tokens for responses; validated per-model | — |
MAX_THINKING_TOKENS | Maximum tokens for extended thinking; enables thinking when > 0 | — |
CLAUDE_CODE_EFFORT_LEVEL | Reasoning effort: low, medium, high | high |
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#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_USE_BEDROCK | Route API calls through AWS Bedrock |
CLAUDE_CODE_SKIP_BEDROCK_AUTH | Skip AWS authentication for Bedrock |
BEDROCK_BASE_URL | Custom Bedrock API endpoint |
ANTHROPIC_BEDROCK_BASE_URL | Alternative Bedrock endpoint (alias) |
AWS_ACCESS_KEY_ID | AWS access key |
AWS_SECRET_ACCESS_KEY | AWS secret key |
AWS_SESSION_TOKEN | AWS session token for temporary credentials |
AWS_REGION | AWS region for Bedrock |
AWS_DEFAULT_REGION | Fallback AWS region |
AWS_PROFILE | AWS profile for credential selection |
AWS_BEARER_TOKEN_BEDROCK | Bearer token for Bedrock authentication |
AWS_EXECUTION_ENV | AWS execution environment identifier (e.g. Lambda) |
AWS_LAMBDA_FUNCTION_NAME | Lambda function name (auto-detected in Lambda) |
AWS_LAMBDA_BENCHMARK_MODE | Enable Lambda benchmark mode |
AWS_LOGIN_CACHE_DIRECTORY | Custom directory for AWS login cache |
ENABLE_PROMPT_CACHING_1H_BEDROCK | Enable 1-hour prompt caching on Bedrock |
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING | Enable 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#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_USE_VERTEX | Route API calls through Vertex AI |
CLAUDE_CODE_SKIP_VERTEX_AUTH | Skip GCP authentication for Vertex AI |
VERTEX_BASE_URL | Custom Vertex AI endpoint |
ANTHROPIC_VERTEX_PROJECT_ID | Google Cloud project ID |
CLOUD_ML_REGION | Google Cloud ML region |
GOOGLE_APPLICATION_CREDENTIALS | Path to GCP service account JSON |
GOOGLE_CLOUD_PROJECT | Google Cloud project identifier |
GOOGLE_CLOUD_QUOTA_PROJECT | Quota/billing project |
GCLOUD_PROJECT | Alternative GCP project identifier |
Azure Foundry#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_USE_FOUNDRY | Route API calls through Azure Foundry |
CLAUDE_CODE_SKIP_FOUNDRY_AUTH | Skip Azure authentication |
ANTHROPIC_FOUNDRY_API_KEY | Foundry API key |
ANTHROPIC_FOUNDRY_BASE_URL | Custom Foundry endpoint |
ANTHROPIC_FOUNDRY_RESOURCE | Foundry resource name |
OAuth & Login#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_OAUTH_TOKEN | Pre-configured OAuth access token |
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR | File descriptor for OAuth token |
CLAUDE_CODE_OAUTH_REFRESH_TOKEN | OAuth refresh token |
CLAUDE_CODE_OAUTH_SCOPES | OAuth scopes for refresh token |
CLAUDE_CODE_OAUTH_CLIENT_ID | Custom OAuth client ID |
CLAUDE_CODE_CUSTOM_OAUTH_URL | Custom OAuth server URL |
CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR | File descriptor for API key |
CLAUDE_CODE_API_KEY_HELPER_TTL_MS | Cache TTL for API key helper |
CLAUDE_CODE_SESSION_ACCESS_TOKEN | Session-scoped access token |
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR | File descriptor for WebSocket auth |
USE_LOCAL_OAUTH | Use local OAuth server for development |
USE_STAGING_OAUTH | Use staging OAuth server |
Core Configuration#
| Variable | Purpose | Default |
|---|---|---|
CLAUDE_CONFIG_DIR | Custom config directory | ~/.claude |
CLAUDE_CODE_TMPDIR | Temp directory for operations | /tmp (Unix) |
CLAUDE_TMPDIR | Alternative temp directory (fallback) | — |
CLAUDE_CODE_SHELL | Override shell for Bash tool (must be bash or zsh) | auto-detected |
CLAUDE_CODE_SHELL_PREFIX | Prefix command for shell execution | — |
CLAUDE_CODE_ENTRYPOINT | Application entrypoint: cli, sdk-ts, sdk-py, vscode | auto-detected |
CLAUDE_CODE_SIMPLE | Simplified mode; disables CLAUDE.md and attachments | — |
CLAUDE_CODE_EXTRA_BODY | Additional JSON merged into API request bodies | — |
CLAUDE_CODE_BASE_REF | Git base ref for diff operations | — |
CLAUDE_CODE_TAGS | Custom tags for telemetry events | — |
CLAUDE_CODE_CONTAINER_ID | Container/pod identifier | — |
CLAUDE_CODE_ACCOUNT_UUID | Pre-configured account UUID | — |
CLAUDE_CODE_USER_EMAIL | Pre-configured user email | — |
CLAUDE_CODE_ORGANIZATION_UUID | Organization UUID | — |
CLAUDE_CODE_ATTRIBUTION_HEADER | Controls 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 fixes | enabled |
CLAUDE_CODE_MAX_RETRIES | Maximum API request retries | — |
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE | Token limit override for input blocking | — |
CLAUDE_CODE_FORCE_FULL_LOGO | Force full ASCII logo on startup | — |
CLAUDE_CODE_STREAMING_TEXT | Enable streaming text display | — |
CLAUDE_CODE_SYNTAX_HIGHLIGHT | Set to false to disable syntax highlighting | enabled |
CLAUDE_CODE_ACCESSIBILITY | Enable accessibility mode; disables cursor hiding | — |
CLAUDE_CODE_RESUME_INTERRUPTED_TURN | Auto-resume an interrupted agent turn | — |
CLAUDE_CODE_HOST_PLATFORM | Override platform detection: win32, darwin, linux | auto-detected |
CLAUDE_CODE_ACTION | Indicates running as GitHub Action | — |
CLAUDE_ENV_FILE | Path to environment file for session variables | — |
CLAUDE_DEBUG | Enable debug logging | — |
CLAUDECODE | Set to 1 in child shell processes (auto-set) | 1 |
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD | Additional directories to scan for CLAUDE.md files (colon-separated) | — |
CLAUDE_CODE_ADDITIONAL_PROTECTION | Enable additional safety protections | — |
CLAUDE_CODE_SAVE_HOOK_ADDITIONAL_CONTEXT | Extra context passed to save hooks | — |
CLAUDE_CODE_API_BASE_URL | Custom Claude Code API base URL (distinct from ANTHROPIC_BASE_URL) | — |
CLAUDE_CODE_EAGER_FLUSH | Eagerly flush output buffers | — |
CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES | Include partial/streaming messages in output | — |
CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER | Exit after first UI render (testing) | — |
CLAUDE_CODE_EXIT_AFTER_STOP_DELAY | Delay before exit after stop signal (ms) | — |
CLAUDE_CODE_FORCE_GLOBAL_CACHE | Force use of global cache directory | — |
CLAUDE_CODE_WORKER_EPOCH | Worker epoch for versioning internal state | — |
CLAUDE_CODE_BUBBLEWRAP | Enable Bubblewrap sandboxing (Linux) | — |
CLAUDE_REPL_MODE | Run in REPL (interactive) mode | — |
CLAUDE_FORCE_DISPLAY_SURVEY | Force display of feedback survey | — |
CLAUBBIT | Internal 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)#
| Variable | Purpose |
|---|---|
ENABLE_LSP_TOOL | Enable Language Server Protocol tool |
ENABLE_TOOL_SEARCH | Tool search/deferred loading: auto, true, false, or 0–100% |
ENABLE_SESSION_BACKGROUNDING | Enable session backgrounding |
ENABLE_BTW | Enable "by the way" suggestions |
ENABLE_CLAUDEAI_MCP_SERVERS | Enable Claude.ai-hosted MCP servers |
ENABLE_MCP_LARGE_OUTPUT_FILES | Enable large output files for MCP |
ENABLE_CLAUDE_CODE_SM_COMPACT | Enable session memory compaction |
CLAUDE_CODE_ENABLE_CFC | Enable Claude for Chrome browser automation |
CLAUDE_CODE_ENABLE_TASKS | Enable task list tools |
CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING | Enable fine-grained (eager) input streaming — fixes Bedrock 400 errors |
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION | Enable prompt suggestions. Set to false or 1 |
CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING | Enable file checkpointing in SDK mode |
CLAUDE_CODE_ENABLE_TELEMETRY | Enable telemetry collection |
CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT | Attach token usage info to messages |
CLAUDE_ENABLE_STREAM_WATCHDOG | Enable stream health monitoring |
CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES | Emit tool use summary events |
FALLBACK_FOR_ALL_PRIMARY_MODELS | Enable fallback for all primary models |
FORCE_AUTOUPDATE_PLUGINS | Force auto-update plugins |
ENABLE_BETA_TRACING_DETAILED | Enable detailed beta tracing |
ENABLE_ENHANCED_TELEMETRY_BETA | Enable enhanced telemetry (beta) |
CLAUDE_CODE_ENHANCED_TELEMETRY_BETA | Enhanced telemetry beta flag (alias) |
RIPGREP_EMBEDDED | Use embedded ripgrep binary |
USE_BUILTIN_RIPGREP | Force use of built-in ripgrep |
Feature Flags (Disable)#
| Variable | What It Disables |
|---|---|
CLAUDE_CODE_DISABLE_1M_CONTEXT | Extended 1M token context window |
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING | Adaptive thinking mode |
CLAUDE_CODE_DISABLE_ATTACHMENTS | File/image attachments |
CLAUDE_CODE_DISABLE_AUTO_MEMORY | Automatic memory (MEMORY.md) |
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS | Background task functionality |
CLAUDE_CODE_DISABLE_CLAUDE_MDS | Loading CLAUDE.md files |
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK | Command injection security check |
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS | Experimental beta API features |
CLAUDE_CODE_DISABLE_FAST_MODE | Fast mode (/fast toggle) |
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY | Feedback survey popup |
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING | Git-based file checkpointing |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Non-critical network requests |
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL | Auto-install official plugins |
CLAUDE_CODE_DISABLE_TERMINAL_TITLE | Terminal title updates |
CLAUDE_CODE_DISABLE_THINKING | Extended thinking completely |
CLAUDE_CODE_DONT_INHERIT_ENV | Child shell inherits parent environment |
CLAUDE_CODE_SKIP_PROMPT_HISTORY | Prompt history saving |
DISABLE_INTERLEAVED_THINKING | Interleaved thinking beta |
DISABLE_PROMPT_CACHING | Prompt caching globally |
DISABLE_PROMPT_CACHING_HAIKU | Prompt caching for Haiku |
DISABLE_PROMPT_CACHING_OPUS | Prompt caching for Opus |
DISABLE_PROMPT_CACHING_SONNET | Prompt caching for Sonnet |
DISABLE_ERROR_REPORTING | Automatic error reporting |
DISABLE_TELEMETRY | All telemetry |
DISABLE_MICROCOMPACT | Micro-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#
| Variable | Purpose | Default |
|---|---|---|
BASH_MAX_OUTPUT_LENGTH | Max bash output character length | 30000 (max: 150000) |
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR | Show sandbox mode indicator | — |
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR | Maintain consistent working directory across commands | — |
FORCE_CODE_TERMINAL | Force terminal/CLI mode | — |
Tool Configuration#
| Variable | Purpose | Default |
|---|---|---|
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY | Max concurrent tool executions | 10 |
CLAUDE_CODE_GLOB_TIMEOUT_SECONDS | Glob operation timeout | 20 (WSL: 60) |
CLAUDE_CODE_GLOB_HIDDEN | Include hidden files in glob results | — |
CLAUDE_CODE_GLOB_NO_IGNORE | Ignore .gitignore rules in glob | — |
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS | Max tokens for file Read tool output | — |
SLASH_COMMAND_TOOL_CHAR_BUDGET | Character budget for slash command tool output | computed |
TASK_MAX_OUTPUT_LENGTH | Max output length for Task tool results | — |
MCP (Model Context Protocol)#
| Variable | Purpose | Default |
|---|---|---|
MCP_TIMEOUT | MCP server connection timeout | 30000 (30s) |
MCP_TOOL_TIMEOUT | Individual MCP tool execution timeout | — |
MAX_MCP_OUTPUT_TOKENS | Max tokens for MCP tool output | 25000 |
MCP_SERVER_CONNECTION_BATCH_SIZE | Concurrent MCP server connections | 3 |
MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE | Remote MCP connection batch size | 20 |
MCP_CONNECTION_NONBLOCKING | Make MCP connections non-blocking | — |
MCP_CLIENT_SECRET | Client secret for MCP OAuth | — |
MCP_OAUTH_CALLBACK_PORT | OAuth callback server port | random |
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#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_PLUGIN_CACHE_DIR | Plugin cache directory (default: ~/.claude/plugins) |
CLAUDE_CODE_PLUGIN_SEED_DIR | Seed directory for pre-installed plugins |
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS | Git clone timeout for plugin installation |
CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE | Use zip-based caching instead of git |
CLAUDE_CODE_SYNC_PLUGIN_INSTALL | Install plugins synchronously (block until done) |
CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS | Timeout for synchronous plugin install |
CLAUDE_CODE_USE_COWORK_PLUGINS | Use cowork_plugins directory instead of default |
Context & Compaction#
| Variable | Purpose |
|---|---|
DISABLE_COMPACT | Disable all context compaction |
DISABLE_AUTO_COMPACT | Disable automatic compaction only |
DISABLE_CLAUDE_CODE_SM_COMPACT | Disable session memory compaction |
ENABLE_CLAUDE_CODE_SM_COMPACT | Force enable session memory compaction |
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE | Override auto-compaction trigger percentage (0–100 float). Default is 92% |
CLAUDE_CODE_SKIP_PRECOMPACT_LOAD | Optimize large session file loading |
CLAUDE_AFTER_LAST_COMPACT | Request only logs after last compaction |
USE_API_CONTEXT_MANAGEMENT | Enable server-side context management |
CLAUDE_CODE_DISABLE_1M_CONTEXT | Disable 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#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS | Enable Agent Teams (multi-agent with independent Git worktrees) |
CLAUDE_CODE_PLAN_MODE_REQUIRED | Require agents to use plan mode |
CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE | Enable interview phase in plan mode |
CLAUDE_CODE_PLAN_V2_AGENT_COUNT | Number of agents for Plan v2 (1–10) |
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT | Number of explore agents (1–10, default: 3) |
CLAUDE_CODE_TASK_LIST_ID | Task list ID for agent coordination |
CLAUDE_CODE_IS_COWORK | Indicates running in collaborative/cowork mode |
CLAUDE_AUTO_BACKGROUND_TASKS | Auto-launch background tasks |
Remote / Server Mode#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_REMOTE | Indicates remote/server mode |
CLAUDE_CODE_REMOTE_SESSION_ID | Remote session identifier |
CLAUDE_CODE_REMOTE_MEMORY_DIR | Memory directory for remote mode |
CLAUDE_CODE_REMOTE_SEND_KEEPALIVES | Send periodic keepalive pings |
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE | Remote environment type |
CLAUDE_CODE_USE_CCR_V2 | Use Claude Code Router v2 protocol (HTTP-based) |
CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2 | Use POST-based session ingress v2 |
SESSION_INGRESS_URL | Session ingress URL |
CLAUDE_CODE_ENVIRONMENT_KIND | Environment: byoc, anthropic_cloud, bridge |
CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION | Environment runner version |
LOCAL_BRIDGE | Enable local bridge mode for remote connections |
IDE Integration#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_AUTO_CONNECT_IDE | Auto-connect to IDE on startup |
CLAUDE_CODE_IDE_HOST_OVERRIDE | Custom IDE communication host |
CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL | Skip automatic IDE extension install |
CLAUDE_CODE_IDE_SKIP_VALID_CHECK | Bypass IDE validation checks |
VSCODE_GIT_ASKPASS_MAIN | VS Code Git credential helper (auto-detected) |
CURSOR_TRACE_ID | Cursor editor trace ID for debugging |
CLAUDE_CHROME_PERMISSION_MODE | Permission mode for Claude for Chrome |
OpenTelemetry (OTEL)#
| Variable | Purpose |
|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | OTLP exporter endpoint URL |
OTEL_EXPORTER_OTLP_HEADERS | OTLP exporter headers |
OTEL_EXPORTER_OTLP_PROTOCOL | OTLP protocol: grpc or http/protobuf |
OTEL_EXPORTER_OTLP_INSECURE | Allow insecure OTLP connections |
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL | Protocol for logs exporter |
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL | Protocol for metrics exporter |
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE | Metrics temporality: cumulative or delta |
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL | Protocol for traces exporter |
OTEL_EXPORTER_PROMETHEUS_HOST | Prometheus exporter host |
OTEL_EXPORTER_PROMETHEUS_PORT | Prometheus exporter port |
OTEL_LOGS_EXPORTER | Logs exporter type: otlp, console |
OTEL_METRICS_EXPORTER | Metrics exporter type |
OTEL_TRACES_EXPORTER | Traces exporter type |
OTEL_LOG_USER_PROMPTS | Include user prompts in telemetry |
OTEL_LOG_TOOL_CONTENT | Include tool input/output in telemetry |
OTEL_LOG_TOOL_DETAILS | Include tool execution details |
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS | OTEL shutdown timeout (default: 2000ms) |
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS | OTEL flush timeout (default: 5000ms) |
CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS | Debounce for OTEL headers helper |
OTEL_LOGS_EXPORT_INTERVAL | Logs export interval (ms) |
OTEL_METRIC_EXPORT_INTERVAL | Metrics export interval (ms) |
OTEL_TRACES_EXPORT_INTERVAL | Traces export interval (ms) |
ANALYTICS_LOG_TOOL_DETAILS | Include tool details in analytics logs |
BETA_TRACING_ENDPOINT | Custom endpoint for beta tracing |
CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS | Datadog 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#
| Variable | Purpose |
|---|---|
HTTP_PROXY | HTTP proxy server URL |
HTTPS_PROXY | HTTPS proxy server URL |
NO_PROXY | Domains to bypass proxy (comma-separated) |
CLAUDE_CODE_PROXY_RESOLVES_HOSTS | Proxy handles DNS resolution (skip local DNS) |
CLAUDE_CODE_CLIENT_CERT | Client TLS certificate path (for mTLS) |
CLAUDE_CODE_CLIENT_KEY | Client TLS private key path |
CLAUDE_CODE_CLIENT_KEY_PASSPHRASE | Encrypted key passphrase |
NODE_EXTRA_CA_CERTS | Additional CA certificates path |
NODE_TLS_REJECT_UNAUTHORIZED | Set to 0 to disable TLS verification (not recommended) |
NODE_USE_SYSTEM_CA | Use 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#
| Variable | Purpose |
|---|---|
CLAUDE_DEBUG | Enable verbose debug logging |
CLAUDE_CODE_DEBUG_LOGS_DIR | Custom debug log directory |
CLAUDE_CODE_DIAGNOSTICS_FILE | Path for diagnostics output |
CLAUDE_CODE_PROFILE_STARTUP | Profile startup performance |
CLAUDE_CODE_PROFILE_QUERY | Profile per-query performance |
CLAUDE_CODE_PERFETTO_TRACE | Enable Perfetto trace output to file |
CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS | Threshold for slow filesystem operation warnings |
CLAUDE_CODE_FRAME_TIMING_LOG | Enable per-frame render timing logs |
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS | Timeout 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:
| Variable | Disables |
|---|---|
DISABLE_AUTOUPDATER | Automatic update checker |
DISABLE_BUG_COMMAND | /bug command |
DISABLE_COST_WARNINGS | API cost warnings |
DISABLE_DOCTOR_COMMAND | /doctor diagnostic command |
DISABLE_EXTRA_USAGE_COMMAND | Extra usage display |
DISABLE_FEEDBACK_COMMAND | /feedback command |
DISABLE_INSTALL_GITHUB_APP_COMMAND | GitHub app install command |
DISABLE_INSTALLATION_CHECKS | Installation verification |
DISABLE_LOGIN_COMMAND | /login command |
DISABLE_LOGOUT_COMMAND | /logout command |
DISABLE_UPGRADE_COMMAND | /upgrade command |
DISABLE_AUTO_MIGRATE_TO_NATIVE | Native installer migration |
Agent SDK#
| Variable | Purpose |
|---|---|
CLAUDE_AGENT_SDK_VERSION | Agent SDK version sent in User-Agent header |
CLAUDE_AGENT_SDK_CLIENT_APP | Client application name |
CLAUDE_AGENT_SDK_MCP_NO_PREFIX | Don't prefix MCP tool names with server name |
CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS | Disable built-in agent types |
DEBUG_SDK | Enable SDK debug logging |
Tmux Integration#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_TMUX_SESSION | Tmux session name shown in UI header |
CLAUDE_CODE_TMUX_PREFIX | Tmux prefix key shown in detach instructions |
CLAUDE_CODE_TMUX_PREFIX_CONFLICTS | Show prefix twice when key conflicts |
TMUX | Tmux session path (auto-detected when running inside tmux) |
TMUX_PANE | Current tmux pane ID (auto-detected) |
Internal & Sandbox#
These are used internally by Claude Code for demo environments, testing, and specialized deployments:
| Variable | Purpose |
|---|---|
IS_DEMO | Indicates demo mode |
IS_SANDBOX | Indicates sandbox mode |
DEMO_VERSION | Demo environment version |
SAFEUSER | Safe 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:
- Our binary extraction series: v2.1.19 → v2.1.69 → v2.1.70 → v2.1.72 → v2.1.73 → v2.1.74
- unkn0wncode's comprehensive gist (500+ variables from source analysis)
- Community reports from GitHub issues and forums
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