83 Undocumented Claude Code Environment Variables (v2.1.19)#

Published on January 27, 2025

Updated March 5, 2026

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

I found 83 undocumented environment variables in Claude Code 2.1.19's binary. None are in the official docs—they could change at any time, but some are genuinely useful.

If you missed it, check out my Improved Claude Code Settings Schema for autocomplete on the documented env vars.

New Since v2.1.19#

Since the original extraction, newer Claude Code versions have introduced additional environment variables. Here are the most notable ones confirmed through GitHub issues, PRs, and official documentation:

VariablePurpose
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSEnable Agent Teams (the official release of Swarms). Each agent works in an independent Git Worktree [1]
CLAUDE_CODE_SUBAGENT_MODELForce a specific model for sub-agent operations
CLAUDE_CODE_MAX_OUTPUT_TOKENSMaximum output tokens; validated per-model
MAX_THINKING_TOKENSMaximum tokens for extended thinking; enables when greater than 0
CLAUDE_CODE_SHELLOverride shell for Bash tool (must be bash or zsh)
CLAUDE_CODE_DISABLE_AUTO_MEMORYDisable automatic memory (MEMORY.md)
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKINGDisable adaptive thinking mode
CLAUDE_CODE_DISABLE_THINKINGCompletely disable extended thinking
CLAUDE_CODE_ATTRIBUTION_HEADERControls x-anthropic-billing-header transmission. Set to 0 to disable the header that changes every request and breaks prompt caching for proxies. See our complete guide for Bedrock 400 fixes [2] [3]
CLAUDE_CODE_EFFORT_LEVELReasoning effort: low, medium, or high (default). Controls adaptive thinking depth [4]
CLAUDE_CODE_ENABLE_CFCEnable Claude for Chrome browser automation
CLAUDE_CODE_SIMPLESimplified mode; disables CLAUDE.md and attachments (renamed from CLAUDE_CODE_SIMPLETON)

The Highlights#

Agent Swarms (Server-Gated)#

The most interesting find—a hidden "Swarms" feature discussed on HN:

VariableWhat It Does
CLAUDE_CODE_AGENT_SWARMSOpt-OUT only. Set to disable swarms [5]
CLAUDE_CODE_PLAN_V2_AGENT_COUNTNumber of agents in Plan v2 mode (1–10)
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNTExploration agents in Plan v2 (1–10)

The main agent acts as "team lead" spawning specialist subagents who share a task board. They work in parallel and report when finished. Server-gated by flag tengu_brass_pebble.

Update: As of early 2026, the swarms feature was officially released as "Agent Teams" and is enabled via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1. Each agent works in an independent Git Worktree, preventing code conflicts. [1]

Actually Useful Today#

VariablePurpose
CLAUDE_DEBUG=1Verbose debug logging
CLAUDE_CODE_API_BASE_URLCustom Claude Code API base URL for proxies
CLAUDE_CODE_DISABLE_CLAUDE_MDS=1Skip loading CLAUDE.md files
CLAUDE_CODE_PLAN_MODE_REQUIRED=1Force plan mode for everything
CLAUDE_CODE_GLOB_HIDDEN=1Include hidden files in globs
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYMax concurrent tool executions; default 10

Debug & Profiling#

VariablePurpose
CLAUDE_CODE_DEBUG_LOGS_DIRCustom directory for debug logs
CLAUDE_CODE_DIAGNOSTICS_FILEPath to write diagnostics output
CLAUDE_CODE_PERFETTO_TRACEEnable Perfetto trace output to file path (server-gated)
CLAUDE_CODE_PROFILE_STARTUP=1Profile startup performance

Disable Stuff#

VariableTurns Off
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYSurvey prompts
CLAUDE_CODE_DISABLE_ATTACHMENTSFile/image attachments
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGGit-based file checkpointing/backup

Quick Experiments#

# Debug mode
CLAUDE_DEBUG=1 claude

# Custom API proxy
CLAUDE_CODE_API_BASE_URL=https://my-proxy.com/v1 claude

