Appendix A — Complete Inventory of Build-Time feature() Flags & Environment Knobs

Scope: Cross-cutting reference companion to Chapter 00 through Chapter 24 Snapshot Census: 90 unique build-time feature('...') flags (933 executable call sites across 197 files importing bun:bundle), 357 process.env.USER_TYPE checks in .ts files vs. 95 constant-folded "external" ===/!== 'ant' checks in .tsx files, and 472 distinct process.env.* keys across 1,884 .ts/.tsx source files. Primary Source Files:

• bridge/bridgeEnabled.ts — canonical positive-ternary feature() DCE idiom

• tools/BashTool/bashPermissions.ts & tools/BashTool/pathValidation.ts — Bun's per-function feature() DCE complexity cliff

• components/MemoryUsageIndicator.tsx — constant-folded USER_TYPE build define in .tsx

• utils/envUtils.ts — isEnvTruthy(), isEnvDefinedFalsy(), isBareMode(), getClaudeConfigHomeDir()

• utils/managedEnv.ts & utils/managedEnvConstants.ts — SAFE_ENV_VARS allowlist and three-layer filterSettingsEnv() security boundary

• utils/subprocessEnv.ts — child-process secret scrubbing (CLAUDE_CODE_SUBPROCESS_ENV_SCRUB) and CCR proxy injection

• entrypoints/cli.tsx & constants/system.ts — top-level ABLATION_BASELINE injection and NATIVE_CLIENT_ATTESTATION


Why Four Separate Gating Layers Exist

Reading Claude Code without understanding its gating taxonomy creates an illusion of arbitrary complexity: why does one capability check feature('BRIDGE_MODE'), another check process.env.USER_TYPE === 'ant', a third read process.env.CLAUDE_CODE_NO_FLICKER, and a fourth query getFeatureValue_CACHED_MAY_BE_STALE('tengu_ccr_bridge', false)?

Each layer defends a distinct boundary that the others cannot enforce:

text
  COMPILE TIME (Bun bundler + JSX compiler)
  +------------------------------------------------------------------------+
  | 1. feature('FLAG') from 'bun:bundle'   -> Dead-code elimination (DCE)  |
  |    & MACRO.* / USER_TYPE define           Strips code, strings, & deps |
  +------------------------------------------------------------------------+
                                      |
                                      v  (surviving binary)
  PROCESS STARTUP & SETTINGS LOAD (init.ts -> managedEnv.ts)
  +------------------------------------------------------------------------+
  | 2. process.env.* & settings.json `env` -> Operator / CI / IDE overrides|
  |    Filtered by SAFE_ENV_VARS pre-trust    & stripped for SSH/CCD/host  |
  +------------------------------------------------------------------------+
                                      |
                                      v  (runtime process)
  REMOTE CONTROL PLANE & POLICY (growthbook.ts / policyLimits)
  +------------------------------------------------------------------------+
  | 3. GrowthBook (`tengu_*`) & Policy     -> Live kill switches & A/B     |
  |    Disk-cached + background refresh       rollouts without shipping    |
  +------------------------------------------------------------------------+
                                      |
                                      v  (per-request / per-tool)
  CHILD PROCESS BOUNDARY (subprocessEnv.ts)
  +------------------------------------------------------------------------+
  | 4. GHA_SUBPROCESS_SCRUB + proxy env    -> Strips parent auth secrets   |
  |    before Bash / MCP / LSP / hooks        from prompt-injectable tools |
  +------------------------------------------------------------------------+

Compile-time flags exist for bundle size, secrecy, and zero-overhead exclusion: unreleased codenames, internal GrowthBook keys, and ant-only telemetry never ship in external binaries. Environment variables exist for machine-local configuration, CI/SDK orchestration, and emergency escape hatches before a network round-trip can occur. GrowthBook gates provide instant post-release kill switches. Understanding how these layers compose prevents misreading a dead external branch as live production behavior.


1. How Build-Time feature() Dead-Code Elimination Works (And Where It Breaks)

The Three Compile-Time Primitives

Across the repository, Bun's bundler resolves three compile-time mechanisms before emitting a release artifact:

  1. import { feature } from 'bun:bundle' (imported by 197 files; 90 unique flags; 933 executable call sites). Every flag compiles to a literal true or false at bundle time, letting the minifier drop unreachable require(...) calls, prompt text, tools, and GrowthBook gate names.
  2. MACRO.* build constants (injected globally): MACRO.VERSION, MACRO.BUILD_TIME, MACRO.PACKAGE_URL, MACRO.NATIVE_PACKAGE_URL, MACRO.FEEDBACK_CHANNEL, MACRO.ISSUES_EXPLAINER, and MACRO.VERSION_CHANGELOG. Used for zero-import --version (entrypoints/cli.tsx:37-42) and updater URLs.
  3. USER_TYPE define ('ant' vs. 'external'), covered in Section 3.

Three Production Scars in Bun's feature() Evaluator

Treating feature('...') like an ordinary boolean helper causes silent leaks and silent feature regressions. Three scars documented directly in the source capture the exact traps:

Scar 1 — Positive Ternary Required to Strip String Literals. In bridge/bridgeEnabled.ts, voice/voiceModeEnabled.ts, hooks/useReplBridge.tsx, and tools/BriefTool/upload.ts, engineers deliberately avoid early-return negative guards:

ts
// bridge/bridgeEnabled.ts:28-36export function isBridgeEnabled(): boolean {  // Positive ternary pattern — see docs/feature-gating.md.  // Negative pattern (if (!feature(...)) return) does not eliminate  // inline string literals from external builds.  return feature('BRIDGE_MODE')    ? isClaudeAISubscriber() &&        getFeatureValue_CACHED_MAY_BE_STALE('tengu_ccr_bridge', false)    : false}

When written as if (!feature('BRIDGE_MODE')) return false; return getFeatureValue_...('tengu_ccr_bridge', false), Bun's DCE pass fails to eliminate the trailing string literal 'tengu_ccr_bridge' from the bundle. Wrapping the entire body inside a positive feature('...') ? ... : false (or if (feature('...')) { ... }) is mandatory whenever a gated branch holds internal strings or require() calls.

Scar 2 — Bun's Per-Function DCE Complexity Cliff. In tools/BashTool/bashPermissions.ts and tools/BashTool/pathValidation.ts, a large permission function hit an internal complexity ceiling inside Bun's constant folder:

