Skip to content
analysis22 min read

Claude Code: 330+ Environment Variables and 32 Feature Flags Explained

Complete technical reference of all 330+ environment variables, 32 compile-time feature flags, and 22 runtime feature gates discovered in Claude Code v2.1.88. Organized by category with usage examples.

Author
Anthony M.
22 min readVerified April 8, 2026Tested hands-on
Claude Code 330+ Environment Variables and 32 Feature Flags
330+ env variables, 32 feature flags, 22 runtime gates — Claude Code's complete configuration surface

Most developers use Claude Code with default settings. The leaked source reveals they are barely scratching the surface. 330+ environment variables control everything from model selection to stealth mode. 32 compile-time feature flags gate unreleased systems like KAIROS, BUDDY, and VOICE. 22+ GrowthBook runtime gates enable A/B testing of features for specific user segments. This is the complete configuration reference — every variable, every flag, every hidden setting discovered in the v2.1.88 source leak.

What the Leak Revealed

330+
Environment Variables
32
Compile-Time Feature Flags
22+
Runtime Feature Gates
Visual diagram of Claude Code 330+ environment variables organized by category including Model, Behavior, Debug, Tools, Context, Agent Teams, Providers, Stealth, Proxy, and OpenTelemetry
Claude Code's configuration layer spans 31 categories of environment variables, from model selection to OpenTelemetry observability.

The leak originated from the @anthropic-ai/claude-code npm package, which shipped a 59.8 MB sourcemap file (cli.js.map) containing the full reconstructable TypeScript source. Security researcher Chaofan Shou identified the exposure, revealing approximately 1,900 source files, 43 built-in tools, 26 hidden slash commands, and the internal codename for the project: Tengu (a supernatural creature from Japanese mythology).

Claude Code 32 compile-time feature flags
32 compile-time flags gate unreleased systems like KAIROS, BUDDY, and VOICE

32 Compile-Time Feature Flags

Claude Code uses Bun's feature() function at bundle time. These flags trigger constant-folding and dead-code elimination — in external builds, disabled flags compile to false and associated code is stripped entirely. This means the unreleased features exist in the source but never execute in the production binary.

#FlagDescriptionStatus
1KAIROSPersistent always-on assistant mode. Background daemon with push notifications, file sending, channel support. Named after the Greek concept of the "opportune moment." Referenced 150+ times in source.Not shipped
2PROACTIVEProactive behavior: sleep tool, actions without user input, 15-second blocking budget. Coupled with KAIROS.Not shipped
3COORDINATOR_MODEMulti-agent orchestrator: a lead Claude spawns and manages parallel worker agents, then synthesizes results.Not shipped
4BRIDGE_MODERemote control infrastructure via claude.ai. Bridge connection between local session and web interface.Partially released
5DAEMONBackground daemon workers for persistent sessions, tmux integration.Not shipped
6BG_SESSIONSBackground session management: list, logs, reattach, kill.Not shipped
7ULTRAPLAN30-minute cloud planning sessions via Opus 4.6 on Cloud Container Runtime (CCR). Human approval via browser before execution.Not shipped
8BUDDYFull Tamagotchi companion system. 18 species (duck, dragon, axolotl, capybara, mushroom, ghost...), rarity from common to 1% legendary, cosmetics (hats, shiny variants), 5 stats: DEBUGGING, PATIENCE, CHAOS, WISDOM, SNARK.Easter egg (April 2026)
9VOICE_MODEPush-to-talk voice interface activated via /voice. Audio input/output.Not shipped
10CHICAGO_MCPComputer Use via MCP — full GUI automation (mouse, clicks, screenshots). Internal codename "Chicago." Active for Max/Pro.Partially released
11UDS_INBOXCross-session IPC via Unix Domain Sockets. Claude sessions on the same machine exchange messages like an AI team chat.Not shipped
12TEMPLATESJob classifier and task templates for structured missions.Not shipped
13TORCHInternal, undocumented feature. Likely related to workflow illumination/guidance.Not shipped
14WORKFLOW_SCRIPTSWorkflow automation tool, pipeline script execution.Not shipped
15REACTIVE_COMPACTReactive context compaction for dynamic window management.Not shipped
16CONTEXT_COLLAPSEContext window inspection and restructuring. Activates CtxInspectTool.Not shipped
17HISTORY_SNIPAggressive conversation history trimming.Not shipped
18CACHED_MICROCOMPACTCached micro-compactions for memory optimization.Not shipped
19TOKEN_BUDGETPer-task/session token budget management.Not shipped
20EXTRACT_MEMORIESAutomatic memory extraction from conversations.Not shipped
21OVERFLOW_TESTOverflow limit testing tool.Internal/test
22TERMINAL_PANELTerminal panel capture for IDE integration.Not shipped
23WEB_BROWSERNative web browser automation tool.Not shipped
24FORK_SUBAGENTFork sub-agents from a main agent.Not shipped
25DUMP_SYS_PROMPTSystem prompt extraction. Employee-only (ant).Internal only
26ABLATION_BASEBootstrap simplification toggles for ablation studies.Internal/research
27BYOC_RUNNERBring Your Own Compute — self-hosted runner.Not shipped
28SELF_HOSTEDSelf-hosted mode for on-premise deployments.Not shipped
29MONITOR_TOOLMCP monitoring tool for agent surveillance.Not shipped
30CCR_AUTOAutomatic Cloud Container Runtime activation.Not shipped
31MEM_SHAPE_TELMemory shape telemetry.Not shipped
32SKILL_SEARCHExperimental skill discovery.Not shipped

