Documents
Feature Flags
Feature Flags
Type
Topic
Status
Published
Created
May 27, 2026
Updated
May 27, 2026
Template

Feature Flags#

Claude Code gates experimental and optional functionality through environment variable-based feature flags — there is no centralized flag registry or config file. Each flag is a discrete CLAUDE_CODE_* (or related prefix) environment variable read at startup.

Three deployment stages appear in the changelog:

  1. Research preview / opt-in — feature is off by default; set a specific env var to enable (e.g., CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1).
  2. Default-on with opt-out — feature ships enabled; set an env var to disable (e.g., CLAUDE_CODE_ENABLE_AWAY_SUMMARY=0).
  3. Graduated (GA) — flag removed; feature is unconditionally available (e.g., Auto mode no longer requires --enable-auto-mode) .

Important caveat: Feature flags are read during early startup and cached to disk. A bug caused stale cached values to persist across sessions; this was fixed in v2.1.70. When a flag isn't taking effect, restart Claude Code to force a fresh read.

When a background session or --bg rejects a flag-gated feature, the rejection message names the specific gate (non-TTY, env var, or managed setting), making it easier to diagnose which condition is blocking the feature.

Feature Flag Catalog#

Opt-in / Research Previews#

These flags enable features that are off by default:

Environment VariableEffectIntroduced
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1Multi-agent collaboration (token-intensive)v2.1.32
CLAUDE_CODE_NO_FLICKER=1Flicker-free alt-screen renderer with virtualized scrollbackv2.1.89
CLAUDE_CODE_FORK_SUBAGENT=1Forked subagents in non-interactive SDK sessionsv2.1.117
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1Gateway /v1/models discovery for the /model picker (was automatic in v2.1.126–2.1.128, then moved to opt-in)v2.1.129
ENABLE_TOOL_SEARCHMCP tool search on Vertex AI (disabled there by default)
ENABLE_PROMPT_CACHING_1H1-hour prompt cache TTL on API key, Bedrock, Vertex, and Foundryv2.1.108
CLAUDE_CODE_OPUS_4_6_FAST_MODE_OVERRIDE=1Pin fast mode to Opus 4.6 instead of 4.7v2.1.142
CLAUDE_CODE_USE_POWERSHELL_TOOL=1Enable PowerShell tool on Linux/macOS (requires pwsh)v2.1.111

Opt-out Flags (default-on features)#

These flags disable features that are on by default:

Environment VariableEffectIntroduced
CLAUDE_CODE_ENABLE_AWAY_SUMMARY=0Disable session recapv2.1.110
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1Strip experimental beta API headers; fixes proxy/gateway compatibilityv2.1.81
CLAUDE_CODE_ENABLE_TASKS=falseKeep old task system (temporary escape hatch)v2.1.19
CLAUDE_CODE_DISABLE_1M_CONTEXTDisable 1M context window supportv2.1.50
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSDisable background task functionality and Ctrl+Bv2.1.4
DISABLE_UPDATESBlock all update paths including manual claude updatev2.1.118
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACKDisable fallback to non-streaming when streaming failsv2.1.83
ENABLE_CLAUDEAI_MCP_SERVERS=falseOpt out of claude.ai MCP serversv2.1.63

Enterprise / Observability Flags#

These flags expose additional enterprise monitoring or survey features:

Environment VariableEffectIntroduced
CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTELRe-enable session quality survey for enterprises capturing via OpenTelemetryv2.1.136
OTEL_LOG_USER_PROMPTSInclude user prompt text in OTel spans (sensitive; opt-in)v2.1.101
OTEL_LOG_TOOL_DETAILSInclude tool parameter details in OTel eventsv2.1.101
OTEL_LOG_RAW_API_BODIESEmit full API request/response bodies as OTel log eventsv2.1.111
OTEL_METRICS_INCLUDE_ENTRYPOINT=trueAdd session entrypoint as OTel metric attributev2.1.152

Graduated Features (flags removed)#

Some features that began as flags have since become unconditional:

  • Agent View (claude agents) — introduced as research preview in v2.1.139 ; no flag required today.
  • Auto mode — previously required --enable-auto-mode; now available by default .
  • Channels (--channels) — added as research preview in v2.1.80 ; graduated since.
  • CLAUDE_CODE_NO_FLICKER=1 — flicker-free renderer was opt-in (v2.1.89), then became available as /tui fullscreen, then the default renderer .

Discovery and Debugging#

There is no centralized flag registry. The authoritative source for all feature flags is CHANGELOG.md, which documents each flag at introduction, modification, and removal.

Finding flags:

  • Search CHANGELOG.md for CLAUDE_CODE_ or env var to find flags near their introduction dates.
  • The /doctor command surfaces some configuration issues and flag states at runtime.
  • claude agents / --bg rejection messages name the specific gate (non-TTY, env var, or setting) blocking a feature .

Debugging stale flag values:
Flag values are read at early startup and cached to disk. If a flag change isn't taking effect, restart Claude Code to force a fresh read. This was a documented bug fixed in v2.1.70: "Fixed feature flags read during early startup never refreshing their disk cache, causing stale values to persist across sessions."

Setting flags:
Flags can be set as shell environment variables before invocation, or through the env block in settings.json to persist them across sessions. Provider-specific flags (e.g., CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX) follow the same convention but control API routing rather than feature gating.