ts
// tools/BashTool/bashPermissions.ts:81-89// DCE cliff: Bun's feature() evaluator has a per-function complexity budget.// bashToolHasPermission is right at the limit. `import { X as Y }` aliases// inside the import block count toward this budget; when they push it over// the threshold Bun can no longer prove feature('BASH_CLASSIFIER') is a// constant and silently evaluates the ternaries to `false`, dropping every// pendingClassifierCheck spread. Keep aliases as top-level const rebindings// instead. (See also the comment on checkSemanticsDeny below.)const bashCommandIsSafeAsync = bashCommandIsSafeAsync_DEPRECATEDconst splitCommand = splitCommand_DEPRECATED

Worse still, tools/BashTool/pathValidation.ts:1155-1163 records that an obsolete 80-line dead function in bashPermissions.ts cannot be deleted because removing it shifted the module across the complexity threshold and caused 8 of 30 classifier tests to silently fail (feature('BASH_CLASSIFIER') folded to false).

Scar 3 — Zero-Allocation Native Attestation & Static Libc. Not every feature() flag gates an experimental product feature. Two target the compiled binary runtime itself:

  • NATIVE_CLIENT_ATTESTATION (constants/system.ts:64-83) embeds a fixed-width cch=00000; placeholder in the attribution header string so Anthropic's custom Bun HTTP stack (bun-anthropic/src/http/Attestation.zig) can overwrite the five zeros in-place with a computed attestation hash without altering Content-Length or reallocating the request buffer.
  • IS_LIBC_MUSL / IS_LIBC_GLIBC (utils/envDynamic.ts:52-59) short-circuit Linux libc detection at compile time in native binaries, falling back to an async fire-and-forget stat('/lib/libc.musl-...') check only in unbundled Node runs.

2. Complete Inventory of All 90 Build-Time feature() Flags

Counts below report executable code call sites across all .ts and .tsx files (933 total; raw regex hits including 39 documentation comments equal 972). Every single unique flag in the repository appears exactly once across Tables 2.1–2.6 (14 + 15 + 12 + 11 + 22 + 16 = 90). Flags marked † reference at least one snapshot-absent module.

2.1 Agent, Swarm, Proactive & Autonomous Modes (14 flags, 332 sites)

FlagSites (Files)Primary Source FilesRole & Companion Chapter
KAIROS †147 (54)main.tsx, screens/REPL.tsx, bridge/bridgeMain.tsAlways-on assistant mode: daily memory logs, assistant daemon bridge, push/file tools (Ch 10, Ch 24)
KAIROS_BRIEF39 (20)main.tsx, constants/prompts.ts, tools/BriefTool/BriefTool.tsConcise "brief" output mode (SendUserMessage / ctrl+shift+b) for async updates (Ch 04, Ch 21)
PROACTIVE †37 (15)screens/REPL.tsx, cli/print.ts, constants/prompts.tsAutonomous tick/wake loop (--proactive, SleepTool, periodic wakeups) (Ch 17)
COORDINATOR_MODE †32 (15)cli/print.ts, main.tsx, coordinator/coordinatorMode.tsMulti-agent orchestrator mode stripping direct edit tools from leader (Ch 19)
UDS_INBOX †18 (10)tools/SendMessageTool/SendMessageTool.ts, main.tsx, setup.tsUnix domain socket cross-session peer inbox (ListPeersTool, /peers) (Ch 19)
BG_SESSIONS †11 (7)utils/concurrentSessions.ts, query.ts, screens/REPL.tsxBackground tmux-backed CLI sessions (claude --bg, detach-on-exit) (Ch 17, Ch 22)
AGENT_TRIGGERS10 (6)cli/print.ts, screens/REPL.tsx, tools/ScheduleCronTool/prompt.tsLocal cron trigger tools (CronCreate, CronDelete, CronList) (Ch 17)
ULTRAPLAN10 (5)screens/REPL.tsx, components/PromptInput/PromptInput.tsx, commands/ultraplan.tsxDeep remote planning workflow triggered via /ultraplan (Ch 11, Ch 21)
WORKFLOW_SCRIPTS †10 (7)commands.ts, tasks.ts, constants/tools.tsScriptable multi-step workflow engine (WorkflowTool, local_workflow tasks) (Ch 17)
TEMPLATES †6 (5)query/stopHooks.ts, query.ts, utils/markdownConfigLoader.tsTemplate-driven background job definitions (templates/ config dir) (Ch 07, Ch 16)
FORK_SUBAGENT †5 (5)tools/AgentTool/forkSubagent.ts, commands.ts, commands/branch/index.tsCache-sharing forked subagents and /fork conversation branching (Ch 18)
VERIFICATION_AGENT4 (4)constants/prompts.ts, tools/AgentTool/builtInAgents.ts, tools/TaskUpdateTool/TaskUpdateTool.tsAnt-only A/B verification agent contract (tengu_hive_evidence) (Ch 18)
AGENT_TRIGGERS_REMOTE2 (2)tools.ts, skills/bundled/index.tsRemote scheduled agent trigger tools & bundled skill (Ch 16, Ch 17)
BUILTIN_EXPLORE_PLAN_AGENTS1 (1)tools/AgentTool/builtInAgents.tsA/B gate controlling whether built-in Explore and Plan agents are registered (Ch 18)

2.2 Compaction, Context & Memory (15 flags, 142 sites)

