CLAUDE_CODE_USE_GATEWAY
A Claude Code environment variable, read out of the shipped bundle. It has been in the build since v2.1.195, including the newest one read.
CLAUDE_CODE_USE_GATEWAY now passes down to spawned agent processes, so gateway routing is no longer dropped.
Not Anthropic's. This is the line from the earliest changelog entry here that named it, v2.1.242.
In the changelogs
16Releases whose published page names CLAUDE_CODE_USE_GATEWAY.
-
v2.1.305
claude plugin evalpasses your session's API key to its test runsWith an API key session,
claude plugin evalnow hands the key to its test runs itself, except on Windows, where you must setANTHROPIC_API_KEYfound in this entry's text
-
v2.1.293
New setting lets Claude Desktop run Claude Code in gateway mode
With
inferenceGatewayManagedClaudeCodeon, Desktop runs Claude Code in gateway mode for gateway sign-ins, turning off usage analyticsfound in this entry's text, named in this entry
-
v2.1.293
Leftover AWS, Google Cloud and gateway provider variables are now cleared
When Claude Code sets up a provider's environment, it now also blanks
CLAUDE_CODE_USE_ANTHROPIC_AWS,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUDandCLAUDE_CODE_USE_GATEWAYfound in this entry's text
-
v2.1.290
Auth status marks the unused credential, and a clearer gateway file error
The auth status display marks the credential not in use, and gateway credential restore explains when the file is refused
found in this entry's text
-
v2.1.281
Remote managed settings are not written to disk when the provider is managed by the host
When a host manages the provider through a gateway, remote managed settings are no longer cached to disk and host policy merges by default
found in this entry's text, named in this entry
-
v2.1.281
Remote managed settings fetch: public-address gateway refusal and richer diagnostics
Fetching remote managed settings now refuses gateways that resolve to a public address and reports more about failures
found in this entry's text
-
v2.1.281
CLAUDE_CODE_HOST_GATEWAY_LINEAGE: new env var that marks sessions spawned by a Claude Desktop gatewayNew CLAUDE_CODE_HOST_GATEWAY_LINEAGE variable keeps child processes of a Desktop-hosted gateway session treated as host-managed
found in this entry's text
-
v2.1.281
Background-session child environment: auth and new variables handled explicitly
Background sessions now start from a cleaned environment, with login variables added back and some internal variables left out
found in this entry's text
-
v2.1.281
New managed-policy check for Desktop-hosted gateways
When Claude Desktop runs Claude Code through a gateway, Claude Code now checks that gateway against your organization's policy and explains failures
found in this entry's text, named in this entry
-
v2.1.266
Cloud gateway sign-in error message shortened
The Cloud gateway sign-in error message dropped its instructions for CLAUDE_CODE_USE_GATEWAY, ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN
named in this entry, found in this entry's text
-
v2.1.266
CLAUDE_CODE_USE_GATEWAY no longer selects gateway auth mode directly
Setting CLAUDE_CODE_USE_GATEWAY alone no longer switches Claude Code into gateway auth mode
named in this entry, found in this entry's text
-
v2.1.265
Gateway session messaging simplified/unified for Remote Control
Remote Control's gateway-blocked message is now a single generic explanation instead of two separate cases
found in this entry's text
-
v2.1.265
Cloud gateway sign-in check reworked with desktop-app-aware error and new required flag
Cloud gateway sign-in check reworked with a clearer error and desktop-app-aware handling
found in this entry's text
-
v2.1.257
New gateway credential hand-off lock retry
A gateway credential hand-off file locked by another process, such as antivirus, is now retried once instead of failing.
found in this entry's text, named in this entry
-
v2.1.242
Gateway routing is passed down to spawned agent-team processes
CLAUDE_CODE_USE_GATEWAY now passes down to spawned agent processes, so gateway routing is no longer dropped.
named in this entry, found in this entry's text
-
v2.1.242
Gateway credentials reworked with a TLS pin store
Gateway credential handling reuses pinned entries and gives clearer errors for bad base URLs.
named in this entry, found in this entry's text
First cited
4The earliest release whose published evidence quoted CLAUDE_CODE_USE_GATEWAY was v2.1.242, 24 Aug 2026. That is the oldest release this project wrote about it, so it is a floor on the name's age and not the release that introduced it. It is not a presence reading: which builds carried the name is the table below.
Presence across releases
1Build by build
102One row per release since the first build this name was read out of. Absent means the build was read and the name was not in it, never mined means no bundle for that release was ever archived, and a declared type or a default is only ever what that release's own bundle stated.
Read out of the published npm bundle release by release, and out of Anthropic's own documentation as this site captured it. Nothing on this page is a description anybody here wrote about what the environment variable does. All environment variables.