Skip to content

Instantly share code, notes, and snippets.

@VoidChecksum
Created April 7, 2026 12:43
Show Gist options
  • Select an option

  • Save VoidChecksum/fd05de8b455d1c81db15e691154356dd to your computer and use it in GitHub Desktop.

Select an option

Save VoidChecksum/fd05de8b455d1c81db15e691154356dd to your computer and use it in GitHub Desktop.
Claude Code v2.1.92 — Hidden Employee & Internal Features (CLAUBBIT, XAA/SEP-990, CCR BYOC, SWE-bench, VCR, staging OAuth, and 40+ undocumented env vars)

Claude Code v2.1.92 — Hidden Employee & Internal Features

All findings extracted via static analysis of cli.js (13.2MB esbuild bundle).


1. Employee Identity Flags

CLAUBBIT=1

  • Skips TrustDialog on startup — employees bypass the trust prompt
  • Sets is_claubbit: true in all telemetry events
  • Second gate: if(!U6(process.env.CLAUBBIT)){if(!sO()){let{TrustDialog:j}=...

CLAUDE_TRUSTED_DEVICE_TOKEN

  • If set, skips trusted-device enrollment entirely ("env var takes precedence")
  • Normally: calls /api/trusted_device/enroll via tengu_trusted_device_enrollment gate
  • Used for pre-enrolled employee/fleet devices

IS_DEMO=1

  • Hides Organization and Email fields from /status display
  • Suppresses project onboarding (skips hasCompletedProjectOnboarding check)
  • Used for live demos and marketing screenshots

SWE_BENCH_RUN_ID / SWE_BENCH_INSTANCE_ID / SWE_BENCH_TASK_ID

  • SWE-bench benchmark integration — IDs injected into every telemetry event
  • Fields: sweBenchRunId, sweBenchInstanceId, sweBenchTaskId
  • Anthropic uses this to run Claude Code against the SWE-bench evaluation harness

2. Infrastructure / Environment Overrides

OAuth Bridge Routing

USE_LOCAL_OAUTH=1  or  LOCAL_BRIDGE=1  →  ws://localhost:8765       (local dev)
USE_STAGING_OAUTH=1                    →  wss://bridge-staging.claudeusercontent.com
(default)                              →  wss://bridge.claudeusercontent.com
  • LOCAL_BRIDGE=1 also affects Claude-in-Chrome (CFC) socket path
  • CLAUDE_LOCAL_OAUTH_API_BASE / CLAUDE_LOCAL_OAUTH_APPS_BASE / CLAUDE_LOCAL_OAUTH_CONSOLE_BASE — override individual OAuth API endpoints to localhost

SESSION_INGRESS_URL

  • Overrides the session ingress URL for CCR remote sessions
  • Used when sending/receiving events to remote agent sessions

BETA_TRACING_ENDPOINT + ENABLE_BETA_TRACING_DETAILED=1

  • Enables full OTEL span + log export to arbitrary endpoint
  • Sends to ${BETA_TRACING_ENDPOINT}/v1/traces and /v1/logs
  • Gate: tengu_trace_lantern OR enterprise/team subscription
  • Also: CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1 / ENABLE_ENHANCED_TELEMETRY_BETA=1

TEAM_MEMORY_SYNC_URL

  • Override team memory sync endpoint (default: BASE_API_URL)
  • Calls: ${TEAM_MEMORY_SYNC_URL}/api/claude_code/team_memory?repo=<repo>

VOICE_STREAM_BASE_URL

  • Override voice streaming WebSocket endpoint
  • Default: BASE_API_URL (https → wss)
  • Stream params: linear16 PCM, 16kHz, mono, Deepgram Nova3 STT, 300ms endpointing

3. XAA — External Authentication Authority (SEP-990)

CLAUDE_CODE_ENABLE_XAA=1

  • Enables XAA OIDC federation mode (described as "SEP-990 IdP connection")
  • Adds xaaIdp field to settings schema with:
    {
      "issuer": "https://your-idp.example.com",
      "clientId": "claude-code-client",
      "callbackPort": 9876
    }
  • MCP_XAA_IDP_CLIENT_SECRET — IdP client secret for XAA OIDC flow
  • Allows enterprises to federate Claude Code auth through their own IdP
  • "Configure once; all XAA-enabled MCP servers reuse this"

4. API Request Control

CLAUDE_CODE_EXTRA_BODY

  • Inject arbitrary JSON into every API request body
  • Merges with request: {...requestBody, ...parsedJSON}
  • Can override anthropic_beta array (deduplicates with built-in betas)
  • Example: CLAUDE_CODE_EXTRA_BODY='{"thinking":{"type":"enabled","budget_tokens":32000}}'

CLAUDE_CODE_SIMULATE_PROXY_USAGE=1

  • Strips ALL beta headers from API requests before sending
  • Logs: "stripping N beta headers from request: [list]"
  • Used to simulate proxy/bare-API behavior without betas

CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1

  • Forces fixed token budget instead of {type:"adaptive"} thinking
  • When disabled: uses xIq(model) as budget, capped to contextWindow-1

DISABLE_INTERLEAVED_THINKING=1

  • Removes interleaved-thinking-2025-05-14 beta header from requests

CLAUDE_CODE_DISABLE_1M_CONTEXT=1

  • Disables 1M context window for claude-sonnet-4 and opus-4-6 models
  • iT(model) checks for [1m] model suffix — returns false when this is set

CLAUDE_CODE_EXTRA_METADATA

  • Inject custom JSON into telemetry user_id metadata object
  • Merged into: {device_id, account_uuid, session_id, ...yourJSON}

5. Plan Mode V2 Controls

CLAUDE_CODE_PLAN_MODE_REQUIRED=1

  • Forces plan mode on every interaction (sets planModeRequired)

CLAUDE_CODE_PLAN_V2_AGENT_COUNT (1–10)

  • Override parallel plan agent count
  • Default by tier: max+20x → 3, enterprise/team → 3, otherwise → 1
  • Hardcap: 10

CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT (1–10)

  • Override plan explore agent count (default: 3)

CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE=1

  • Enable interview phase in plan mode (gated by tengu_plan_mode_interview_phase flag)

6. CCR (Cloud Code Runner) Infrastructure

Environment Kinds (CLAUDE_CODE_ENVIRONMENT_KIND)

Value Meaning
bridge Bridge mode — spawns child process, relays messages
byoc Bring Your Own Compute
anthropic_cloud Anthropic-hosted cloud runner

CCR v2 Protocol

  • CLAUDE_CODE_USE_CCR_V2=1 — Use SSE-based transport (/worker/events/stream)
  • CLAUDE_CODE_WORKER_EPOCH — Worker epoch integer for CCR v2 handshake
  • CLAUDE_BRIDGE_USE_CCR_V2=1 — Force CCR v2 in bridge mode

BYOC Beta

  • Hardcoded beta header: "anthropic-beta": "ccr-byoc-2025-07-29" (future-dated)
  • Used on /v1/sessions, /v1/sessions/:id, /v1/sessions/:id/events

CCR Bundle Mode

  • CCR_FORCE_BUNDLE=1 — Force git bundle upload (bypasses GitHub app check)
  • CCR_ENABLE_BUNDLE=1 — Enable bundle mode (also controlled by tengu_ccr_bundle_seed_enabled)

7. Cowork Mode

CLAUDE_CODE_IS_COWORK=1

  • Marks session as cowork — triggers eager flush after each turn

CLAUDE_CODE_USE_COWORK_PLUGINS=1

  • Reads plugins from cowork_settings.json instead of settings.json

CLAUDE_COWORK_MEMORY_PATH_OVERRIDE

  • Override the cowork memory file path

CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES

  • Inject additional text into the memory system prompt for cowork sessions

8. Context Window Controls

CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE

  • Override token count at which the UI blocks with a hard "context full" error
  • Integer (tokens). Bypasses the calculated Kc(model, contextWindow) - _47 limit

CLAUDE_AUTOCOMPACT_PCT_OVERRIDE

  • Float 0–100: percentage of context at which auto-compact triggers
  • E.g., CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=90 → compact at 90% full

9. Speed / Model Flags

CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK=1

  • Bypass org-tier check for Fast Mode (Penguin Mode)
  • UD1() returns true → skips checking if org has fast mode enabled

Per-model prompt cache disable

  • DISABLE_PROMPT_CACHING_HAIKU=1
  • DISABLE_PROMPT_CACHING_SONNET=1
  • DISABLE_PROMPT_CACHING_OPUS=1
  • ENABLE_PROMPT_CACHING_1H_BEDROCK=1 — Enable 1-hour TTL cache for Bedrock

FALLBACK_FOR_ALL_PRIMARY_MODELS=1

  • Enable model fallback for all primary models (not just haiku)

10. Testing Infrastructure

VCR_RECORD=1

  • Record HTTP cassette fixtures to disk
  • In CI without this: throws "Fixture missing: X. Re-run tests with VCR_RECORD=1"
  • Two cassette formats: tool results and raw Anthropic API responses

CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING

  • Override the stall detection timeout (default from NFz constant)

TEST_ENABLE_SESSION_PERSISTENCE=1

  • Enable prompt history persistence in test mode (normally skipped when NODE_ENV=test)

CLAUDE_CODE_TEST_FIXTURES_ROOT

  • Custom root directory for test fixtures

11. Debug / Profiling

CLAUDE_CODE_PROFILE_STARTUP=1

  • Enable startup timing profiling
  • Fires tengu_startup_perf telemetry event with: import_time, init_time, settings_time, total_time
  • Also randomly enabled at 0.5% rate (Math.random() < 0.005)

CLAUDE_CODE_PROFILE_QUERY

  • Enable per-query profiling (turn-level metrics)

CLAUDE_CODE_PERFETTO_TRACE=1

  • Enable Perfetto trace format output (Chrome DevTools compatible)
  • Emits process_name and thread_name metadata events

CLAUDE_CODE_FRAME_TIMING_LOG=1

  • Log React render frame timing

CLAUDE_CODE_DEBUG_REPAINTS=1

  • Highlight terminal repaints (UI debugging)

12. Claude in Chrome (CFC)

CLAUDE_CODE_ENABLE_CFC=1

  • Enable Claude-in-Chrome browser extension integration
  • Enables claudeInChromeDefaultEnabled settings field
  • Also controlled by tengu_chrome_auto_enable flag + PT() (isTTY check)

CLAUDE_CHROME_PERMISSION_MODE

  • Set permission mode for Chrome integration (validated against allowed list)

Bridge WebSocket

  • Production: wss://bridge.claudeusercontent.com
  • Staging: wss://bridge-staging.claudeusercontent.com
  • Local: ws://localhost:8765

13. Remote Control / REPL Modes

CLAUDE_REPL_MODE=1

  • Enable REPL mode (interactive tool use loop)
  • CLAUDE_CODE_REPL=0 can explicitly disable even if CLAUDE_REPL_MODE is set

EMBEDDED_SEARCH_TOOLS=1

  • Enable embedded search tools (only if CLAUDE_CODE_ENTRYPOINT is not sdk-ts/sdk-py/sdk-cli/local-agent)

CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX

  • Custom prefix for remote control session names

CLAUDE_CODE_ENTRYPOINT known values

Value Context
cli Default CLI (default)
local-agent Local agent mode
claude-desktop Desktop app
remote Remote deployment
sdk-ts TypeScript SDK
sdk-py Python SDK
sdk-cli CLI via SDK

14. SAFEUSER (GitHub Automation)

SAFEUSER

  • Injected as $SAFEUSER in PR template context alongside $USER
  • Used in automated PR creation workflows (CI bots, agent-generated PRs)
  • Template: ## Context\n- \SAFEUSER`: ${SAFEUSER}\n- `whoami`: ${USER}`

Summary Table

Flag Category Effect
CLAUBBIT=1 Employee Skip TrustDialog
CLAUDE_TRUSTED_DEVICE_TOKEN Employee Skip device enrollment
IS_DEMO=1 Employee Hide org/email, skip onboarding
SWE_BENCH_* Benchmark SWE-bench eval mode IDs
USE_LOCAL_OAUTH=1 Infra Route OAuth bridge to localhost:8765
USE_STAGING_OAUTH=1 Infra Route to staging bridge
CLAUDE_CODE_ENABLE_XAA=1 Enterprise Custom OIDC IdP federation (SEP-990)
CLAUDE_CODE_EXTRA_BODY API Inject arbitrary request body JSON
CLAUDE_CODE_SIMULATE_PROXY_USAGE=1 API Strip all beta headers
CLAUDE_CODE_PLAN_V2_AGENT_COUNT Plan Override parallel agent count (1–10)
CCR_BYOC_BETA CCR Future-dated beta: ccr-byoc-2025-07-29
CLAUDE_CODE_IS_COWORK=1 Cowork Eager flush mode
CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE Context Override hard context block limit
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE Context Override compact threshold %
CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK=1 Speed Bypass org check for Fast Mode
VCR_RECORD=1 Testing Record HTTP cassette fixtures
BETA_TRACING_ENDPOINT Debug Export full OTEL traces to custom endpoint
CLAUDE_CODE_PERFETTO_TRACE=1 Debug Perfetto trace output
LOCAL_BRIDGE=1 Dev Chrome bridge to localhost
SAFEUSER CI GitHub automation user identity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment