VSCode Claude Code Panel Ignores Shell-Exported ANTHROPIC_BASE_URL, Here Is Why
Setting ANTHROPIC_BASE_URL in a terminal shell does not affect the Claude Code panel in VSCode because the extension spawns its agent process from the VSCode window environment, not the user's shell. This means any variables exported in a terminal after VSCode is already open are invisible to the panel. The correct way to inject environment variables into the panel is through the claudeCode.environmentVariables setting in VSCode's settings.json file. However, this setting applies machine-wide rather than per workspace, meaning enabling routing for one project affects all VSCode windows on that machine. A toolkit approach that manages only the six relevant Anthropic-related variable names — while preserving unrelated entries and backing up settings before any write — can help avoid accidental misconfigurations.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in