Claude Code VS Code extension's env var contributions are registered too late, causing every new terminal to require manual relaunch
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?
The Claude Code for VS Code extension contributes environment variables to the integrated terminal, but the contribution is registered too late in the activation lifecycle. As a result, VS Code's auto-relaunch (terminal.integrated.environmentChangesRelaunch: true, the default) cannot succeed, and every newly opened integrated terminal shows a warning prompting manual relaunch.
Hovering the warning shows (Japanese UI):
次の拡張機能がこのターミナルの環境に変更を加えるため、ターミナルの再起動を要求しています。 Claude Code for VS Code
Note: shell integration itself shows as "Rich" — basic shell integration is working. The warning is about additional env var contributions that are not applied to the current terminal.
This forces a choice between:
- Click "Relaunch" every single time a terminal is opened (tedious)
- Ignore the warning and lose
/ideintegration features when invokingclaudefrom that terminal — requiring the user to kill and restart their Claude Code session mid-work if they later need those features
What Should Happen?
Either of the following:
- Auto-relaunch succeeds on first terminal open — env vars contributed by the extension are registered during activation (synchronously, before any terminal opens), allowing VS Code's
environmentChangesRelaunchto do its job without any warning shown.
- Or, an opt-out setting like
claude-code.terminal.contributeEnvironment: falseis provided for users who don't need/ideintegration from terminal-launchedclaudesessions, so the warning never appears for them.
- Or, the extension defers env var contribution to the next terminal open rather than triggering a warning on existing terminals — eliminating both the warning and the manual action.
Error Messages/Logs
Steps to Reproduce
- Install Claude Code for VS Code extension on Windows with PowerShell as the default integrated shell.
- Open VS Code (fresh start).
- Open a new integrated terminal (Ctrl+`).
- Observe: a warning indicator appears on the terminal tab immediately, even though the user has not interacted with the terminal yet.
- Confirm
terminal.integrated.environmentChangesRelaunchistruein settings.json (or unset, since true is the default). - Observe: no auto-relaunch occurs. The warning remains until the user manually clicks "Relaunch".
- This repeats every time a new terminal is opened.
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.126
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Environment details:
- OS: Windows 11 Home (10.0.26200)
- Shell: PowerShell 7+ (pwsh)
- Other extensions also contributing env vars to the same terminal: GitLens (GK CLI integration) — but the same warning behavior reproduces with Claude Code alone.
Related issues (please consider re-evaluating):
- #11157 — VS Code extension prompts to relaunch terminal after update (closed as "not planned", but the underlying user-impact persists)
- #3367 — Terminal Relaunch Prompt Persists After Extension Update
- microsoft/vscode#247339 — upstream issue confirming
environmentChangesRelaunchdoes not reliably auto-relaunch when extensions register env vars after terminal startup
Why this is worth revisiting:
The previous "not planned" closure focused on the cosmetic warning. The functional impact is real: users who ignore the warning lose /ide integration silently, and only discover it when they need the feature mid-session — at which point they must kill their Claude Code session, relaunch the terminal, and start over. A small change to extension activation timing (or an opt-out setting) would resolve this cleanly.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