# Skip CLAUDE.md loading
CLAUDE_CODE_DISABLE_CLAUDE_MDS=1 claude

# Force plan mode
CLAUDE_CODE_PLAN_MODE_REQUIRED=1 claude
Full List: All 83 Undocumented Environment Variables
VariableDescription
CLAUDE_AGENT_SDK_MCP_NO_PREFIXDon't prefix MCP tool names with server name
CLAUDE_AGENT_SDK_VERSIONAgent SDK version sent in User-Agent header
CLAUDE_AI_AUTHORIZE_URLAuthorization URL endpoint
CLAUDE_BASH_NO_LOGINDon't use login shell for bash commands
CLAUDE_CODE_ACCESSIBILITYEnable accessibility mode; disables cursor hiding
CLAUDE_CODE_ACTIONIndicates running as GitHub Action
CLAUDE_CODE_ADDITIONAL_PROTECTIONAdd additional protection header to API requests
CLAUDE_CODE_AGENT_RULE_DISABLEDDisable agent rules
CLAUDE_CODE_AGENT_SWARMSOpt-OUT for agent swarms feature (now superseded by CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS) [5]
CLAUDE_CODE_API_BASE_URLCustom Claude Code API base URL
CLAUDE_CODE_API_KEY_FILE_DESCRIPTORFile descriptor to read API key from
CLAUDE_CODE_ATTRIBUTION_HEADERControls x-anthropic-billing-header transmission. Set to 0 to disable the header that changes every request and breaks prompt caching for proxies. See our complete guide for Bedrock 400 fixes [2] [3]
CLAUDE_CODE_AUTO_CONNECT_IDEAuto-connect to IDE on startup
CLAUDE_CODE_BASE_REFGit base ref for diff operations
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATORShow indicator when bash runs in sandbox
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDEOverride token limit for input blocking
CLAUDE_CODE_BUBBLEWRAPSet to 1 when running in bubblewrap sandbox (Linux) [6]
CLAUDE_CODE_CONTAINER_IDContainer/pod identifier sent in HTTP headers
CLAUDE_CODE_DEBUG_LOGS_DIRCustom directory for debug logs
CLAUDE_CODE_DIAGNOSTICS_FILEPath to write diagnostics output
CLAUDE_CODE_DISABLE_ATTACHMENTSDisable file/image attachments
CLAUDE_CODE_DISABLE_CLAUDE_MDSDisable loading CLAUDE.md files
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECKDisable command injection security check
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYDisable feedback survey popup
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGDisable git-based file checkpointing
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALLDisable automatic plugin installation from marketplace
CLAUDE_CODE_DONT_INHERIT_ENVStart shell with empty environment
CLAUDE_CODE_EFFORT_LEVELReasoning effort: low, medium, or high (default). Controls adaptive thinking depth [4]
CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIESEmit tool use summary events
CLAUDE_CODE_ENABLE_CFCEnable Claude for Chrome browser automation
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONEnable/disable prompt suggestions
CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTINGEnable file checkpointing in SDK mode
CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENTAttach token usage info to messages
CLAUDE_CODE_ENHANCED_TELEMETRY_BETAEnable enhanced telemetry (beta)
CLAUDE_CODE_ENTRYPOINTApplication entry point; auto-set based on context (e.g. cli, vscode, sdk-py) [7]
CLAUDE_CODE_EXTRA_BODYAdditional JSON merged into API request bodies
CLAUDE_CODE_FORCE_FULL_LOGOForce full ASCII logo display on startup
CLAUDE_CODE_GIT_BASH_PATHGit Bash executable path (Windows)
CLAUDE_CODE_GLOB_HIDDENInclude hidden files in globs
CLAUDE_CODE_GLOB_NO_IGNOREIgnore .gitignore rules in globs
CLAUDE_CODE_GLOB_TIMEOUT_SECONDSTimeout for glob operations; default 20s (WSL: 60s)
CLAUDE_CODE_HOST_HTTP_PROXY_PORTHTTP proxy port for host
CLAUDE_CODE_HOST_SOCKS_PROXY_PORTSOCKS proxy port for host
CLAUDE_CODE_IDE_HOST_OVERRIDECustom host address for IDE communication
CLAUDE_CODE_IDE_SKIP_VALID_CHECKBypass IDE extension validation checks
CLAUDE_CODE_MAX_RETRIESMaximum API request retries
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYMax concurrent tool executions; default 10
CLAUDE_CODE_OAUTH_CLIENT_IDCustom OAuth client ID
CLAUDE_CODE_OAUTH_TOKENPre-configured OAuth access token
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTORFile descriptor to read OAuth token from
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MSOpenTelemetry flush timeout; default 5000ms
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MSOpenTelemetry shutdown timeout; default 2000ms
CLAUDE_CODE_PERFETTO_TRACEEnable Perfetto trace output to file path
CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASEEnable interview phase in plan mode
CLAUDE_CODE_PLAN_MODE_REQUIREDRequire agents to use plan mode for all tasks
CLAUDE_CODE_PLAN_V2_AGENT_COUNTNumber of agents for plan v2 (1–10)
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNTNumber of explore agents for plan v2 (1–10)
CLAUDE_CODE_PROFILE_QUERYEnable per-query profiling; set to 1
CLAUDE_CODE_PROFILE_STARTUPEnable startup profiling; set to 1
CLAUDE_CODE_REMOTEIndicates running in remote/server mode
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPERemote environment type sent in telemetry
CLAUDE_CODE_REMOTE_SESSION_IDRemote session identifier
CLAUDE_CODE_SESSION_ACCESS_TOKENSession-scoped access token
CLAUDE_CODE_SESSION_IDCurrent session identifier
CLAUDE_CODE_SIMPLETONSimplified mode; disables CLAUDE.md and attachments (later renamed to CLAUDE_CODE_SIMPLE)
CLAUDE_CODE_SKIP_PROMPT_HISTORYDisable prompt history saving
CLAUDE_CODE_SSE_PORTServer-Sent Events port
CLAUDE_CODE_SYNTAX_HIGHLIGHTDisable syntax highlighting when set to false
CLAUDE_CODE_TAGSCustom tags for telemetry events
CLAUDE_CODE_TEAMMATE_COMMANDCommand for teammate/cowork functionality
CLAUDE_CODE_TEST_FIXTURES_ROOTRoot directory for test fixtures
CLAUDE_CODE_TMUX_PREFIXTmux prefix key shown in detach instructions
CLAUDE_CODE_TMUX_PREFIX_CONFLICTSShow prefix twice when key conflicts in tmux
CLAUDE_CODE_TMUX_SESSIONTmux session name shown in UI header
CLAUDE_CODE_USE_COWORK_PLUGINSUse cowork_plugins directory instead of default
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTORFile descriptor for WebSocket credentials
CLAUDE_DEBUGEnable debug logging
CLAUDE_ENV_FILEPath to environment file for session variables
CLAUDE_FORCE_DISPLAY_SURVEYForce feedback survey display
CLAUDE_PLUGIN_ROOTRoot directory for plugins
CLAUDE_PROJECT_DIROverride project directory
CLAUDE_REPL_MODE0REPL mode; adjusts available tools
CLAUDE_TMPDIRAlternative temp directory; fallback for CLAUDE_CODE_TMPDIR

Later versions: v2.1.69 (165 vars) | v2.1.70

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.

References:

[1] Addy Osmani: Claude Code Agent Teams

[2] claude-code-router PR #1220: CLAUDE_CODE_ATTRIBUTION_HEADER fix for prompt caching

[3] anthropics/claude-code#24168: x-anthropic-billing-header causes 400 on Bedrock

[4] Claude Code Docs: Settings

[5] Hacker News: Claude Code's hidden Swarms feature

[6] Claude Code Docs: Sandboxing

[7] claude-agent-sdk-python#573: Subprocess inherits env vars