Feature Flags & Hidden Commands

Claude Code uses two distinct feature flag systems: compile-time flags via bun:bundle for dead code elimination (DCE), and runtime flags via GrowthBook for A/B testing and gradual rollouts. On top of these, a collection of hidden slash commands and environment variables provide undocumented control over behaviour.

Compile-Time Flags (bun:bundle)

These flags are resolved at build time. The bundler evaluates feature('FLAG_NAME') calls to true or false, then DCE strips the dead branches entirely from the output. In the external npm build, all internal-only features resolve to false and their code is eliminated.

Flag Purpose Availability
COORDINATOR_MODE Enables the orchestrator pattern where Claude manages worker sub-agents Internal
KAIROS Internal scheduling and task management system Internal
VOICE_MODE Voice input/output interaction mode Internal
BRIDGE_MODE IDE bridge integration for editor-side communication Internal
DAEMON Background daemon process for persistent agent execution Internal
PROACTIVE Proactive suggestions and actions without explicit user prompt Internal
ABLATION_BASELINE Disables all optimisations for A/B impact measurement Internal
DUMP_SYSTEM_PROMPT Outputs the full system prompt for debugging Internal
FORK_SUBAGENT Full context fork into a background agent process Public
BUILTIN_EXPLORE_PLAN_AGENTS Built-in Explore and Plan agents Public
VERIFICATION_AGENT Post-task verification agent that checks work quality Internal
CACHED_MICROCOMPACT Cache-aware microcompaction using API cache_edits Public
TOKEN_BUDGET Token budget management and enforcement Public
EXPERIMENTAL_SKILL_SEARCH Experimental skill discovery and search functionality Internal
NATIVE_CLIENT_ATTESTATION Client authenticity attestation for native builds Internal

How DCE Works

At build time, the bundler replaces feature() calls with literal booleans. The JavaScript engine's dead code elimination then strips unreachable branches.

