process.env.USER_TYPE Build-Time Branch
- Entity ID:
ent-20260420-pb15a0000t2 - Type:
concept - Scope:
shared - Status:
active - Aliases: USER_TYPE === 'ant', ant vs external
Description
Dead-code-eliminated branch gate. Internal Anthropic builds set USER_TYPE='ant' which unlocks internal-only code paths; external builds replace process.env.USER_TYPE with the literal string 'external' at build time via esbuild's define, causing those branches to be tree-shaken. The invariant: external bundles must not contain any live USER_TYPE==='ant' branch.
Key claims
- Production bundle inlines USER_TYPE='external' to DCE internal branches
Relations
- scripts/build-bundle.ts (esbuild Production Config) --[uses]--> process.env.USER_TYPE Build-Time Branch