FlagSites (Files)Primary Source FilesRole & Companion Chapter
TEAMMEM46 (15)utils/collapseReadSearch.ts, utils/claudemd.ts, services/teamMemorySync/watcher.tsShared team memory directory, secret guard, and background sync watcher (Ch 10)
CONTEXT_COLLAPSE †22 (13)query.ts, services/compact/autoCompact.ts, setup.tsStage 4 compaction: collapsible history spans and CtxInspectTool (Ch 09)
HISTORY_SNIP †16 (8)utils/messages.ts, QueryEngine.ts, query.tsStage 2 compaction: surgical history snipping (SnipTool, /force-snip) (Ch 09)
CACHED_MICROCOMPACT †11 (5)services/api/claude.ts, query.ts, services/compact/microCompact.tsServer-side cache-editing microcompact (cache_edits API blocks) (Ch 09)
PROMPT_CACHE_BREAK_DETECTION9 (6)services/api/claude.ts, services/compact/microCompact.ts, services/api/promptCacheBreakDetection.tsDiffs system prompt/tools/messages between turns to diagnose cache misses (Ch 04)
TOKEN_BUDGET9 (6)screens/REPL.tsx, query.ts, constants/prompts.tsMulti-turn token-budget tracking and continuation nudges (Ch 07)
CONNECTOR_TEXT8 (5)services/api/claude.ts, utils/messages.ts, constants/betas.tssummarize-connector-text-2026-03-13 beta for compacting inter-tool prose (Ch 05)
EXTRACT_MEMORIES6 (3)query/stopHooks.ts, cli/print.ts, utils/backgroundHousekeeping.tsEnd-of-turn background memory extraction agent (Ch 10)
REACTIVE_COMPACT †5 (5)query.ts, services/compact/autoCompact.ts, commands/compact/compact.tsOn-demand compaction triggered reactively on prompt_too_long (tengu_cobalt_raccoon) (Ch 07, Ch 09)
MEMORY_SHAPE_TELEMETRY †3 (2)utils/sessionFileAccessHooks.ts, memdir/findRelevantMemories.tsLogs recall shape telemetry for memory directory queries (Ch 10)
AGENT_MEMORY_SNAPSHOT2 (2)main.tsx, tools/AgentTool/loadAgentsDir.tsSyncs custom agent memory snapshots on startup (Ch 18)
BREAK_CACHE_COMMAND2 (1)context.tsDev-only /break-cache injection into dynamic system prompt section (Ch 04)
COMPACTION_REMINDERS1 (1)utils/attachments.tsInjects compaction_reminder system attachment as context fills (Ch 09)
KAIROS_DREAM †1 (1)skills/bundled/index.tsRegisters bundled /dream cross-session memory consolidation skill (Ch 10)
ULTRATHINK1 (1)utils/thinking.tsEnables ultrathink keyword boost (tengu_turtle_carbon) (Ch 05)

2.3 Tools, Shell, Permissions & Sandbox (12 flags, 195 sites)

FlagSites (Files)Primary Source FilesRole & Companion Chapter
TRANSCRIPT_CLASSIFIER †108 (44)utils/permissions/permissionSetup.ts, utils/permissions/yoloClassifier.ts, main.tsxAuto-mode LLM safety classifier over full conversation transcripts (Ch 11)
BASH_CLASSIFIER45 (19)tools/BashTool/bashPermissions.ts, hooks/useCanUseTool.tsx, utils/classifierApprovals.tsPer-command Bash ML/LLM classifier for permission auto-approval (Ch 11, Ch 12)
MONITOR_TOOL †13 (9)tools/BashTool/prompt.ts, tasks/LocalShellTask/LocalShellTask.tsx, tasks.tsStreaming shell/MCP monitor tool (MonitorTool, monitor_mcp task) (Ch 17)
TREE_SITTER_BASH_SHADOW5 (2)tools/BashTool/bashPermissions.ts, utils/bash/parser.tsShadow-mode tree-sitter Bash AST parser comparing against legacy regex parser (tengu_birch_trellis) (Ch 12)
TERMINAL_PANEL †5 (5)tools.ts, keybindings/defaultBindings.ts, hooks/useGlobalKeybindings.tsxEmbedded terminal capture tool (TerminalCaptureTool) and meta+j toggle (Ch 21)
REVIEW_ARTIFACT †4 (2)components/permissions/PermissionRequest.tsx, skills/bundled/index.tsCode-review artifact tool (ReviewArtifactTool) and hunter skill (Ch 16)
WEB_BROWSER_TOOL †4 (3)screens/REPL.tsx, tools.ts, main.tsxNative Bun WebView-backed embedded browser tool (Ch 02)
TREE_SITTER_BASH3 (1)utils/bash/parser.tsPrimary tree-sitter Bash AST parser activation (Ch 12)
FILE_PERSISTENCE3 (2)cli/print.ts, utils/filePersistence/filePersistence.tsUploads modified output files to Files API at end of each turn in remote/BYOC sessions (Ch 23)
OVERFLOW_TEST_TOOL †2 (2)tools.ts, utils/permissions/classifierDecision.tsSynthetic context-overflow test tool for compaction/classifier testing (Ch 02)
POWERSHELL_AUTO_MODE2 (2)utils/permissions/yoloClassifier.ts, utils/permissions/permissions.tsExtends auto-mode classifier support to PowerShellTool (Ch 11, Ch 12)
HOOK_PROMPTS1 (1)screens/REPL.tsxExposes interactive requestPrompt callback from REPL to hook engine (Ch 13)

2.4 MCP, Skills, Plugins & Commands (11 flags, 72 sites)

FlagSites (Files)Primary Source FilesRole & Companion Chapter
EXPERIMENTAL_SKILL_SEARCH †19 (9)tools/SkillTool/SkillTool.ts, constants/prompts.ts, utils/attachments.tsSemantic local/remote skill search and prefetch pipeline (Ch 16)
KAIROS_CHANNELS18 (13)services/mcp/useManageMCPConnections.ts, cli/print.ts, services/mcp/channelNotification.tsInbound MCP channel notifications & push messages (tengu_harbor) (Ch 15)
CHICAGO_MCP13 (7)services/mcp/client.ts, query.ts, services/mcp/config.tsBuilt-in desktop computer-use MCP server integration (Ch 15)
MCP_SKILLS †9 (3)services/mcp/client.ts, services/mcp/useManageMCPConnections.ts, commands.tsExposes MCP server prompts as discoverable skills (Ch 15, Ch 16)
KAIROS_GITHUB_WEBHOOKS †4 (4)tools.ts, hooks/useReplBridge.tsx, commands.tsPR subscription tool (/subscribe-pr, SubscribePRTool) and webhook sanitizer (Ch 24)
MCP_RICH_OUTPUT3 (1)tools/MCPTool/UI.tsxTruncated rich parameter rendering in MCP tool UI blocks (Ch 15)
NEW_INIT2 (1)commands/init.tsEnhanced /init scaffolding CLAUDE.md, skills, and hooks (CLAUDE_CODE_NEW_INIT) (Ch 10)
BUILDING_CLAUDE_APPS1 (1)skills/bundled/index.tsRegisters bundled claudeApi skill for building apps with the Claude API (Ch 16)
RUN_SKILL_GENERATOR †1 (1)skills/bundled/index.tsRegisters bundled skill-generator meta-skill (Ch 16)
SKILL_IMPROVEMENT1 (1)utils/hooks/skillImprovement.tsPost-sampling hook updating skills from execution traces (tengu_copper_panda) (Ch 13, Ch 16)
TORCH †1 (1)commands.tsRegisters internal /torch slash command (module absent from snapshot) (Ch 03)

2.5 UI, Voice, Bridge, Remote & Daemon (22 flags, 153 sites)

FlagSites (Files)Primary Source FilesRole & Companion Chapter
VOICE_MODE †47 (15)hooks/useVoiceIntegration.tsx, voice/voiceModeEnabled.ts, screens/REPL.tsxPush-to-talk speech-to-text input (space hold-to-talk, streaming STT) (Ch 21)
BRIDGE_MODE27 (13)hooks/useReplBridge.tsx, bridge/bridgeEnabled.ts, main.tsxRemote Control REPL bridge connecting local CLI to claude.ai (tengu_ccr_bridge) (Ch 24)
BUDDY †18 (7)screens/REPL.tsx, buddy/CompanionSprite.tsx, components/PromptInput/PromptInput.tsxTerminal ASCII companion sprite and /buddy reactions (Ch 21)
LODESTONE6 (4)main.tsx, utils/backgroundHousekeeping.ts, interactiveHelpers.tsxDeep-link URI protocol registration and --handle-uri launcher (Ch 22)
DIRECT_CONNECT5 (1)main.tsx--connect direct WebSocket/HTTP server session attachment (Ch 24)
DOWNLOAD_USER_SETTINGS5 (3)cli/print.ts, services/settingsSync/index.ts, commands/reload-plugins/reload-plugins.tsPulls cloud-synced user settings into remote/headless sessions (Ch 14)
MESSAGE_ACTIONS5 (2)screens/REPL.tsx, keybindings/defaultBindings.tsshift+up message action menu (copy/rewind/branch on prior turns) (Ch 21)
QUICK_SEARCH5 (2)components/PromptInput/PromptInput.tsx, keybindings/defaultBindings.tsctrl+shift+f / cmd+shift+f global transcript search overlay (Ch 21)
CCR_MIRROR4 (3)bridge/remoteBridgeCore.ts, bridge/bridgeEnabled.ts, main.tsxRead-only mirror of local CLI turns to claude.ai without full remote control (Ch 24)
HISTORY_PICKER4 (2)components/PromptInput/PromptInput.tsx, hooks/useHistorySearch.tsInteractive scrollable prompt history picker modal (Ch 21)
KAIROS_PUSH_NOTIFICATION4 (3)components/Settings/Config.tsx, tools.ts, tools/ConfigTool/supportedSettings.tsMobile/desktop push notifications on task completion (PushNotificationTool) (Ch 24)
SSH_REMOTE4 (1)main.tsxclaude ssh remote execution launcher with forwarded auth socket (Ch 22)
AUTO_THEME †3 (3)components/ThemePicker.tsx, components/design-system/ThemeProvider.tsx, tools/ConfigTool/supportedSettings.tsOS dark/light automatic theme switching (systemThemeWatcher) (Ch 20)
CCR_AUTO_CONNECT3 (2)utils/config.ts, bridge/bridgeEnabled.tsAutomatic remote-control bridge reconnection (tengu_cobalt_harbor) (Ch 24)
DAEMON †3 (2)entrypoints/cli.tsx, commands.tsPersistent background daemon supervisor (claude daemon / /remote-control-server) (Ch 22, Ch 24)
AWAY_SUMMARY2 (2)hooks/useAwaySummary.ts, screens/REPL.tsxGenerates catch-up summary after terminal loses focus for 5+ minutes (Ch 20, Ch 21)
NATIVE_CLIPBOARD_IMAGE2 (1)utils/imagePaste.tsNative macOS NSPasteboard image read (~0.03ms) avoiding osascript spawn (Ch 21)
UPLOAD_USER_SETTINGS2 (2)services/settingsSync/index.ts, main.tsxUploads local user settings to cloud sync in background (Ch 14)
BYOC_ENVIRONMENT_RUNNER †1 (1)entrypoints/cli.tsxFast-path claude environment-runner entrypoint for Bring-Your-Own-Cloud containers (Ch 22)
CCR_REMOTE_SETUP1 (1)commands.tsRegisters /web-setup command for Claude Code on the web (tengu_cobalt_lantern) (Ch 24)
SELF_HOSTED_RUNNER †1 (1)entrypoints/cli.tsxFast-path claude self-hosted-runner worker entrypoint (Ch 22)
STREAMLINED_OUTPUT1 (1)cli/print.tsCompact NDJSON transformer for --output-format stream-json (CLAUDE_CODE_STREAMLINED_OUTPUT) (Ch 23)

2.6 Internal, Telemetry, Build & Release (16 flags, 39 sites)

FlagSites (Files)Primary Source FilesRole & Companion Chapter
COMMIT_ATTRIBUTION †12 (9)cli/print.ts, utils/sessionRestore.ts, setup.tsTracks AI-authored commit attribution hooks & git trailers (Ch 14)
SHOT_STATS10 (3)utils/stats.ts, utils/statsCache.ts, components/Stats.tsxPer-session prompt/shot distribution histograms in /stats (Ch 05)
ALLOW_TEST_VERSIONS2 (1)utils/nativeInstaller/download.tsAllows installing 99.99.* synthetic test release versions (Ch 22)
COWORKER_TYPE_TELEMETRY2 (1)services/analytics/metadata.tsAttaches CLAUDE_CODE_COWORKER_TYPE dimension to analytics events (Ch 05)
HARD_FAIL2 (2)main.tsx, utils/log.tsAdds hidden --hard-fail CLI flag that crashes immediately on any logError() (Ch 22)
ABLATION_BASELINE1 (1)entrypoints/cli.tsxHarness-science L0 ablation preset setting 7 disable env vars before module imports (Ch 22)
ANTI_DISTILLATION_CC1 (1)services/api/claude.tsSends anti_distillation: ['fake_tools'] on 1P CLI requests (tengu_anti_distill_fake_tool_injection) (Ch 05)
DUMP_SYSTEM_PROMPT1 (1)entrypoints/cli.tsxZero-REPL --dump-system-prompt fast-path for prompt inspection (Ch 04, Ch 22)
ENHANCED_TELEMETRY_BETA1 (1)utils/telemetry/sessionTracing.tsEnables detailed OpenTelemetry span tracing beta (Ch 05)
IS_LIBC_GLIBC1 (1)utils/envDynamic.tsCompile-time assertion that target Linux binary uses glibc (Ch 22)
IS_LIBC_MUSL1 (1)utils/envDynamic.tsCompile-time assertion that target Linux binary uses musl (Ch 22)
NATIVE_CLIENT_ATTESTATION1 (1)constants/system.tsInserts cch=00000; in attribution header for Zig HTTP stack attestation (Ch 05)
PERFETTO_TRACING1 (1)utils/telemetry/perfettoTracing.tsEnables Perfetto protobuf performance trace writer (CLAUDE_CODE_PERFETTO_TRACE) (Ch 22)
SKIP_DETECTION_WHEN_AUTOUPDATES_DISABLED1 (1)components/AutoUpdaterWrapper.tsxSkips update version checks completely when auto-updates are disabled (Ch 14)
SLOW_OPERATION_LOGGING1 (1)utils/slowOperations.tsSwaps in internal slow-JSON/op logging thresholds (slowLoggingAnt vs. slowLoggingExternal) (Ch 01)
UNATTENDED_RETRY1 (1)services/api/withRetry.tsAllows infinite/extended retries for headless evals (CLAUDE_CODE_UNATTENDED_RETRY) (Ch 05)

3. The USER_TYPE === 'ant' Split: Constant Folding Across .tsx vs. .ts

Alongside feature(), the codebase contains a second compile-time axis distinguishing Anthropic internal ("ant") builds from public releases ("external"). Inspecting this snapshot reveals an immediate, striking asymmetry between .ts and .tsx files:

Pattern.ts Files (1,332 total).tsx Files (552 total)Notes
process.env.USER_TYPE357 hits (165 files)0 executable hits (3 comments)Top .ts sites: firstPartyEventLoggingExporter.ts (19), growthbook.ts (17), insights.ts (10), mockRateLimits.ts (9), prompts.ts (12)
"external" === 'ant'0 hits88 hits (27 files)Constant-folded by build define prior to React Compiler output
"external" !== 'ant'0 hits7 hits (7 files)Combined with ===, 95 folded checks across 31 unique .tsx files
Inline sourceMappingURL=0 / 1,332 files552 / 552 filesEvery .tsx file passed through the React Compiler + define transform

Why does "external" === 'ant' appear exclusively in .tsx files? Because in the build pipeline that produced this snapshot, .tsx files were run through the React Compiler transform (_c(...) memoization slots + inline base64 sourceMappingURL) with the bundler define process.env.USER_TYPE = "external" already substituted—while .ts files bypassed the JSX/React Compiler pass and preserved their raw process.env.USER_TYPE === 'ant' expressions.

You can verify that USER_TYPE is structurally guaranteed to be a build-time constant (never toggled at runtime) from components/MemoryUsageIndicator.tsx:

tsx
// components/MemoryUsageIndicator.tsx:5-16export function MemoryUsageIndicator(): React.ReactNode {  // Ant-only: the /heapdump link is an internal debugging aid. Gating before  // the hook means the 10s polling interval is never set up in external builds.  // USER_TYPE is a build-time constant, so the hook call below is either always  // reached or dead-code-eliminated — never conditional at runtime.  if ("external" !== 'ant') {    return null;  }  // eslint-disable-next-line react-hooks/rules-of-hooks  // biome-ignore lint/correctness/useHookAtTopLevel: USER_TYPE is a build-time constant  const memoryUsage = useMemoryUsage();

Placing a React hook after an if return would violate the Rules of Hooks if USER_TYPE could ever vary dynamically; it is safe only because the bundler folds "external" !== 'ant' to true and dead-code-eliminates useMemoryUsage() in external builds (and folds 'ant' !== 'ant' to false in internal builds).


4. Environment Variable Architecture: Trust Boundaries, Filters, and Subprocess Scrubbing

The codebase reads 472 distinct process.env.* keys (196 CLAUDE_CODE_*, 31 other CLAUDE_*, 26 ANTHROPIC_*, 21 DISABLE_*, 16 OTEL_*, 12 ENABLE_*, 8 MCP_*, 7 USE_*, plus standard OS/cloud/proxy variables). Before consulting the tables in Section 5, four load-bearing invariants govern how every variable enters, overrides, and exits process.env.

Invariant 1: Strict Tri-State Boolean Parsing

In utils/envUtils.ts:32-47, boolean knobs are never parsed with bare Boolean(process.env.X) (which would treat "0" and "false" as truthy):

ts
// utils/envUtils.ts:32-47export function isEnvTruthy(envVar: string | boolean | undefined): boolean {  if (!envVar) return false  if (typeof envVar === 'boolean') return envVar  const normalizedValue = envVar.toLowerCase().trim()  return ['1', 'true', 'yes', 'on'].includes(normalizedValue)}export function isEnvDefinedFalsy(  envVar: string | boolean | undefined,): boolean {  if (envVar === undefined) return false  if (typeof envVar === 'boolean') return !envVar  if (!envVar) return false  const normalizedValue = envVar.toLowerCase().trim()  return ['0', 'false', 'no', 'off'].includes(normalizedValue)}

Notice the subtle tri-state boundary: an empty string "" returns false for both isEnvTruthy("") and isEnvDefinedFalsy(""), allowing unset/empty values to fall back to defaults (e.g., CLAUDE_CODE_NO_FLICKER=0 explicitly opts out an ant user, while empty falls through to the build default in utils/fullscreen.ts:108-125).

Invariant 2: Pre-Trust SAFE_ENV_VARS Allowlist

Because settings.json supports an "env": { ... } map, a malicious Git repository could commit .claude/settings.json with ANTHROPIC_BASE_URL pointing to an attacker's proxy, NODE_EXTRA_CA_CERTS trusting an attacker's CA, or HTTP_PROXY hijacking first-run auth traffic before the user answers the workspace trust dialog.

utils/managedEnv.ts:93-199 solves this with a two-phase loader wired into init.ts (see Chapter 14 and Chapter 22):

text
  Phase 1: applySafeConfigEnvironmentVariables()   [BEFORE trust dialog]
    - Trusted sources (userSettings, flagSettings, policySettings): ALL vars
    - Untrusted sources (projectSettings, localSettings): ONLY SAFE_ENV_VARS
      (blocked: ANTHROPIC_BASE_URL, HTTP(S)_PROXY, NODE_EXTRA_CA_CERTS,
       NODE_TLS_REJECT_UNAUTHORIZED, ANTHROPIC_API_KEY, LD_PRELOAD, PATH)
                              |
                              v  (user grants workspace trust)
  Phase 2: applyConfigEnvironmentVariables()       [AFTER trust dialog]
    - Merges all settings.env keys -> clears CA, mTLS, & proxy caches
    - Rebuilds global HTTP/HTTPS agents via configureGlobalAgents()

Invariant 3: Three Host-Protection Strip Filters