Additional Flags Identified in Extended Analysis

Beyond the core 32 flags, several additional compile-time flags were identified:

  • NATIVE_CLIENT_ATTESTATION — Native client attestation (placeholder hash cch=00000)
  • ANTI_DISTILLATION_CC — Injects fake decoy tools into API requests to poison training data of competing models
  • TRANSCRIPT_CLASSIFIER — Automatic session transcript classification
  • KAIROS_BRIEF — Brief mode for the persistent KAIROS assistant
  • KAIROS_GITHUB_WEBHOOKS — GitHub integration via SubscribePRTool for autonomous PR reactions
  • LODESTONE — Undocumented feature
  • CLAUDE_CODE_VERIFY_PLAN — Plan execution verification tool
Architecture diagram showing how Claude Code 32 compile-time feature flags use Bun constant-folding to strip unreleased code from production builds
Feature flags use Bun's constant-folding: disabled flags compile to false and strip associated code from the production binary.

22+ Runtime Feature Gates via GrowthBook

While compile-time flags are baked into the binary, runtime feature gates use GrowthBook for remote control. All gates are prefixed with tengu_ (the project's internal codename) and many use obfuscated random word pairs like tengu_frond_boric to hide their purpose. Values are aggressively cached via getFeatureValue_CACHED_MAY_BE_STALE() to avoid blocking the main loop.

Critical implication: Anthropic can enable or disable these flags remotely without requiring a user update, via hourly polling to a remote settings endpoint.

#Gate NameDescription
1tengu_anti_distill_fake_tool_injectionInjects fake decoy tools into the system prompt for first-party CLI sessions. Poisons training data of competing models.
2tengu_attribution_headerKill-switch for the x-anthropic-billing-header attribution header.
3tengu_malort_pedwayGate for full Computer Use — GUI automation (mouse, clicks, screenshots). Obfuscated name.
4tengu_penguins_offKill-switch for Penguin Mode (Fast Mode). Globally disables fast mode.
5tengu_onyx_ploverActivates the Auto-Dream system (overnight memory consolidation). Obfuscated name.
6tengu_kairosMain gate for the persistent KAIROS assistant mode.
7tengu_ultraplan_modelSelects the model for ULTRAPLAN cloud sessions (default: Opus 4.6).
8tengu_cobalt_raccoonControls auto-compact (automatic context compaction). Obfuscated name.
9tengu_scratchShared scratchpad directory for multi-agent coordination.
10tengu_amber_flintGate for Agent Teams/Swarm with team memory synchronization.
11tengu_consolidated_modeActivates the memory consolidation/dream system.
12tengu_portal_quailObfuscated gate, exact function undocumented.
13tengu_harborObfuscated gate, likely related to feature porting/hosting.
14tengu_herring_clockObfuscated gate, exact function undocumented.
15tengu_chomp_inflectionObfuscated gate, exact function undocumented.
16tengu_amber_quartz_disabledKill-switch for Voice Mode. Obfuscated name.
17tengu_ultraplan_teleport_localSentinel for remote ULTRAPLAN result retrieval.
18tengu_speculationGate for Speculation mode (speculative pre-execution of actions).
19tengu_startup_telemetryStartup telemetry analytics event.
20tengu_mcp_channel_flagsMCP channel flags for telemetry.
21tengu_agent_flagAgent flag for telemetry and gating.
22tengu_org_penguin_mode_fetch_failedAnalytics event when org-level Penguin Mode fetch fails.

Remote Kill-Switches

The codebase contains 6+ remote kill-switches capable of:

  • Bypassing permission prompts
  • Enabling/disabling Fast Mode globally
  • Toggling Voice Mode
  • Controlling analytics collection
  • Forcing complete application exit
Claude Code environment variables organized by category
Environment variables organized by category — from model selection to debug flags

330+ Environment Variables: Complete Reference by Category

The environment variables fall into 31 distinct categories. Below we cover the most significant ones that developers and power users can actually leverage.

Authentication and API (25 variables)

These control how Claude Code authenticates with the Anthropic API, including API keys, OAuth tokens, and custom authentication workflows.

VariableDescription
ANTHROPIC_API_KEYPrimary API key (highest priority)
ANTHROPIC_AUTH_TOKENBearer token override when no API key
ANTHROPIC_BASE_URLOverride base API URL (for proxies/gateways)
ANTHROPIC_CUSTOM_HEADERSCustom HTTP headers for API requests
ANTHROPIC_BETASList of API betas to enable
CLAUDE_CODE_OAUTH_TOKENOAuth token (e.g., GitHub Actions)
CLAUDE_CODE_SESSION_ACCESS_TOKENSession access token

Model Configuration (18 variables)

The model configuration layer is where power users get the most leverage. These variables control which models are used for different tasks.

VariableDescriptionExample
ANTHROPIC_MODELOverride the default model for all main requestsclaude-opus-4-6
CLAUDE_CODE_SUBAGENT_MODELModel for sub-agents/workers (use cheaper models to save costs)claude-sonnet-4-6
ANTHROPIC_SMALL_FAST_MODELModel for lightweight internal tasks (classification, etc.)claude-haiku-4-5
FALLBACK_FOR_ALL_PRIMARY_MODELSUniversal fallback model when primary is rate-limitedclaude-sonnet-4-6
CLAUDE_CODE_MAX_OUTPUT_TOKENSMaximum output token limit64000
MAX_THINKING_TOKENSThinking token budget (more = better quality on complex tasks)32000
CLAUDE_CODE_EFFORT_LEVELEffort level overridehigh
CLAUDE_CODE_MAX_RETRIESMaximum API retries5

Cloud Providers (33 variables)

Claude Code supports three alternative cloud providers beyond the direct Anthropic API: AWS Bedrock (16 vars), Google Vertex AI (12 vars), and Microsoft Azure Foundry (5 vars).

AWS Bedrock (16 variables)

export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=your_key
export AWS_SECRET_ACCESS_KEY=your_secret
# Optional: 1-hour prompt caching
export ENABLE_PROMPT_CACHING_1H_BEDROCK=1

Google Vertex AI (12 variables)

export CLAUDE_CODE_USE_VERTEX=1
export ANTHROPIC_VERTEX_PROJECT_ID=your_project_id
export CLOUD_ML_REGION=us-central1

Microsoft Azure Foundry (5 variables)

export CLAUDE_CODE_USE_FOUNDRY=1
export ANTHROPIC_FOUNDRY_BASE_URL=https://your-endpoint.azure.com
export ANTHROPIC_FOUNDRY_API_KEY=your_key

Behavior and UX (20+ variables)

VariableDescriptionStatus
DISABLE_TELEMETRY=1Zero telemetry sent to AnthropicConfirmed
DISABLE_AUTOUPDATER=1Disable automatic updates, control your versionConfirmed
DISABLE_COST_WARNINGS=1Remove cost warning popupsConfirmed
CLAUDE_CODE_BRIEF=1Shorter, more direct responsesConfirmed
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1Remove feedback survey popupsConfirmed
CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1Prevent Claude from modifying terminal titleConfirmed
CLAUDE_CODE_ACCESSIBILITY=1Accessibility mode (screen reader support)Confirmed
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1Prevent auto-writing to memory filesConfirmed
CLAUDE_CODE_OVERRIDE_DATEOverride the date Claude sees (for date-dependent testing)Confirmed
IDLE_THRESHOLD_MINUTESInactivity threshold before session is marked idle (default: 75 min)Confirmed

Debug and Profiling (8 variables)

VariableDescription
CLAUDE_DEBUG=1General debug mode, shows internal details
CLAUDE_CODE_DEBUG_LOG_LEVEL=debugDetailed debug log level
CLAUDE_CODE_DEBUG_LOGS_DIR=/tmp/claude-logsWrite debug logs to a specific directory
CLAUDE_CODE_DIAGNOSTICS_FILEGenerate a JSON diagnostics file
CLAUDE_CODE_PERFETTO_TRACE=1Generate Perfetto/Chrome DevTools-compatible performance trace
CLAUDE_CODE_PROFILE_STARTUP=1Profile and display startup time for each step
ANTHROPIC_LOG=1Display raw API requests/responses

Tools and Limits (12 variables)

VariableDescriptionExample
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYMaximum parallel tool executions5
CLAUDE_CODE_GLOB_HIDDEN=1Include hidden files in glob searches
CLAUDE_CODE_GLOB_TIMEOUT_SECONDSGlob timeout for large repos30
BASH_MAX_OUTPUT_LENGTHMaximum bash command output capture50000
CLAUDE_CODE_SHELLOverride detected shell/bin/zsh
MCP_TIMEOUTMCP timeout in ms60000
MCP_TOOL_TIMEOUTMCP tool-specific timeout120000
MAX_MCP_OUTPUT_TOKENSMaximum MCP output tokens50000
ENABLE_TOOL_SEARCH=1Enable dynamic MCP tool discovery
ENABLE_LSP_TOOL=1Enable Language Server Protocol tool

Context and Compaction (6 variables)

VariableDescription
CLAUDE_AUTOCOMPACT_PCT_OVERRIDECompact at X% context usage (e.g., 80)
CLAUDE_CODE_AUTO_COMPACT_WINDOWAuto-compaction window size
DISABLE_AUTO_COMPACT=1No auto compaction, manual /compact only
DISABLE_COMPACT=1Disable even manual /compact
ENABLE_SESSION_PERSISTENCE=1Sessions are saved and can be resumed
CLAUDE_CODE_RESUME_INTERRUPTED_TURNResume an interrupted turn

Agent Teams and Multi-Agent (8 variables)

These variables control Claude Code's multi-agent orchestration system, where a lead agent coordinates parallel workers.

VariableDescriptionStatus
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1Enable experimental agent teams (lead + parallel workers)Confirmed
CLAUDE_CODE_PLAN_V2_AGENT_COUNTNumber of agents in plan V2 mode (Max/Team: 3, Free: 1)Confirmed
CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNTNumber of explore-phase agentsSpeculative
CLAUDE_CODE_COORDINATOR_MODE=1Coordinator mode (1 lead orchestrates N workers)Speculative
CLAUDE_AUTO_BACKGROUND_TASKS=1Claude can launch background tasks automaticallySpeculative
TEAM_MEMORY_SYNC_URLTeam memory synchronization URLSpeculative

Stealth and Privacy (5 variables)

Undercover Mode

export CLAUDE_CODE_UNDERCOVER=1

Designed for Anthropic employees contributing to public repos. Removes all evidence of AI involvement: strips "Co-Authored-By: Claude" from commits, removes internal codenames ("Capybara", "Tengu"), removes Slack channel references, and instructs the system prompt with "Do not blow your cover."

While designed for employees, this variable is activatable by anyone.

VariableDescription
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1Scrubs sensitive env vars before passing them to sub-processes
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1Disables experimental betas including anti-distillation fake tool injection
DISABLE_ERROR_REPORTING=1No error reports sent to Anthropic
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1Disables all non-essential network traffic (analytics, checks, etc.)

OpenTelemetry Observability (22 variables)

Claude Code ships with full OpenTelemetry support, allowing developers to send traces, metrics, and logs to their own monitoring stack (Grafana, Datadog, Jaeger, etc.).

Custom Monitoring Setup

# Send everything to your own OTEL stack
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_TRACES_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp

# Full visibility into tool usage and prompts
export OTEL_LOG_TOOL_DETAILS=1
export OTEL_LOG_TOOL_CONTENT=1
export OTEL_LOG_USER_PROMPTS=1

Proxy and TLS (10 variables)

VariableDescription
HTTP_PROXY / HTTPS_PROXYRoute traffic through HTTP/HTTPS proxy
NO_PROXYProxy exclusions
NODE_EXTRA_CA_CERTSAdditional CA certificates (corporate proxies)
CLAUDE_CODE_CLIENT_CERTClient certificate for mTLS
CLAUDE_CODE_CLIENT_KEYClient key for mTLS
Terminal showing Claude Code power user configuration with environment variables for model selection, agent teams, debug profiling, and OpenTelemetry monitoring
Power users can combine model overrides, agent teams, and OTEL monitoring for enterprise-grade AI coding workflows.

Employee-Only: USER_TYPE=ant

The USER_TYPE === 'ant' guard restricts specific features to Anthropic employees. When active, employees gain access to:

FeatureDescription
Staging API accessclaude-ai.staging.ant.dev
Internal beta headersNon-public headers (cli-internal-2026-02-09)
Undercover Mode (auto)Automatically active except on whitelisted internal repos
/security-reviewSecurity audit command
/ant-traceInternal tracing
ConfigToolSettings modification (blocked externally)
TungstenToolAdvanced internal functionality
DUMP_SYS_PROMPTExtracts full system prompt to ~/.config/claude/dump-prompts/
Non-release modelsAccess to Capybara, Fennec, Numbat codenames
GUI restriction bypassALLOW_ANT_COMPUTER_USE_MCP bypasses GUI automation restrictions

15 API Beta Headers

These headers are sent in the anthropic-beta field of API requests. They follow the format feature-name-YYYY-MM-DD.

#Beta HeaderDescriptionDate
1interleaved-thinking-2025-05-14Interleaved thinking2025-05-14
2context-1m-2025-08-071M token context window2025-08-07
3structured-outputs-2025-12-15Structured outputs2025-12-15
4web-search-2025-03-05Web search2025-03-05
5advanced-tool-use-2025-11-20Advanced tool use2025-11-20
6effort-2025-11-24Effort levels2025-11-24
7task-budgets-2026-03-13Task budgets2026-03-13
8prompt-caching-scope-2026-01-05Prompt caching scope2026-01-05
9fast-mode-2026-02-01Fast Mode (Penguin)2026-02-01
10redact-thinking-2026-02-12Thinking redaction2026-02-12
11token-efficient-tools-2026-03-28Token-efficient tools2026-03-28
12afk-mode-2026-01-31AFK (Away From Keyboard) mode2026-01-31
13cli-internal-2026-02-09Internal CLI features (ant-only)2026-02-09
14advisor-tool-2026-03-01Advisor tool2026-03-01
15summarize-connector-text-2026-03-13Connector text summarization2026-03-13

Anti-Distillation in API Requests

When the ANTI_DISTILLATION_CC flag is active, Claude Code sends an anti_distillation field with the value ["fake_tools"]. This instructs the server to silently inject fake tool definitions into the system prompt. The purpose: if someone captures the API traffic to train a competing model, the fake tool definitions poison their training data.

The Most Useful Variables You Can Set Right Now

For developers who want to optimize their Claude Code experience immediately, here is the recommended power-user shell profile:

Recommended .bashrc / .zshrc additions

# Model: Force Opus for main, Sonnet for sub-agents (cost savings)
export ANTHROPIC_MODEL=claude-opus-4-6
export CLAUDE_CODE_SUBAGENT_MODEL=claude-sonnet-4-6
export FALLBACK_FOR_ALL_PRIMARY_MODELS=claude-sonnet-4-6

# Performance: Max thinking, max output
export MAX_THINKING_TOKENS=32000
export CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000
export CLAUDE_CODE_EFFORT_LEVEL=high

# Agent Teams: Enable multi-agent with 3 workers
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
export CLAUDE_CODE_PLAN_V2_AGENT_COUNT=3

# Privacy: Zero telemetry, zero surveys
export DISABLE_TELEMETRY=1
export DISABLE_AUTOUPDATER=1
export CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

# Tools: Higher concurrency and limits
export CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=5
export BASH_MAX_OUTPUT_LENGTH=50000
export MCP_TIMEOUT=60000
export MCP_TOOL_TIMEOUT=120000

# Debug (enable when needed)
# export CLAUDE_DEBUG=1
# export CLAUDE_CODE_PERFETTO_TRACE=1

Complete Variable Count by Category

CategoryCount
Authentication & API25
Model Configuration18
AWS Bedrock16
Google Vertex AI12
Microsoft Foundry5
Core Configuration29
Enable Flags20
Disable Flags35
Command Disablers9
Bash & Shell6
Tools Configuration12
MCP (Model Context Protocol)9
Plugins & Extensions8
Context & Compaction6
Agent SDK4
Agent Teams & Orchestration8
Remote & Cowork19
IDE Integration8
OpenTelemetry22
Datadog1
Proxy & TLS10
Tmux5
Git & CI Detection22
SWE-Bench & Testing7
Terminal Detection20
Cloud Platform Detection37
Azure Identity15
System & Runtime31
Node.js & Bun17
gRPC8
Internal & Special30+
Total330+

Frequently Asked Questions

How many environment variables does Claude Code actually use?

Claude Code v2.1.88 reads over 330 environment variables across 31 categories. These range from model configuration (18 vars) to OpenTelemetry observability (22 vars), cloud provider routing (33 vars), and security/privacy controls (35+ disable flags). About 50-60 of these are directly useful to end users, while the rest are internal, for CI/CD detection, or for cloud platform identification.

What are Claude Code's feature flags and how do they work?

Claude Code has two types of feature flags: 32 compile-time flags using Bun's feature() function (dead-code eliminated in production builds, so the features are in source but never execute), and 22+ runtime feature gates via GrowthBook prefixed with tengu_ that Anthropic can toggle remotely without user updates. Most unreleased features like KAIROS, BUDDY, and VOICE_MODE are behind compile-time flags.

Can regular users activate employee-only features like Undercover Mode?

The CLAUDE_CODE_UNDERCOVER=1 environment variable is technically activatable by any user, even though it was designed for Anthropic employees (USER_TYPE=ant). However, most employee-only features like /security-review, /ant-trace, TungstenTool, and access to non-release models (Capybara, Fennec, Numbat) are server-side gated by the USER_TYPE check and cannot be bypassed by setting environment variables alone.

What is the BUDDY feature flag in Claude Code?

BUDDY is an unreleased Tamagotchi-style companion system for Claude Code. It includes 18 species (duck, dragon, axolotl, capybara, mushroom, ghost), rarity tiers from common to 1% legendary, cosmetics like hats and shiny variants, and 5 stats: DEBUGGING, PATIENCE, CHAOS, WISDOM, and SNARK. The companion is seeded from the user's ID hash. It was planned as an April 2026 Easter egg teaser but the compile-time flag means it does not execute in production.

How can I optimize Claude Code performance with environment variables?

The most impactful confirmed variables are: ANTHROPIC_MODEL=claude-opus-4-6 (force Opus), CLAUDE_CODE_SUBAGENT_MODEL=claude-sonnet-4-6 (cheaper sub-agents), MAX_THINKING_TOKENS=32000 (more reasoning), CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000 (longer responses), CLAUDE_CODE_EFFORT_LEVEL=high (max effort), CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 with CLAUDE_CODE_PLAN_V2_AGENT_COUNT=3 (parallel agents), and CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY=5 (parallel tools). Combined, these can significantly improve output quality and speed on complex coding tasks.

Frequently Asked Questions

How many environment variables does Claude Code have?

The leaked source code of Claude Code v2.1.88 revealed over 330 environment variables spanning 31 categories, including model selection, behavior configuration, debugging, tools, context management, agent teams, provider settings, stealth mode, proxy configuration, and OpenTelemetry observability. Most developers use default settings and are unaware of the vast majority of these configuration options.

What are the 32 compile-time feature flags in Claude Code?

Claude Code uses Bun's feature() function to gate unreleased systems behind compile-time flags. The 32 flags include KAIROS (persistent daemon mode, 150+ source references), COORDINATOR_MODE (multi-agent orchestrator), BUDDY (Tamagotchi companion with 18 species), VOICE_MODE (push-to-talk interface), ULTRAPLAN (30-minute cloud planning via Opus 4.6), BRIDGE_MODE (remote control via claude.ai), DAEMON (background workers), and CHICAGO_MCP (Computer Use GUI automation). In public builds, disabled flags compile to false and associated code is stripped entirely.

What are GrowthBook runtime feature gates in Claude Code?

In addition to compile-time flags, Claude Code uses 22+ GrowthBook runtime feature gates prefixed with "tengu_" (the internal project codename). These gates enable A/B testing and gradual rollout of features for specific user segments. They are polled hourly and include gates for voice mode (tengu_amber_quartz at ~5% rollout), agent teams (tengu_amber_flint), AutoDream memory consolidation (tengu_onyx_plover), Fast Mode killswitch (tengu_penguins_off), and anti-distillation (tengu_anti_distill_fake_tool_injection).

Can users access Claude Code's hidden features using environment variables?

Some environment variables do unlock undocumented behavior. For example, USER_TYPE=ant activates internal Anthropic employee features, --dump-system-prompt shows the complete system prompt, and --bare launches Claude Code without hooks, plugins, or memory. However, Anthropic likely detects unauthorized usage of employee-only settings. The environment variable CLAUDE_CODE_ABLATION_BASELINE can disable all security features, making it a documented backdoor in the tool used by millions.

What is the difference between compile-time and runtime feature flags in Claude Code?

Compile-time flags (32 total) are evaluated during the Bun build process. When disabled, the associated code is completely eliminated via dead-code elimination and never exists in the production binary. Runtime feature gates (22+ via GrowthBook) are evaluated while the application runs, polling the GrowthBook server hourly. This means runtime gates can be toggled remotely without publishing a new npm package, while compile-time flags require a new build and release.

How were Claude Code's 330+ environment variables discovered?

On March 31, 2026, security researcher Chaofan Shou discovered a 59.8 MB source map file in the npm package @anthropic-ai/claude-code v2.1.88. The source map referenced a ZIP archive on Anthropic's Cloudflare R2 bucket containing the complete unobfuscated TypeScript source -- approximately 512,000 lines across 1,900 files. Analysis of this code by the community, including the ccleaks.com database, cataloged all 330+ environment variables, 32 feature flags, and 22+ runtime gates.

Does Claude Code have remote killswitches?

Yes. The leaked source reveals 6+ remote killswitches that Anthropic can activate without requiring any app update. These can bypass permission prompts, disable Fast Mode (tengu_penguins_off), toggle Voice Mode, control analytics collection, and force a full shutdown of Claude Code sessions. All killswitches operate through the GrowthBook runtime feature gate system, which polls for configuration changes every hour.

Related Articles

Was this review helpful?
Anthony M. — Founder & Lead Reviewer
Anthony M.Verified Builder

We're developers and SaaS builders who use these tools daily in production. Every review comes from hands-on experience building real products — DealPropFirm, ThePlanetIndicator, PropFirmsCodes, and many more. We don't just review tools — we build and ship with them every day.

Written and tested by developers who build with these tools daily.