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

Published on January 27, 2025

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.

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
CLAUDE_CODE_PLAN_V2_AGENT_COUNTNumber of agents in Plan v2 mode
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNTExploration agents in Plan v2

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.

Actually Useful Today#

VariablePurpose
CLAUDE_DEBUG=1Verbose debug logging
CLAUDE_CODE_API_BASE_URLCustom API endpoint 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_CONCURRENCYControl parallel tool execution

Debug & Profiling#

VariablePurpose
CLAUDE_CODE_DEBUG_LOGS_DIRDirectory for debug logs
CLAUDE_CODE_DIAGNOSTICS_FILEWrite diagnostics to file
CLAUDE_CODE_PERFETTO_TRACEPerfetto tracing (server-gated)
CLAUDE_CODE_PROFILE_STARTUP=1Profile startup performance

Disable Stuff#

VariableTurns Off
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYSurvey prompts
CLAUDE_CODE_DISABLE_ATTACHMENTSFile attachments
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGFile backups

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
VariableMy Guess
CLAUDE_AGENT_SDK_MCP_NO_PREFIXMCP without prefix in Agent SDK
CLAUDE_AGENT_SDK_VERSIONAgent SDK version
CLAUDE_AI_AUTHORIZE_URLAuthorization URL endpoint
CLAUDE_BASH_NO_LOGINDon't use login shell for bash
CLAUDE_CODE_ACCESSIBILITYAccessibility mode
CLAUDE_CODE_ACTIONCurrent action being performed
CLAUDE_CODE_ADDITIONAL_PROTECTIONEnable additional security protections
CLAUDE_CODE_AGENT_RULE_DISABLEDDisable agent rules
CLAUDE_CODE_AGENT_SWARMSOpt-out for agent swarms feature
CLAUDE_CODE_API_BASE_URLCustom API endpoint
CLAUDE_CODE_API_KEY_FILE_DESCRIPTORFile descriptor for API key
CLAUDE_CODE_ATTRIBUTION_HEADERAttribution header value
CLAUDE_CODE_AUTO_CONNECT_IDEAuto-connect to IDE on startup
CLAUDE_CODE_BASE_REFBase git ref for comparisons
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATORShow sandbox indicator
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDEOverride rate limiting thresholds
CLAUDE_CODE_BUBBLEWRAPBubblewrap sandboxing (Linux)
CLAUDE_CODE_CONTAINER_IDContainer identifier
CLAUDE_CODE_DEBUG_LOGS_DIRDirectory for debug logs
CLAUDE_CODE_DIAGNOSTICS_FILEWrite diagnostics to file
CLAUDE_CODE_DISABLE_ATTACHMENTSDisable file attachments
CLAUDE_CODE_DISABLE_CLAUDE_MDSDisable CLAUDE.md file loading
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECKDisable command injection checks
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYDisable feedback survey prompts
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTINGDisable file checkpointing
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALLPrevent marketplace auto-install
CLAUDE_CODE_DONT_INHERIT_ENVDon't inherit parent environment
CLAUDE_CODE_EFFORT_LEVELControl effort/quality level
CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIESEmit summaries of tool usage
CLAUDE_CODE_ENABLE_CFCEnable CFC feature
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONEnable prompt suggestions
CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTINGSDK file checkpointing
CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENTAttach token usage to responses
CLAUDE_CODE_ENHANCED_TELEMETRY_BETAEnhanced telemetry (beta)
CLAUDE_CODE_ENTRYPOINTEntry point (cli/vscode/etc)
CLAUDE_CODE_EXTRA_BODYInject extra fields into API body
CLAUDE_CODE_FORCE_FULL_LOGOShow full ASCII logo
CLAUDE_CODE_GIT_BASH_PATHPath to git bash (Windows)
CLAUDE_CODE_GLOB_HIDDENInclude hidden files in globs
CLAUDE_CODE_GLOB_NO_IGNOREDon't respect .gitignore in globs
CLAUDE_CODE_GLOB_TIMEOUT_SECONDSTimeout for glob operations
CLAUDE_CODE_HOST_HTTP_PROXY_PORTHTTP proxy port
CLAUDE_CODE_HOST_SOCKS_PROXY_PORTSOCKS proxy port
CLAUDE_CODE_IDE_HOST_OVERRIDEOverride IDE connection host
CLAUDE_CODE_IDE_SKIP_VALID_CHECKSkip IDE validation checks
CLAUDE_CODE_MAX_RETRIESMax API retry attempts
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYControl parallel tool execution
CLAUDE_CODE_OAUTH_CLIENT_IDOAuth client ID
CLAUDE_CODE_OAUTH_TOKENOAuth token
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTORFile descriptor for OAuth token
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MSOpenTelemetry flush timeout
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MSOpenTelemetry shutdown timeout
CLAUDE_CODE_PERFETTO_TRACEPerfetto tracing file path
CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASEControl plan mode interview phase
CLAUDE_CODE_PLAN_MODE_REQUIREDForce plan mode for all tasks
CLAUDE_CODE_PLAN_V2_AGENT_COUNTNumber of agents in Plan v2
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNTExploration agents in Plan v2
CLAUDE_CODE_PROFILE_QUERYProfile query execution
CLAUDE_CODE_PROFILE_STARTUPProfile startup performance
CLAUDE_CODE_REMOTEEnable remote mode
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPEType of remote environment
CLAUDE_CODE_REMOTE_SESSION_IDRemote session identifier
CLAUDE_CODE_SESSION_ACCESS_TOKENSession access token
CLAUDE_CODE_SESSION_IDCurrent session identifier
CLAUDE_CODE_SIMPLETONSimplified/basic mode
CLAUDE_CODE_SKIP_PROMPT_HISTORYSkip prompt history
CLAUDE_CODE_SSE_PORTServer-Sent Events port
CLAUDE_CODE_SYNTAX_HIGHLIGHTControl syntax highlighting
CLAUDE_CODE_TAGSTags for categorization
CLAUDE_CODE_TEAMMATE_COMMANDCommand for teammate/cowork
CLAUDE_CODE_TEST_FIXTURES_ROOTTest fixtures directory
CLAUDE_CODE_TMUX_PREFIXTmux prefix key
CLAUDE_CODE_TMUX_PREFIX_CONFLICTSHandle tmux prefix conflicts
CLAUDE_CODE_TMUX_SESSIONTmux session name
CLAUDE_CODE_USE_COWORK_PLUGINSEnable cowork plugins
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTORWebSocket auth file descriptor
CLAUDE_DEBUGEnable debug mode
CLAUDE_ENV_FILEPath to environment file
CLAUDE_FORCE_DISPLAY_SURVEYForce display of survey
CLAUDE_PLUGIN_ROOTRoot directory for plugins
CLAUDE_PROJECT_DIROverride project directory
CLAUDE_REPL_MODE0REPL mode flag
CLAUDE_TMPDIRTemp directory