Claude Code VS Code extension's env var contributions are registered too late, causing every new terminal to require manual relaunch

Resolved 💬 3 comments Opened May 2, 2026 by seichisato-ai Closed May 5, 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?

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:

  1. Click "Relaunch" every single time a terminal is opened (tedious)
  2. Ignore the warning and lose /ide integration features when invoking claude from 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:

  1. 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 environmentChangesRelaunch to do its job without any warning shown.
  1. Or, an opt-out setting like claude-code.terminal.contributeEnvironment: false is provided for users who don't need /ide integration from terminal-launched claude sessions, so the warning never appears for them.
  1. 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

  1. Install Claude Code for VS Code extension on Windows with PowerShell as the default integrated shell.
  2. Open VS Code (fresh start).
  3. Open a new integrated terminal (Ctrl+`).
  4. Observe: a warning indicator appears on the terminal tab immediately, even though the user has not interacted with the terminal yet.
  5. Confirm terminal.integrated.environmentChangesRelaunch is true in settings.json (or unset, since true is the default).
  6. Observe: no auto-relaunch occurs. The warning remains until the user manually clicks "Relaunch".
  7. 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 environmentChangesRelaunch does 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.

View original on GitHub ↗

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