You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
SessionsArea: what it touches
ImprovementsKind: in v2.1.302,
ImprovementsSection of the release
What
A background session is a Claude Code session that keeps running without your terminal attached. An LLM gateway is a proxy your requests to the model go through, usually set with ANTHROPIC_BASE_URL. A gateway set only in your shell is not passed to a background session opened from another folder. Claude Code now marks that case with CLAUDE_BG_GATEWAY_WITHHELD. An environment variable is a named value set in your shell before you start a program.
When CLAUDE_BG_GATEWAY_WITHHELD is set and ANTHROPIC_BASE_URL is not, sign-in errors show a gateway message: "No LLM gateway: a gateway set in your shell isn't passed to a session opened from another folder."
That message tells you to run claude respawn <id> from the original folder, or to set ANTHROPIC_BASE_URL in an env block in your settings.
The status line shows "No LLM gateway: opened from another folder" in place of "Not logged in · Run /login".
CLAUDE_BG_GATEWAY_WITHHELD is now deleted in the same cleanup that removes the other CLAUDE_BG_* variables, which it was not before.
Before, the same situation produced a generic sign-in failure or "Not logged in · Run /login".
Why
If you reach the model through a gateway, the old login prompt pointed you at the wrong fix. The new message names the missing gateway and the two ways to supply it. Clearing the variable stops the marker from being passed on to sessions that Claude Code starts later.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added sinceA small documentation edit on On a remote host without a browser: touched a line naming ANTHROPIC_BASE_URL after this was published.To override the key for a single invocation, pass [`--api-key-stdin`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/using#global-flags) and pipe the key to the command. To point at a different API host, set `ANTHROPIC_BASE_URL…cli-sdks-libraries/cli/authenticationsee the edit
Confirmed sinceAnthropic's documentation has since written up ANTHROPIC_BASE_URL, on Monitoring.Claude Code counts each streaming response toward the cost and token metrics exactly once, including when a gateway or proxy behind `ANTHROPIC_BASE_URL` streams usage progressively across multiple frames.monitoring-usagesee the edit
How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up ANTHROPIC_BASE_URL, on Monitoring.