Every settings-sourced env object passes through filterSettingsEnv() (utils/managedEnv.ts:85-91), composing three strip guards:

  1. withoutSSHTunnelVars(): When ANTHROPIC_UNIX_SOCKET is set (claude ssh), strips ANTHROPIC_UNIX_SOCKET, ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, and CLAUDE_CODE_OAUTH_TOKEN so the remote host's ~/.claude/settings.json cannot clobber the forwarded local auth tunnel.
  2. withoutHostManagedProviderVars(): When CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST is truthy, strips all PROVIDER_MANAGED_ENV_VARS plus any VERTEX_REGION_CLAUDE_* prefix (utils/managedEnvConstants.ts:14-70) so a user's personal Bedrock/Vertex settings cannot hijack an enterprise or desktop host's inference routing.
  3. withoutCcdSpawnEnvKeys(): When CLAUDE_CODE_ENTRYPOINT === 'claude-desktop', snapshots all spawn-time env keys on first call and strips them from settings so user settings (e.g., OTEL_LOGS_EXPORTER=console) cannot corrupt the desktop host's stdio JSON-RPC stream.

Invariant 4: Child-Process Secret Scrubbing (subprocessEnv())

When running in untrusted automation (such as GitHub Actions with allowed_non_write_users), prompt injection inside a Bash tool could execute echo $ANTHROPIC_API_KEY. utils/subprocessEnv.ts:15-99 wraps every child spawn (Bash, shell snapshots, MCP stdio, LSP, shell hooks): when CLAUDE_CODE_SUBPROCESS_ENV_SCRUB is truthy, it deletes 23 secret keys (GHA_SUBPROCESS_SCRUB: Anthropic auth, OTLP headers, AWS/GCP/Azure credentials, GitHub OIDC & runtime tokens, SSH_SIGNING_KEY, ALL_INPUTS) plus their INPUT_<KEY> GitHub Actions duplicates, while keeping them intact inside the parent Claude Code process and merging CCR's _getUpstreamProxyEnv() relay vars.


5. Load-Bearing Environment Knobs by Subsystem

Every variable name and primary file path below is verified directly against this snapshot.

5.1 Startup, Paths, Isolation & Diagnostics

Environment VariablePrimary Source File(s)Effect & Invariant
CLAUDE_CONFIG_DIRutils/envUtils.ts, utils/env.tsOverrides ~/.claude config root (memoized & NFC-normalized; keyed on var)
CLAUDE_CODE_SIMPLEutils/envUtils.ts, main.tsx--bare mode: skips hooks, LSP, plugin sync, skill walk, and all keychain reads (~30 gates)
CLAUDE_CODE_ENTRYPOINTmain.tsx, services/analytics/metadata.tsIdentifies launch surface (cli, claude-desktop, sdk-ts, etc.); activates CCD env snapshot & attestation
CLAUDE_CODE_ABLATION_BASELINEentrypoints/cli.tsxBehind feature('ABLATION_BASELINE'): forces 7 disable env vars at line 21 before module load
CLAUDE_CODE_PROFILE_STARTUPutils/startupProfiler.ts, utils/headlessProfiler.tsEmits cold-start checkpoint timing breakdown (Ch 22)
CLAUDE_CODE_PROFILE_QUERYutils/queryProfiler.tsProfiles per-turn query loop latency stages
CLAUDE_CODE_EXIT_AFTER_FIRST_RENDERcli/print.ts, hooks/useAfterFirstRender.tsExits immediately after initial Ink frame for startup benchmarking
CLAUDE_CODE_DEBUG_LOGS_DIRutils/debug.tsRedirects debug log files from default temp/config directory
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICutils/privacyLevel.tsSets privacy level essential-traffic: disables telemetry, auto-updater, error reporting, and marketplace calls
DISABLE_TELEMETRYutils/privacyLevel.tsSets privacy level no-telemetry (keeps non-telemetry network calls active)
DISABLE_AUTOUPDATERutils/config.tsDisables background CLI auto-updates
CLAUDE_CODE_ENABLE_TELEMETRYutils/telemetry/instrumentation.tsActivates OpenTelemetry metrics/logs/traces export (OTEL_EXPORTER_OTLP_*, OTEL_METRICS_EXPORTER, OTEL_LOGS_EXPORTER)
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MSutils/telemetry/instrumentation.tsCaps OTel exporter flush wait during graceful shutdown
IS_DEMOcomponents/LogoV2/LogoV2.tsx, utils/status.tsxHides sensitive account/email/org details in terminal banners for demos
CLAUDE_CODE_TMPDIRutils/imagePaste.ts, utils/permissions/filesystem.tsOverrides temp directory used by shell providers, clipboard paste, and scratch files

5.2 Model, Inference Providers, Auth & Streaming

Environment VariablePrimary Source File(s)Effect & Invariant
ANTHROPIC_API_KEYutils/auth.ts, components/Settings/Config.tsxFirst-party API key (stripped from untrusted project settings and scrubbed subprocesses)
ANTHROPIC_AUTH_TOKENutils/auth.ts, services/api/client.tsCustom Authorization: Bearer token for gateways/proxies
ANTHROPIC_BASE_URLservices/api/client.ts, services/api/logging.tsOverrides first-party API origin (non-1P host auto-disables optimistic ToolSearch unless explicitly set)
ANTHROPIC_MODELmain.tsx, utils/model/model.tsOverrides primary loop model alias or full model ID
ANTHROPIC_SMALL_FAST_MODELutils/model/model.ts, services/api/logging.tsOverrides auxiliary fast model (Haiku-tier helpers, summaries, prefetches)
ANTHROPIC_DEFAULT_{OPUS,SONNET,HAIKU}_MODELutils/model/model.ts, utils/model/modelOptions.tsRemaps model tier aliases to provider-specific IDs (e.g., Bedrock ARNs or Vertex IDs)
ANTHROPIC_BETAS / ANTHROPIC_CUSTOM_HEADERSutils/betas.ts, services/api/client.tsComma-separated extra beta headers / custom Key: Value HTTP headers injected on API calls
CLAUDE_CODE_USE_{BEDROCK,VERTEX,FOUNDRY}utils/auth.ts, services/api/client.tsSwitches inference backend to AWS Bedrock, Google Vertex AI, or Azure Foundry (Ch 05)
CLAUDE_CODE_SKIP_{BEDROCK,VERTEX,FOUNDRY}_AUTHservices/api/client.ts, utils/model/bedrock.tsBypasses cloud SDK SigV4/IAM/ADC auth for authenticating proxy gateways
CLAUDE_CODE_OAUTH_TOKENutils/auth.ts, bridge/bridgeEnabled.tsInjects OAuth access token directly (note: lacks user:profile scope for some GrowthBook org gates)
CLAUDE_CODE_API_KEY_HELPER_TTL_MSutils/auth.tsCache TTL for apiKeyHelper shell command output
CLAUDE_CODE_MAX_OUTPUT_TOKENSquery.ts, services/api/claude.tsOverrides per-turn max_tokens ceiling sent to the Messages API
MAX_THINKING_TOKENSutils/thinking.ts, main.tsxExplicit extended-thinking token budget (0 disables thinking)
CLAUDE_CODE_EFFORT_LEVELutils/effort.ts, commands/effort/effort.tsxSets reasoning effort (low/medium/high/max/unset); CLAUDE_CODE_ALWAYS_ENABLE_EFFORT forces on 3P
CLAUDE_CODE_DISABLE_THINKING / DISABLE_INTERLEAVED_THINKINGservices/api/claude.ts, utils/betas.tsDisables extended thinking or interleaved-thinking beta header
CLAUDE_CODE_DISABLE_FAST_MODEutils/fastMode.ts, query/config.tsHard kill switch disabling fast-mode inference
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASutils/betas.ts, utils/toolSearch.tsStrips 1P experimental beta headers and schema.strict for third-party proxy compatibility
CLAUDE_CODE_MAX_RETRIES / API_TIMEOUT_MSservices/api/withRetry.ts, services/api/client.tsTunes transient HTTP retry count and per-request socket timeout
CLAUDE_CODE_ATTRIBUTION_HEADERconstants/system.tsSet falsy (0/false) to omit cc_version/cc_entrypoint attribution header
DISABLE_PROMPT_CACHINGservices/api/claude.tsDisables cache_control breakpoints (also per-tier: DISABLE_PROMPT_CACHING_{OPUS,SONNET,HAIKU})

