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:
| Variable | Purpose |
|---|---|
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS | Enable Agent Teams (the official release of Swarms). Each agent works in an independent Git Worktree [1] |
CLAUDE_CODE_SUBAGENT_MODEL | Force a specific model for sub-agent operations |
CLAUDE_CODE_MAX_OUTPUT_TOKENS | Maximum output tokens; validated per-model |
MAX_THINKING_TOKENS | Maximum tokens for extended thinking; enables when greater than 0 |
CLAUDE_CODE_SHELL | Override shell for Bash tool (must be bash or zsh) |
CLAUDE_CODE_DISABLE_AUTO_MEMORY | Disable automatic memory (MEMORY.md) |
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING | Disable adaptive thinking mode |
CLAUDE_CODE_DISABLE_THINKING | Completely disable extended thinking |
CLAUDE_CODE_ATTRIBUTION_HEADER | Controls 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_LEVEL | Reasoning effort: low, medium, or high (default). Controls adaptive thinking depth [4] |
CLAUDE_CODE_ENABLE_CFC | Enable Claude for Chrome browser automation |
CLAUDE_CODE_SIMPLE | Simplified 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:
| Variable | What It Does |
|---|---|
CLAUDE_CODE_AGENT_SWARMS | Opt-OUT only. Set to disable swarms [5] |
CLAUDE_CODE_PLAN_V2_AGENT_COUNT | Number of agents in Plan v2 mode (1–10) |
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT | Exploration 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#
| Variable | Purpose |
|---|---|
CLAUDE_DEBUG=1 | Verbose debug logging |
CLAUDE_CODE_API_BASE_URL | Custom Claude Code API base URL 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 | Max concurrent tool executions; default 10 |
Debug & Profiling#
| Variable | Purpose |
|---|---|
CLAUDE_CODE_DEBUG_LOGS_DIR | Custom directory for debug logs |
CLAUDE_CODE_DIAGNOSTICS_FILE | Path to write diagnostics output |
CLAUDE_CODE_PERFETTO_TRACE | Enable Perfetto trace output to file path (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/image attachments |
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING | Git-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
| Variable | Description |
|---|---|
CLAUDE_AGENT_SDK_MCP_NO_PREFIX | Don't prefix MCP tool names with server name |
CLAUDE_AGENT_SDK_VERSION | Agent SDK version sent in User-Agent header |
CLAUDE_AI_AUTHORIZE_URL | Authorization URL endpoint |
CLAUDE_BASH_NO_LOGIN | Don't use login shell for bash commands |
CLAUDE_CODE_ACCESSIBILITY | Enable accessibility mode; disables cursor hiding |
CLAUDE_CODE_ACTION | Indicates running as GitHub Action |
CLAUDE_CODE_ADDITIONAL_PROTECTION | Add additional protection header to API requests |
CLAUDE_CODE_AGENT_RULE_DISABLED | Disable agent rules |
CLAUDE_CODE_AGENT_SWARMS | Opt-OUT for agent swarms feature (now superseded by CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS) [5] |
CLAUDE_CODE_API_BASE_URL | Custom Claude Code API base URL |
CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR | File descriptor to read API key from |
CLAUDE_CODE_ATTRIBUTION_HEADER | Controls 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_IDE | Auto-connect to IDE on startup |
CLAUDE_CODE_BASE_REF | Git base ref for diff operations |
CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR | Show indicator when bash runs in sandbox |
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE | Override token limit for input blocking |
CLAUDE_CODE_BUBBLEWRAP | Set to 1 when running in bubblewrap sandbox (Linux) [6] |
CLAUDE_CODE_CONTAINER_ID | Container/pod identifier sent in HTTP headers |
CLAUDE_CODE_DEBUG_LOGS_DIR | Custom directory for debug logs |
CLAUDE_CODE_DIAGNOSTICS_FILE | Path to write diagnostics output |
CLAUDE_CODE_DISABLE_ATTACHMENTS | Disable file/image attachments |
CLAUDE_CODE_DISABLE_CLAUDE_MDS | Disable loading CLAUDE.md files |
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECK | Disable command injection security check |
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY | Disable feedback survey popup |
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING | Disable git-based file checkpointing |
CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL | Disable automatic plugin installation from marketplace |
CLAUDE_CODE_DONT_INHERIT_ENV | Start shell with empty environment |
CLAUDE_CODE_EFFORT_LEVEL | Reasoning effort: low, medium, or high (default). Controls adaptive thinking depth [4] |
CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES | Emit tool use summary events |
CLAUDE_CODE_ENABLE_CFC | Enable Claude for Chrome browser automation |
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION | Enable/disable prompt suggestions |
CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING | Enable file checkpointing in SDK mode |
CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT | Attach token usage info to messages |
CLAUDE_CODE_ENHANCED_TELEMETRY_BETA | Enable enhanced telemetry (beta) |
CLAUDE_CODE_ENTRYPOINT | Application entry point; auto-set based on context (e.g. cli, vscode, sdk-py) [7] |
CLAUDE_CODE_EXTRA_BODY | Additional JSON merged into API request bodies |
CLAUDE_CODE_FORCE_FULL_LOGO | Force full ASCII logo display on startup |
CLAUDE_CODE_GIT_BASH_PATH | Git Bash executable path (Windows) |
CLAUDE_CODE_GLOB_HIDDEN | Include hidden files in globs |
CLAUDE_CODE_GLOB_NO_IGNORE | Ignore .gitignore rules in globs |
CLAUDE_CODE_GLOB_TIMEOUT_SECONDS | Timeout for glob operations; default 20s (WSL: 60s) |
CLAUDE_CODE_HOST_HTTP_PROXY_PORT | HTTP proxy port for host |
CLAUDE_CODE_HOST_SOCKS_PROXY_PORT | SOCKS proxy port for host |
CLAUDE_CODE_IDE_HOST_OVERRIDE | Custom host address for IDE communication |
CLAUDE_CODE_IDE_SKIP_VALID_CHECK | Bypass IDE extension validation checks |
CLAUDE_CODE_MAX_RETRIES | Maximum API request retries |
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY | Max concurrent tool executions; default 10 |
CLAUDE_CODE_OAUTH_CLIENT_ID | Custom OAuth client ID |
CLAUDE_CODE_OAUTH_TOKEN | Pre-configured OAuth access token |
CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR | File descriptor to read OAuth token from |
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS | OpenTelemetry flush timeout; default 5000ms |
CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS | OpenTelemetry shutdown timeout; default 2000ms |
CLAUDE_CODE_PERFETTO_TRACE | Enable Perfetto trace output to file path |
CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE | Enable interview phase in plan mode |
CLAUDE_CODE_PLAN_MODE_REQUIRED | Require agents to use plan mode for all tasks |
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 for plan v2 (1–10) |
CLAUDE_CODE_PROFILE_QUERY | Enable per-query profiling; set to 1 |
CLAUDE_CODE_PROFILE_STARTUP | Enable startup profiling; set to 1 |
CLAUDE_CODE_REMOTE | Indicates running in remote/server mode |
CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE | Remote environment type sent in telemetry |
CLAUDE_CODE_REMOTE_SESSION_ID | Remote session identifier |
CLAUDE_CODE_SESSION_ACCESS_TOKEN | Session-scoped access token |
CLAUDE_CODE_SESSION_ID | Current session identifier |
CLAUDE_CODE_SIMPLETON | Simplified mode; disables CLAUDE.md and attachments (later renamed to CLAUDE_CODE_SIMPLE) |
CLAUDE_CODE_SKIP_PROMPT_HISTORY | Disable prompt history saving |
CLAUDE_CODE_SSE_PORT | Server-Sent Events port |
CLAUDE_CODE_SYNTAX_HIGHLIGHT | Disable syntax highlighting when set to false |
CLAUDE_CODE_TAGS | Custom tags for telemetry events |
CLAUDE_CODE_TEAMMATE_COMMAND | Command for teammate/cowork functionality |
CLAUDE_CODE_TEST_FIXTURES_ROOT | Root directory for test fixtures |
CLAUDE_CODE_TMUX_PREFIX | Tmux prefix key shown in detach instructions |
CLAUDE_CODE_TMUX_PREFIX_CONFLICTS | Show prefix twice when key conflicts in tmux |
CLAUDE_CODE_TMUX_SESSION | Tmux session name shown in UI header |
CLAUDE_CODE_USE_COWORK_PLUGINS | Use cowork_plugins directory instead of default |
CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR | File descriptor for WebSocket credentials |
CLAUDE_DEBUG | Enable debug logging |
CLAUDE_ENV_FILE | Path to environment file for session variables |
CLAUDE_FORCE_DISPLAY_SURVEY | Force feedback survey display |
CLAUDE_PLUGIN_ROOT | Root directory for plugins |
CLAUDE_PROJECT_DIR | Override project directory |
CLAUDE_REPL_MODE0 | REPL mode; adjusts available tools |
CLAUDE_TMPDIR | Alternative 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