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:
| Variable | What It Does |
|---|---|
CLAUDE_CODE_AGENT_SWARMS | Opt-OUT only. Set to disable swarms |
CLAUDE_CODE_PLAN_V2_AGENT_COUNT | Number of agents in Plan v2 mode |
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT | Exploration 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#
| Variable | Purpose |
|---|---|
CLAUDE_DEBUG=1 | Verbose debug logging |
CLAUDE_CODE_API_BASE_URL | Custom API endpoint for proxies |
CLAUDE_CODE_DISABLE_CLAUDE_MDS=1 | Skip loading CLAUDE.md files |
CLAUDE_CODE_PLAN_MODE_REQUIRED=1 | Force plan mode for everything |
CLAUDE_CODE_GLOB_HIDDEN=1 | Include hidden files in globs |
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY | Control parallel tool execution |
Debug & Profiling#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_DEBUG_LOGS_DIR | Directory for debug logs |
CLAUDE_CODE_DIAGNOSTICS_FILE | Write diagnostics to file |
CLAUDE_CODE_PERFETTO_TRACE | Perfetto tracing (server-gated) |
CLAUDE_CODE_PROFILE_STARTUP=1 | Profile startup performance |
Disable Stuff#
| Variable | Turns Off |
|---|---|
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY | Survey prompts |
CLAUDE_CODE_DISABLE_ATTACHMENTS | File attachments |
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING | File 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
| Variable | My Guess |
|---|---|
CLAUDE_AGENT_SDK_MCP_NO_PREFIX | MCP without prefix in Agent SDK |
CLAUDE_AGENT_SDK_VERSION | Agent SDK version |
CLAUDE_AI_AUTHORIZE_URL | Authorization URL endpoint |
CLAUDE_BASH_NO_LOGIN | Don't use login shell for bash |
CLAUDE_CODE_ACCESSIBILITY | Accessibility mode |
CLAUDE_CODE_ACTION | Current action being performed |
CLAUDE_CODE_ADDITIONAL_PROTECTION | Enable additional security protections |
CLAUDE_CODE_AGENT_RULE_DISABLED | Disable agent rules |
CLAUDE_CODE_AGENT_SWARMS | Opt-out for agent swarms feature |
CLAUDE_CODE_API_BASE_URL | Custom API endpoint |
CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR | File descriptor for API key |
CLAUDE_CODE_ATTRIBUTION_HEADER | Attribution header value |
CLAUDE_CODE_AUTO_CONNECT_IDE | Auto-connect to IDE on startup |
CLAUDE_CODE_BASE_REF | Base git ref for comparisons |
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR | Show sandbox indicator |
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE | Override rate limiting thresholds |
CLAUDE_CODE_BUBBLEWRAP | Bubblewrap sandboxing (Linux) |
CLAUDE_CODE_CONTAINER_ID | Container identifier |
CLAUDE_CODE_DEBUG_LOGS_DIR | Directory for debug logs |
CLAUDE_CODE_DIAGNOSTICS_FILE | Write diagnostics to file |
CLAUDE_CODE_DISABLE_ATTACHMENTS | Disable file attachments |
CLAUDE_CODE_DISABLE_CLAUDE_MDS | Disable CLAUDE.md file loading |
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK | Disable command injection checks |
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY | Disable feedback survey prompts |
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING | Disable file checkpointing |
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL | Prevent marketplace auto-install |
CLAUDE_CODE_DONT_INHERIT_ENV | Don't inherit parent environment |
CLAUDE_CODE_EFFORT_LEVEL | Control effort/quality level |
CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES | Emit summaries of tool usage |
CLAUDE_CODE_ENABLE_CFC | Enable CFC feature |
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION | Enable prompt suggestions |
CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING | SDK file checkpointing |
CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT | Attach token usage to responses |
CLAUDE_CODE_ENHANCED_TELEMETRY_BETA | Enhanced telemetry (beta) |
CLAUDE_CODE_ENTRYPOINT | Entry point (cli/vscode/etc) |
CLAUDE_CODE_EXTRA_BODY | Inject extra fields into API body |
CLAUDE_CODE_FORCE_FULL_LOGO | Show full ASCII logo |
CLAUDE_CODE_GIT_BASH_PATH | Path to git bash (Windows) |
CLAUDE_CODE_GLOB_HIDDEN | Include hidden files in globs |
CLAUDE_CODE_GLOB_NO_IGNORE | Don't respect .gitignore in globs |
CLAUDE_CODE_GLOB_TIMEOUT_SECONDS | Timeout for glob operations |
CLAUDE_CODE_HOST_HTTP_PROXY_PORT | HTTP proxy port |
CLAUDE_CODE_HOST_SOCKS_PROXY_PORT | SOCKS proxy port |
CLAUDE_CODE_IDE_HOST_OVERRIDE | Override IDE connection host |
CLAUDE_CODE_IDE_SKIP_VALID_CHECK | Skip IDE validation checks |
CLAUDE_CODE_MAX_RETRIES | Max API retry attempts |
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY | Control parallel tool execution |
CLAUDE_CODE_OAUTH_CLIENT_ID | OAuth client ID |
CLAUDE_CODE_OAUTH_TOKEN | OAuth token |
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR | File descriptor for OAuth token |
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS | OpenTelemetry flush timeout |
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS | OpenTelemetry shutdown timeout |
CLAUDE_CODE_PERFETTO_TRACE | Perfetto tracing file path |
CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE | Control plan mode interview phase |
CLAUDE_CODE_PLAN_MODE_REQUIRED | Force plan mode for all tasks |
CLAUDE_CODE_PLAN_V2_AGENT_COUNT | Number of agents in Plan v2 |
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT | Exploration agents in Plan v2 |
CLAUDE_CODE_PROFILE_QUERY | Profile query execution |
CLAUDE_CODE_PROFILE_STARTUP | Profile startup performance |
CLAUDE_CODE_REMOTE | Enable remote mode |
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE | Type of remote environment |
CLAUDE_CODE_REMOTE_SESSION_ID | Remote session identifier |
CLAUDE_CODE_SESSION_ACCESS_TOKEN | Session access token |
CLAUDE_CODE_SESSION_ID | Current session identifier |
CLAUDE_CODE_SIMPLETON | Simplified/basic mode |
CLAUDE_CODE_SKIP_PROMPT_HISTORY | Skip prompt history |
CLAUDE_CODE_SSE_PORT | Server-Sent Events port |
CLAUDE_CODE_SYNTAX_HIGHLIGHT | Control syntax highlighting |
CLAUDE_CODE_TAGS | Tags for categorization |
CLAUDE_CODE_TEAMMATE_COMMAND | Command for teammate/cowork |
CLAUDE_CODE_TEST_FIXTURES_ROOT | Test fixtures directory |
CLAUDE_CODE_TMUX_PREFIX | Tmux prefix key |
CLAUDE_CODE_TMUX_PREFIX_CONFLICTS | Handle tmux prefix conflicts |
CLAUDE_CODE_TMUX_SESSION | Tmux session name |
CLAUDE_CODE_USE_COWORK_PLUGINS | Enable cowork plugins |
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR | WebSocket auth file descriptor |
CLAUDE_DEBUG | Enable debug mode |
CLAUDE_ENV_FILE | Path to environment file |
CLAUDE_FORCE_DISPLAY_SURVEY | Force display of survey |
CLAUDE_PLUGIN_ROOT | Root directory for plugins |
CLAUDE_PROJECT_DIR | Override project directory |
CLAUDE_REPL_MODE0 | REPL mode flag |
CLAUDE_TMPDIR | Temp directory |