5.3 Compaction, Context Window & Memory

Environment VariablePrimary Source File(s)Effect & Invariant
DISABLE_COMPACT / DISABLE_AUTO_COMPACTservices/compact/autoCompact.ts, commands/compact/index.tsDisables all compaction (incl. /compact) or disables automatic compaction only (Ch 09)
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEservices/compact/autoCompact.tsTriggers auto-compaction at custom percentage (1–100) of effective context window
CLAUDE_CODE_AUTO_COMPACT_WINDOWservices/compact/autoCompact.tsCaps effective token window used when computing auto-compact thresholds
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDEservices/compact/autoCompact.tsOverrides hard token ceiling where the loop refuses new turns
ENABLE_CLAUDE_CODE_SM_COMPACT / DISABLE_CLAUDE_CODE_SM_COMPACTservices/compact/sessionMemoryCompact.tsForce-enables or disables session-memory-backed compaction (avoids full summarization call)
USE_API_CLEAR_TOOL_RESULTS / USE_API_CLEAR_TOOL_USESservices/compact/apiMicrocompact.tsSwitches Stage 3 microcompaction to server-side context_management tool-clearing API edits
USE_API_CONTEXT_MANAGEMENTutils/betas.tsAnt-only opt-in for server-side context management beta header
CLAUDE_CODE_DISABLE_1M_CONTEXT / CLAUDE_CODE_MAX_CONTEXT_TOKENSutils/context.tsOpts out of 1M-token context window or clamps effective context window size
CLAUDE_CODE_DISABLE_CLAUDE_MDScontext.tsSuppresses loading hierarchical CLAUDE.md instruction files (Ch 10)
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MDutils/claudemd.tsLoads CLAUDE.md files from --add-dir extra directories (off by default)
CLAUDE_CODE_DISABLE_AUTO_MEMORYmemdir/memdir.ts, memdir/paths.tsDisables persistent cross-session auto-memory directory (memdir/)
CLAUDE_CODE_REMOTE_MEMORY_DIRmemdir/paths.ts, tools/AgentTool/agentMemory.tsRedirects auto-memory storage to a mounted remote/shared directory
CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING / CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTINGutils/fileHistory.tsDisables /rewind disk snapshots in interactive mode or enables them in headless SDK runs (Ch 08)

5.4 Permissions, Shell, Sandboxing & Workspace Tools

Environment VariablePrimary Source File(s)Effect & Invariant
IS_SANDBOXsetup.ts, services/api/withRetry.tsDeclares execution inside an isolated container (permits --dangerously-skip-permissions as root)
CLAUDE_CODE_BUBBLEWRAPutils/envDynamic.ts, setup.tsSignals Linux bwrap sandbox environment (Ch 12)
CLAUDE_CODE_DISABLE_COMMAND_INJECTION_CHECKtools/BashTool/bashPermissions.tsDisables Bash AST/regex command-injection validator (high-risk override)
CLAUDE_CODE_SUBPROCESS_ENV_SCRUButils/subprocessEnv.tsStrips GHA_SUBPROCESS_SCRUB + INPUT_* credentials from all child tool/hook/MCP/LSP processes
CLAUDE_CODE_MANAGED_SETTINGS_PATHutils/settings/managedPath.tsOverrides enterprise managed-settings.json location (Ch 14)
CLAUDE_CODE_PROVIDER_MANAGED_BY_HOSTutils/managedEnv.ts, utils/managedEnvConstants.tsLocks inference provider/endpoint/model env vars against user settings overrides
CLAUDE_CODE_SHELL / CLAUDE_CODE_SHELL_PREFIXutils/Shell.ts, utils/shell/bashProvider.tsForces specific shell binary or wraps every shell/MCP command in a prefix wrapper
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIRutils/envUtils.tsResets shell cwd back to project root after every BashTool invocation
BASH_DEFAULT_TIMEOUT_MS / BASH_MAX_TIMEOUT_MSutils/timeouts.tsSets default and upper-bound timeout for BashTool commands
BASH_MAX_OUTPUT_LENGTHutils/shell/outputLimits.tsCaps inline Bash stdout/stderr chars before truncation/spill
CLAUDE_CODE_USE_POWERSHELL_TOOLutils/shell/shellToolUtils.tsEnables native Windows PowerShellTool alongside/instead of Git Bash
CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCYservices/tools/toolOrchestration.tsMax parallel read-only tool calls per assistant turn (default 10; Ch 06)
CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENStools/FileReadTool/limits.tsOverrides per-call token ceiling for FileReadTool
USE_BUILTIN_RIPGREPutils/ripgrep.tsForces bundled vs. system rg binary (0 uses system PATH rg)
CLAUDE_CODE_UNDERCOVERutils/undercover.tsSuppresses internal/Anthropic attribution strings when working in public repos

5.5 MCP, Skills, Hooks & Plugins

