[BUG] claudeCode.environmentVariables are not applied in WSL (Remote) environment

Resolved 💬 6 comments Opened Mar 23, 2026 by smccnm Closed Mar 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using VS Code in a WSL (Windows Subsystem for Linux) remote environment, the environment variables defined in claudeCode.environmentVariables inside settings.json are completely ignored by the extension. The connection fails.

However, if I manually export the same variables directly in the WSL terminal, the extension successfully connects. This indicates that the extension's environment variable injection logic is failing specifically under the WSL/Remote context.

What Should Happen?

The extension should properly read claudeCode.environmentVariables from the remote settings.json and inject them into the extension's process context in WSL, just as it does in the local Windows environment.

Error Messages/Logs

Steps to Reproduce

  1. Open VS Code and connect to a WSL environment.
  2. Open the Remote settings.json (WSL: Ubuntu).
  3. Add the following configuration:
"claudeCode.environmentVariables": [
  {
    "key": "ANTHROPIC_BASE_URL",
    "value": "https://xxx.xx"
  },
  {
    "key": "ANTHROPIC_API_KEY",
    "value": "xx-xxx-..." // Redacted for security
  }
]

4. Attempt to use the extension. Result: Connection fails / Timeout.
5. Workaround: Open the integrated WSL terminal and run:
         export ANTHROPIC_BASE_URL="https://xxx.xx"
         export ANTHROPIC_API_KEY="xx-xxx-..."
6. Attempt to use the extension again. Result: Connects successfully.

### Claude Model

None

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.81

### Platform

Other

### Operating System

Windows

### Terminal/Shell

VS Code integrated terminal

### Additional Information

_No response_

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