Source Code (Before Build)
if (feature('VOICE_MODE')) { // Entire voice interaction system import { VoiceEngine } from './voice'; registerVoiceCommands(); }
External npm Build (After DCE)
if (false) { // This entire block is eliminated by DCE } // Result: zero bytes in the output bundle
Key Insight

This is why the npm-installed version of Claude Code is smaller and has fewer features than the internal Anthropic build. The features are not just hidden -- they are physically absent from the code.


ABLATION_BASELINE Flag

A special internal flag used to measure the cumulative impact of all optimisations. When enabled, it disables everything to establish a performance baseline.

The "Turn Everything Off" Switch

ABLATION_BASELINE sets multiple environment variables simultaneously to create a minimal, unoptimised baseline for A/B comparison.

High Impact
What ABLATION_BASELINE Enables
# When ABLATION_BASELINE is active, these are all set: CLAUDE_CODE_SIMPLE=1 # Minimal system prompt DISABLE_THINKING=1 # No extended thinking DISABLE_COMPACT=1 # No compaction DISABLE_AUTO_COMPACT=1 # No auto-compaction DISABLE_INTERLEAVED_THINKING=1 # No interleaved thinking DISABLE_BACKGROUND_TASKS=1 # No background tasks

GrowthBook Runtime Flags

Runtime feature flags are loaded at startup from GrowthBook (a feature flagging service). These use the tengu_ naming prefix -- "Tengu" being the internal codename for the Claude Code project.

Flag Likely Purpose
tengu_attribution_header Controls attribution header injection in API requests
tengu_hive_evidence Evidence collection for Hive (multi-agent coordination)
tengu_amber_stoat A/B test variant (colour + animal naming convention)
tengu_cobalt_raccoon A/B test variant
tengu_slate_heron A/B test variant
tengu_cache_plum_violet Cache strategy experiment
Naming Pattern

GrowthBook flags follow the pattern tengu_<colour>_<animal> for A/B tests and tengu_<feature> for permanent flags. Telemetry events also use the tengu_ prefix, making it easy to correlate feature flag states with usage data.


Hidden Slash Commands

These commands are registered in the source but not shown in /help output. They range from debugging tools to easter eggs.

Command What It Does Status
/bughunter Activates bug-hunting mode with specialised prompts for finding defects Hidden
/good-claude Positive reinforcement -- adjusts Claude's confidence and assertiveness Hidden
/stickers Easter egg -- opens StickerMule page for Claude Code stickers Hidden
/thinkback Replays Claude's internal thinking from the previous turn Hidden
/thinkback-play Animated playback of thinking with typing effect Hidden
/teleport Restores a conversation from a serialised state Hidden
/mock-limits Simulates rate limit / usage limit states for testing Hidden
/ant-trace Outputs Anthropic trace IDs for request debugging Internal
/debug-tool-call Shows raw tool call payloads and responses Hidden
/ctx_viz Visualises current context window contents and token distribution Hidden
/break-cache Forces cache invalidation on the next API call Hidden
/heapdump Dumps a V8 heap snapshot for memory profiling Internal
/passes Shows prompt transformation passes and their effects Hidden
/rewind Restores code AND conversation to a previous checkpoint Hidden
/reset-limits Resets internal rate limit counters Hidden
/backfill-sessions Backfills missing session metadata from conversation logs Internal
/btw Injects an out-of-band message into the conversation without a model turn Hidden
/extra-usage Displays extended usage statistics beyond what /stats shows Hidden

Conditionally Available Commands

These commands only appear when their corresponding compile-time flag or environment condition is met.

Command Condition What It Does
/bridge BRIDGE_MODE flag enabled IDE bridge management and status
/voice VOICE_MODE flag enabled Toggle voice input/output
/mobile Mobile client detected Mobile-specific settings and layout
/agents-platform Anthropic internal build only Agent platform management and deployment
/remote-setup Remote execution environment Configure remote agent connection
/remote-env Remote execution environment Display remote environment details

Standard Visible Commands

For completeness, these are the commands that appear in /help output:

Command What It Does
/help Show available commands
/compact Compact conversation context (accepts custom instructions)
/clear Clear conversation and start fresh
/context Inspect current context window contents
/cost Show session cost breakdown
/diff Show files changed this session
/export Export conversation transcript
/memory Manage persistent memories
/stats Token usage and timing statistics
/permissions View and manage tool permissions
/config Open settings configuration

USER_TYPE Gate

The primary mechanism for separating internal Anthropic builds from external npm builds.

Source Pattern
if (process.env.USER_TYPE === 'ant') { // Internal-only functionality registerInternalCommands(); enableTelemetryDashboard(); } // In external builds, DCE strips this entire block because // USER_TYPE is resolved at compile time to a non-'ant' value
Important

Setting USER_TYPE=ant at runtime does nothing in the npm build. The check is resolved at compile time by the bundler, so the internal code blocks are physically absent from the distributed package. There is no way to unlock internal features in the public build.


Environment Variable Toggles

These environment variables are checked at runtime and can be set by any user to modify behaviour.

Variable Effect Type
CLAUDE_CODE_SIMPLE Minimal system prompt -- strips nearly all instructions Env
CLAUDE_CODE_DISABLE_THINKING Disables extended thinking entirely Env
DISABLE_INTERLEAVED_THINKING Disables thinking between tool calls Env
DISABLE_COMPACT Disables all compaction (manual and auto) Env
DISABLE_AUTO_COMPACT Disables auto-compaction only (manual /compact still works) Env
DISABLE_BACKGROUND_TASKS Disables all background tasks (memory extraction, dreams, etc.) Env
CLAUDE_CODE_DISABLE_AUTO_MEMORY Disables auto-memory extraction specifically Env
CLAUDE_CODE_AUTO_COMPACT_WINDOW Override auto-compact threshold (token count) Env
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE Trigger compaction at specific percentage of context used Env
CLAUDE_CODE_DISABLE_1M_CONTEXT Disable 1M context window even if model supports it Env
CLAUDE_CODE_MAX_CONTEXT_TOKENS Cap maximum context tokens Env
CLAUDE_CODE_COORDINATOR_MODE Enable coordinator mode (orchestrate worker agents) Env
CLAUDE_CODE_FORK_SUBAGENT Enable full context fork into background agents Env
Usage

Set these as environment variables before launching Claude Code. For example: CLAUDE_CODE_SIMPLE=1 DISABLE_AUTO_COMPACT=1 claude. They take effect immediately for that session.


Flag Architecture Summary

Feature Flag Resolution Pipeline bun:bundle (Build Time) feature('X') -> true/false DCE Strips Dead Code GrowthBook (Startup) tengu_* flag evaluation A/B Test + Gradual Rollout process.env (Runtime) CLAUDE_CODE_* checks User-Controllable Toggles USER_TYPE (Build Time) === 'ant' check + DCE Internal vs External Build