Environment VariablePrimary Source File(s)Effect & Invariant
ENABLE_TOOL_SEARCHutils/toolSearch.tsControls deferred tool loading: true/auto:0 (always defer), auto/auto:N (defer above N% context, default 10%), false/auto:100 (eager) (Ch 15)
MCP_TIMEOUT / MCP_TOOL_TIMEOUTservices/mcp/client.tsServer startup handshake timeout and per-tool-call timeout for MCP servers
MAX_MCP_OUTPUT_TOKENSutils/mcpValidation.tsToken cap on inline MCP tool responses before warning/truncation
ENABLE_MCP_LARGE_OUTPUT_FILESservices/mcp/client.tsSpills oversized MCP payloads to disk files rather than truncating
ENABLE_CLAUDEAI_MCP_SERVERSservices/mcp/claudeai.tsEnables/disables synced claude.ai hosted MCP connectors
ENABLE_LSP_TOOLtools.tsOpts into the background Language Server Protocol tool (Ch 16)
SLASH_COMMAND_TOOL_CHAR_BUDGETtools/SkillTool/prompt.tsCharacter budget for listing available skills/commands in system prompt
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MSutils/hooks.ts, utils/gracefulShutdown.tsCaps shutdown wait for SessionEnd hooks (Ch 13)
CLAUDE_CODE_SYNC_PLUGIN_INSTALLsetup.ts, cli/print.tsBlocks startup until plugin installation completes (headless/CI determinism)
CLAUDE_CODE_PLUGIN_CACHE_DIRutils/plugins/pluginDirectories.tsOverrides on-disk plugin cache directory
FORCE_AUTOUPDATE_PLUGINSutils/config.tsForces plugin marketplace updates even when CLI auto-updater is disabled
CLAUDE_CODE_ENABLE_XAAservices/mcp/xaaIdpLogin.tsEnables Cross-App Access (XAA) IdP authentication flow for enterprise MCP servers

5.6 Background Tasks, Subagents, Swarms & Coordinator

Environment VariablePrimary Source File(s)Effect & Invariant
CLAUDE_CODE_DISABLE_BACKGROUND_TASKStools/BashTool/BashTool.tsx, tools/PowerShellTool/prompt.tsDisables run_in_background across shell and agent tools (captured at module import time!)
CLAUDE_CODE_ENABLE_TASKS / CLAUDE_CODE_TASK_LIST_IDutils/tasks.ts, main.tsxEnables persistent shared task list and pins a shared cross-session task list ID (Ch 17)
CLAUDE_CODE_SUBAGENT_MODELutils/model/agent.tsOverrides default model used when spawning subagents (Ch 18)
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSutils/agentSwarmsEnabled.tsOpt-in gate enabling multi-agent teams (TeamCreateTool, mailbox, in-process/tmux teammates; Ch 19)
CLAUDE_CODE_COORDINATOR_MODEcoordinator/coordinatorMode.ts, main.tsxActivates Coordinator Mode (behind feature('COORDINATOR_MODE'))
CLAUDE_CODE_DISABLE_CRONtools/ScheduleCronTool/prompt.tsDisables scheduled cron trigger tools for the session
CLAUDE_CODE_PROACTIVE / CLAUDE_CODE_BRIEFmain.tsx, tools/BriefTool/BriefTool.tsRuntime opt-in for proactive wake loop / brief mode (behind PROACTIVE / KAIROS_BRIEF)
CLAUDE_CODE_PLAN_V2_AGENT_COUNTutils/planModeV2.tsTunes parallel planner/explorer subagent fan-out in Plan Mode V2
CLAUDE_CODE_EAGER_FLUSHQueryEngine.tsForces immediate transcript persistence flushes inside QueryEngine (Ch 08)

5.7 Terminal UI, Fullscreen, IDE & Accessibility

Environment VariablePrimary Source File(s)Effect & Invariant
CLAUDE_CODE_NO_FLICKERutils/fullscreen.tsToggles Ink alternate-screen buffer + virtualized scrollback (0 opts out; auto-disabled under tmux -CC; Ch 20)
CLAUDE_CODE_DISABLE_MOUSE / CLAUDE_CODE_DISABLE_MOUSE_CLICKSutils/fullscreen.tsKeeps alt-screen while disabling SGR mouse tracking (preserves native terminal copy-on-select) or click handlers
CLAUDE_CODE_DISABLE_VIRTUAL_SCROLLcomponents/Messages.tsx, screens/REPL.tsxDisables message-list virtualization in fullscreen mode
CLAUDE_CODE_DISABLE_TERMINAL_TITLEscreens/REPL.tsx, utils/gracefulShutdown.tsPrevents OSC escape sequences from overwriting terminal tab/window title
CLAUDE_CODE_ACCESSIBILITYink/components/App.tsx, components/TextInput.tsxEnables screen-reader-friendly Ink rendering hints
CLAUDE_CODE_SYNTAX_HIGHLIGHTnative-ts/color-diff/index.ts, components/ThemePicker.tsxToggles native syntax highlighting in structured code diffs (0 disables)
CLAUDE_CODE_TMUX_PREFIXcomponents/LogoV2/LogoV2.tsxSurfaces tmux prefix conflict guidance when spawned inside managed tmux sessions
CLAUDE_CODE_IDE_HOST_OVERRIDE / CLAUDE_CODE_SSE_PORTutils/ide.ts, hooks/useIDEIntegration.tsxConnects CLI to VS Code / JetBrains IDE extension lockfile & SSE bridge
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTIONservices/PromptSuggestion/promptSuggestion.ts, query/stopHooks.tsEnables speculative next-prompt ghost text after assistant turns (Ch 21)
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYcomponents/FeedbackSurvey/useFeedbackSurvey.tsxSuppresses post-compact, memory, and session quality feedback prompts

5.8 Remote Sessions, Bridge, Proxy & TLS


Verification & Exploration Commands

Every count and claim in this appendix can be independently verified against the repository with read-only rg commands:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Observe the .tsx constant-folding split vs. .ts runtime checks for USER_TYPE:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  sh
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  rg --glob '*.tsx' --glob '!book/**' -c '"external"\s*[!=]==\s*'\''ant'\'''rg --glob '*.ts'  --glob '!book/**' -c 'process\.env\.USER_TYPE'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Inspect the Bun DCE complexity cliff and positive-ternary invariant comments:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  sh
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  rg --glob '*.ts' --glob '*.tsx' --glob '!book/**' 'DCE cliff|Negative pattern \(if \(!feature'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Audit every env var permitted before the workspace trust dialog vs. scrubbed from subprocesses: Read utils/managedEnvConstants.ts (SAFE_ENV_VARS & PROVIDER_MANAGED_ENV_VARS) alongside utils/subprocessEnv.ts (GHA_SUBPROCESS_SCRUB).