Have you ever wondered: how are Claude Code’s “coming soon” features hidden? Why do some users see new features while others don’t with the same code?
The answer is Feature Flag - the “secret switches” in code. Today let’s uncover Claude Code’s 89 Feature Flags.
What is Feature Flag? The Switch in Code
Feature Flag is a software development technique: embed switches in code to control whether features are enabled.
Claude Code uses Bun’s feature() function:
if (feature('KAIROS')) {
const { assistant } = require('./assistant')
assistant.init()
}
At build time, feature('KAIROS') is replaced with true or false. If false, the entire code block is removed during tree-shaking - not only is the feature not enabled, the code doesn’t even exist.
This is like:
- Electrical outlets pre-installed during house renovation (feature pre-wiring)
- Plug in appliance to get power (switch enables)
- No appliance means wall is complete (tree-shaking removes)
The Five Camps of 89 Flags
Claude Code source code has 89 Feature Flags, divided into five categories by functional domain:
Camp 1: Autonomous Agent and Background Execution (18 flags)
Core Flag: KAIROS (154 references)
This most-referenced Flag represents Claude Code’s evolution toward “background autonomous Agent”:
- Terminal focus awareness (autonomous execution when user isn’t watching terminal)
- Scheduled wake-up (Tick mechanism)
- Brief communication (Brief mode)
- Multi-channel communication (Channels)
- GitHub Webhook subscriptions
Other important flags:
PROACTIVE: proactive work modeCOORDINATOR_MODE: cross-Agent coordinationBG_SESSIONS: background session managementAGENT_TRIGGERS: scheduled triggers
Camp 2: Remote Control and Distributed Execution (14 flags)
Core Flag: BRIDGE_MODE (28 references)
Implements remote control of Claude Code:
- Bridge mode: remote control protocol
- DAEMON: daemon background execution
- SSH_REMOTE: SSH remote connection
- UDS_INBOX: Unix Domain Socket communication
Use cases:
- Run Claude Code on server, control remotely locally
- Multi-machine distributed Agent collaboration
Camp 3: Context Management and Performance Optimization (17 flags)
Core Flag: TRANSCRIPT_CLASSIFIER (107 references)
Implements auto permission mode - uses AI classifier to decide if user confirmation is needed:
- Between
plan(confirm everything) andauto-accept(accept everything) - Smart judgment of operation risk level
Other important flags:
CONTEXT_COLLAPSE: granular context collapsingCACHED_MICROCOMPACT: cache micro-compressionTOKEN_BUDGET: token budget trackingPROMPT_CACHE_BREAK_DETECTION: cache break detection
Camp 4: Memory and Knowledge Management (9 flags)
Core Flag: TEAMMEM (51 references)
Implements team memory synchronization:
- Cross-session memory sharing
- Team knowledge base
- Automatic memory extraction
- Sensitive information protection (Secret Guard)
Other flags:
EXTRACT_MEMORIES: automatic memory extractionEXPERIMENTAL_SKILL_SEARCH: experimental skill searchSKILL_IMPROVEMENT: skill automatic improvement
Camp 5: UI/UX and Platform Capabilities (31 flags)
Core Flag: VOICE_MODE (46 references)
Voice input mode:
- Streaming speech-to-text
- Push-to-talk shortcut (spacebar)
Other important flags:
WEB_BROWSER_TOOL: Bun WebView browser integrationTERMINAL_PANEL: terminal panelCHICAGO_MCP: Computer Use MCP integrationPOWERSHELL_AUTO_MODE: PowerShell auto mode
Flag Maturity Spectrum
Maturity distribution of 89 flags:
| References | Flag Count | Maturity Stage |
|---|---|---|
| 100+ | 2 | Deep integration period |
| 30-99 | 6 | Full embedding period |
| 10-29 | 12 | Module integration period |
| 3-9 | 27 | Initial implementation period |
| 1-2 | 42 | Prototype exploration period |
Key observations:
- 47% of flags (42) have only 1-2 references, in prototype stage
- Only KAIROS (154) and TRANSCRIPT_CLASSIFIER (107) have reached deep integration
- Many experimental features are being explored
This is like:
- 100+ references: house is built, just waiting to open the door
- 30-99 references: main structure complete, interior finishing
- 10-29 references: frame built, still filling in walls
- 1-2 references: just finished sketching
Unreleased Features Revealed
KAIROS: Background Autonomous Assistant (154 references)
KAIROS is the most-referenced Flag,描绘了一个"Claude Code as background Agent"的愿景:
Core mechanisms:
- Focus awareness: detect if user is watching terminal
- Autonomous execution: automatically handle tasks when user is away
- Tick wake-up: scheduled check of to-do items
- Brief communication: report progress to user on key points
Use case:
You: Help me refactor this module
Claude: Sure, I'll handle it in the background and notify you when done
(You go do other things)
(Claude executes autonomously in background)
Claude: Refactoring complete, here's the change summary...
TRANSCRIPT_CLASSIFIER: Smart Permission Mode (107 references)
Current permission mode is binary:
plan: confirm every operationauto-accept: auto-accept everything
auto mode introduces AI classifier for smart judgment:
- Safe operations auto-approve
- Dangerous operations request confirmation
- Edge operations undergo deep analysis
This is like: changing from “either manage everything or nothing” to “smart security check.”
CONTEXT_COLLAPSE: Granular Context Management (20 references)
Current compression is “full compression” - when threshold is reached, entire conversation gets summarized.
CONTEXT_COLLAPSE implements “selective collapsing”:
- Only compress unimportant tool results
- Preserve key reasoning processes
- Reactive triggering (not scheduled check)
This is like: changing from “pack entire house when moving” to “only pack things you don’t use often.”
WEB_BROWSER_TOOL: Built-in Browser (4 references)
Based on Bun’s WebView API, embeds browser inside Claude Code:
- Not Playwright/Puppeteer external process
- Native integration, more efficient
- Can screenshot, interact, extract content
This is an AI assistant with “its own browser.”
Flag Dependency Relationships
Some flags have dependencies:
DAEMON → requires BRIDGE_MODE
KAIROS_DREAM → can be independent of KAIROS
CCR_MIRROR → sub-mode of BRIDGE_MODE
AGENT_TRIGGERS_REMOTE → extension of AGENT_TRIGGERS
Design philosophy:
- Sub-features can be enabled independently of parent
- Hard dependencies expressed with
&& - Soft associations expressed with
||
Three Build Configurations
Public Build
Overwhelming majority of flags are false. Only basic features enabled by default.
Internal Build (Ant Build)
When USER_TYPE === 'ant', more features enabled:
- Experimental skills
- Internal tools
- A/B testing features
Experiment Build
Specific flag combinations used for A/B testing:
TREE_SITTER_BASHvsTREE_SITTER_BASH_SHADOWABLATION_BASELINE: ablation experiment baseline
Practical: How to Enable Experimental Features
Via Environment Variables
Some flags exposed as environment variables:
export CLAUDE_CODE_COORDINATOR_MODE=true
export CLAUDE_CODE_EFFORT_LEVEL=high
Via Settings File
In settings.json:
{
"voiceEnabled": true,
"alwaysThinkingEnabled": true
}
Note
Not all flags can be enabled via user configuration. Many flags are build-time decisions that regular users cannot modify.
Implications for Building AI Agents
Pattern 1: Build-Time Dead Code Elimination
Use compile-time constant replacement and tree-shaking to ensure unenabled feature code doesn’t appear in production builds.
Pattern 2: Reference Count Infers Maturity
Count flag references in source code and cross-module distribution to assess feature integration depth.
Pattern 3: Flag Cluster Dependency Management
Express feature dependencies through && and ||, supporting independent sub-feature enablement.
Summary
89 Feature Flags reveal Claude Code’s engineering depth:
- Five camps: autonomous Agent, remote control, context management, memory knowledge, UI/UX
- Two cores: KAIROS (background autonomous) and TRANSCRIPT_CLASSIFIER (smart permissions)
- Maturity distribution: 47% in prototype stage, few deeply integrated
- Evolution direction: from “interactive assistant” to “background autonomous Agent”
This is like:
- Feature Flag is “pre-installed outlet” in code
- Some already have appliances plugged in (deeply integrated)
- Some only have positions marked (prototype stage)
- Some still on design drawings (being explored)
Understanding Feature Flags lets you:
- Predict Claude Code’s development direction
- Understand experimental feature implementation mechanisms
- Apply similar techniques in your own projects
Next up: Cross-Session Memory - From Forgetting to Persistent Learning.
