[BUG] Environment Contributions warning continuously reappears

Status Open
Maintainer reply None cached
Activity 45 comments · opened Jul 10, 2025

Environment

Claude Code Status v1.0.25

Bug Description

On every open of Cursor or VSCode IDEs, the below warning always reappears in the integrated terminal:

The following extensions want to relaunch the terminal to contribute to its environment:

Claude Code

The user must constantly restart the terminal in order to get environment contributions to take effect. This is not the case for other popular VSCode / Cursor extensions.

<img width="612" height="341" alt="Image" src="https://github.com/user-attachments/assets/dc6936e6-222f-40d1-ba55-eb0a0ce1041c" />

View original on GitHub ↗

45 Comments

michaelitvin · 1 year ago

Happens to me too when running on Windows.

Claude Code Extension:
Identifier: anthropic.claude-code
Version: 1.0.31
Last Updated: 2025-07-05, 09:48:11
Published: 2025-06-18, 19:32:16
Last Released: 2025-06-21, 00:39:28

VSCode:
Version: 1.102.0 (user setup)
Commit: cb0c47c0cfaad0757385834bd89d410c78a856c0
Date: 2025-07-09T22:10:34.600Z
Electron: 35.6.0
ElectronBuildId: 11847422
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Windows_NT x64 10.0.26100

kenryu42 · 1 year ago

Same.

Claude Code Extension:
Identifier: anthropic.claude-code
Version: 1.0.51
Last Updated: 2025-07-15, 14:23:54
Source: VSIX

Cursor:
Version: 1.2.4 (Universal)
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T16:55:16.443Z (4 days ago)
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0

brentforder · 1 year ago

I just installed it for the first time to evaluate Claude Code for free, and I'm encountering this nuisance with every VSCode restart :/

Claude Code Extension:
Identifier: anthropic.claude-code
Version: 1.0.51
VSCode Version: 1.102.1 (Windows)
Last Updated: 2025-07-18, 16:01:53
Source: VSIX

jacobhallgren · 1 year ago

Same here, annoying

piotrpalek · 1 year ago

Same here, and disabling the ide integration / uninstalling it in vscode doesn't help either

jacobhallgren · 1 year ago

Please fix this. very annoying to setup terminal layout each vscode start.

dmytr0-wt · 1 year ago
Please fix this. very annoying to setup terminal layout each vscode start.

Agree! Please fix it!

cookiepingyen · 1 year ago

Same here!

Claude Code Extension:
Identifier anthropic.claude-code
Version 1.0.64
Last Updated 2025-07-31, 18:01:02
Source VSIX

VSCode:
Version: 1.102.3 (Universal)
Commit: 488a1f239235055e34e673291fb8d8c810886f81
Date: 2025-07-29T03:00:23.339Z (2 days ago)
Electron: 35.6.0
ElectronBuildId: 11847422
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Darwin arm64 24.5.0

tylerawalker · 1 year ago

Any updates on this?

Claude code extension:
Identifier: anthropic.claude-code
Version: 1.0.96
Last Updated: 2025-08-29, 09:50:48

VSCode:
Version: 1.103.2 (Universal)
Commit: 6f17636121051a53c88d3e605c491d22af2ba755
Date: 2025-08-20T16:45:34.255Z (1 wk ago)
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Darwin arm64 24.5.0

vjekob · 12 months ago

This is unbelievably annoying. My toolchain depends on 5 separate terminal windows, all of which couldn't care less about Claude Code, yet Claude Code extension wants to "contribute" to them?

The only terminal that Claude should care about is the one that opens when Claude Code's terminal icon is clicked.

This requires fixing. Until it gets it, the extension stays off for me, because anything useful it does is massively overshadowed by annoying terminal warnings.

jacobhallgren · 12 months ago

Yeah what is the status here?

christopher-buss · 11 months ago

There are extensions such as Mise that have a setting to automatically restart terminals when they want to contribute to the environment variable - perhaps an option like this could happen if the extension needs to contribute?

I have to have this setting off with Claude because it restarts the terminal and then I lose the Claude Code chat as it doesn't know how to restart from it - so maybe it could restart the terminal + CC has the ability to auto-continue where it left off when restarted like this.

brianpaden · 11 months ago

Still seeing issue:

VS Extension:
Identifier
anthropic.claude-code
Version
1.0.123
Last Updated
2025-09-24, 00:02:03

VS Code:
Version: 1.104.0 (user setup)
Commit: f220831ea2d946c0dcb0f3eaa480eb435a2c1260
Date: 2025-09-10T06:46:18.035Z
Electron: 37.3.1
ElectronBuildId: 12342881
Chromium: 138.0.7204.235
Node.js: 22.18.0
V8: 13.8.258.31-electron.0
OS: Windows_NT x64 10.0.26100

mvc24 · 11 months ago

Same here, this really needs to be fixed. I need to be able to see which terminal is which, and not just this:

<img width="261" height="170" alt="Image" src="https://github.com/user-attachments/assets/0edf920c-a0f2-405e-a5f3-db674fd48a67" />

OrzMiku · 11 months ago

This bug is so annoying, making me feel like ants are crawling all over me

tjx666 · 11 months ago

So annoying:

<img width="646" height="733" alt="Image" src="https://github.com/user-attachments/assets/2797cdb4-7de6-4de4-8d70-d4a36be32423" />

hexadecimal233 · 9 months ago

copilot is prompting me to restart terminal as well:

<img width="772" height="118" alt="Image" src="https://github.com/user-attachments/assets/0f4d2b25-c977-45c9-b570-2bc84544791a" />

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

christopher-buss · 8 months ago

Still exists

AlexRuiz7 · 7 months ago

Really annoying.

ElectQ · 7 months ago

This issue is indeed very annoying and has affected the daily user experience of many. We hope the development team can fix this problem as soon as possible, allowing the terminal environment contribution feature to work properly and reduce unnecessary restart operations.

hcai-soundhound · 7 months ago

Still there.

DBrider3 · 6 months ago

This is not a fundamental solution, but install the Auto Run Command extension and add this to settings.json to get a new terminal after Claude Code initializes:

"auto-run-command.rules": [
    {
        "command": [
            "workbench.action.terminal.killAll",
            "workbench.action.terminal.new"
        ],
        "delay": 5000,
        "scope": "folderOpen"
    }
]
amargolis · 5 months ago
This is not a fundamental solution, but install the Auto Run Command extension and add this to settings.json to get a new terminal after Claude Code initializes: `` "auto-run-command.rules": [ { "command": [ "workbench.action.terminal.killAll", "workbench.action.terminal.new" ], "delay": 5000, "scope": "folderOpen" } ] ``

Will this kill all of my open terminal windows from the previous session? For example, if I have four CC terminal windows in VS Code, when I quit VS Code and relaunch, will those four terminal windows be gone, or will they be magically reconnected to Claude Code?

james-berkheimer · 5 months ago

Experiencing this issue on a Remote SSH setup (VS Code connecting to a Linux host). The terminal continuously requests a relaunch to contribute to the Claude Code extension's environment.

The following settings have no effect on the behavior:

  • "terminal.integrated.environmentChangesRelaunch": false (set in both User and Remote scopes)
  • "terminal.integrated.environmentChangesIndicator": "off" (deprecated)
  • "terminal.integrated.experimental.aiProfileGrouping": false

Disabling the Claude Code extension on the remote side stops the relaunch loop. Re-enabling it brings it back immediately.

The extension's useTerminal setting is unchecked — the extension is not configured to use the terminal as its UI, yet it still injects environment variables into every terminal instance and triggers the relaunch prompt.

Environment:

  • Platform: Remote SSH (Linux host)
  • VS Code with Remote - SSH extension
  • Claude Code for VS Code (latest: 2.1.86)
  • Shell: bash
  • Python 3.11.11 (.venv)
yurukusa · 5 months ago

This warning appears because the Claude Code extension modifies the terminal environment (adding PATH entries, env vars) on every IDE launch, and VSCode/Cursor detects that and prompts for a restart.
Workaround 1 — Auto-accept environment contributions:
In VSCode/Cursor settings, add:

{
  "terminal.integrated.environmentChangesRelaunch": false
}

This tells the IDE to apply environment changes silently without showing the warning or requiring a restart.
Workaround 2 — Disable terminal environment integration:
If the Claude Code extension's terminal environment changes aren't important to your workflow (they mainly ensure claude is on PATH):

{
  "claude-code.terminalEnvironment": false
}

(Check the exact setting name in the extension's settings page — it may vary by version.)
Workaround 3 — Add claude to PATH manually:
If claude is already on your system PATH, the extension's environment contribution is redundant. Verify with:

which claude

If it resolves, you can safely disable the extension's terminal integration without losing functionality.

james-berkheimer · 5 months ago
This warning appears because the Claude Code extension modifies the terminal environment (adding PATH entries, env vars) on every IDE launch, and VSCode/Cursor detects that and prompts for a restart. Workaround 1 — Auto-accept environment contributions: In VSCode/Cursor settings, add: { "terminal.integrated.environmentChangesRelaunch": false } This tells the IDE to apply environment changes silently without showing the warning or requiring a restart. Workaround 2 — Disable terminal environment integration: If the Claude Code extension's terminal environment changes aren't important to your workflow (they mainly ensure claude is on PATH): { "claude-code.terminalEnvironment": false } (Check the exact setting name in the extension's settings page — it may vary by version.) Workaround 3 — Add claude to PATH manually: If claude is already on your system PATH, the extension's environment contribution is redundant. Verify with: which claude If it resolves, you can safely disable the extension's terminal integration without losing functionality.

Appreciate the response, but none of the workarounds work for my setup:

Workaround 1: "terminal.integrated.environmentChangesRelaunch": false is already set in both User and Remote scopes. It does not prevent the relaunch prompt in a Remote SSH context.

Workaround 2: "claude-code.terminalEnvironment" is not a recognized setting. VS Code flags it as unknown and it has no effect.

Workaround 3: which claude returns nothing. Claude Code is installed only as a VS Code extension — there is no CLI binary on the remote host. There is nothing to add to PATH.

The core issue is that the extension injects terminal environment changes even when claudeCode.useTerminal is false and the extension is used exclusively from the panel. If the environment contribution exists solely to put claude on PATH for CLI usage, it should not activate when the CLI is not installed and the terminal UI is disabled.

jappp · 5 months ago

Still there.

TaufiqSyed · 4 months ago

I'm just hiding VS Code terminal tabs till this is fixed. It's kind of distracting to have a yellow warning marker on a clean project.

dortega-fce · 4 months ago

+1

RE-codes · 4 months ago

It's coming up on a _year_ with this bug. This is not confidence inspiring. A half-trillion dollar company selling the most advanced technology ever created. And they ship this bug over and over....

jachin84 · 4 months ago

This is very frustrating, please fix.

mvc24 · 3 months ago

This is still happening, please finally fix it!

antonioborondo · 3 months ago

+1

patrick-martin-39797 · 3 months ago

Super annoying, please fix!

Misyra · 2 months ago

+1

filipecustodio · 2 months ago

Bug exists in my environment too (Mac OS + latest VS Code + latest Claude Code VS Code plugin).

quicmic · 1 month ago

Please fix that soon!

andrea-cerlini · 1 month ago

Happy one year anniversary of this unresolved issue 🎉
I have it too, on Windows 11, latest VS Code version, latest VS Code Claude Code extension version

igornassif · 1 month ago

Still happening.

gerbus · 1 month ago

Very annoying!

nenadmarinkovic · 1 month ago

Still not fixed. Partial workaround that works for me on macOS: add "terminal.integrated.hideOnStartup": "always" to your settings.json. This prevents the terminal from auto-opening. Then set a keyboard shortcut to toggle the terminal (I use Ctrl+T).

antonioborondo · 1 month ago
Still not fixed. Partial workaround that works for me on macOS: add "terminal.integrated.hideOnStartup": "always" to your settings.json. This prevents the terminal from auto-opening. Then set a keyboard shortcut to toggle the terminal (I use Ctrl+T).

Unfortunately, this trick doesn't work on Windows 😔

anne-skydancer · 1 month ago

Some concrete root-cause detail from digging through the bundled extension (v2.1.215, Windows, VS Code 1.129.1), in case it helps whoever picks this up:

Why the warning reappears every single window launch: on activation the extension starts its IDE-integration MCP server on a random free port, then calls environmentVariableCollection.replace("CLAUDE_CODE_SSE_PORT", String(port)). The injection helper skips the write when the value is unchanged, but since the port is newly randomized each session, the value virtually always changes — so every window start produces a fresh env contribution after restored/existing terminals are already running. VS Code can only auto-relaunch terminals that haven't been interacted with, so every restored or in-use terminal goes stale and shows the relaunch warning, every session.

Why users can no longer suppress it: terminal.integrated.environmentChangesIndicator has been removed from current VS Code (it's gone from the 1.129 configuration registry), so the old "hide the indicator" workaround silently stopped working. There is also no claudeCode.* setting to opt out of the terminal env contribution.

Possible fixes, in order of preference:

  1. Register the contribution eagerly during activation, before terminal restoration completes, so terminal.integrated.environmentChangesRelaunch (default true) can apply it silently.
  2. Stabilize the port per workspace (persist and re-bind, falling back to a new port only when taken) so the collection value doesn't churn every launch.
  3. Add an opt-out setting (e.g. claudeCode.contributeTerminalEnvironment: false) for users who use the panel UI and never run claude from the integrated terminal — for them the contribution is pure noise.

Current user-side mitigations that make it bearable: terminal.integrated.enablePersistentSessions: false (no stale restored terminals at startup) plus a keybinding for workbench.action.terminal.relaunch to accept without the (truncated, unscrollable) hover.

Profesor08 · 17 days ago

<img width="163" height="64" alt="Image" src="https://github.com/user-attachments/assets/e3608d0f-8e91-4a38-bf89-868aa387f809" />

This happens when VSCode is starting with some open terminal. Claude itself unable to solve it on my side. Also played with various flags related to terminal with no luck.

  System:
    OS: Windows 11 10.0.26200
    CPU: (24) x64 AMD Ryzen 9 3900XT 12-Core Processor           
    Memory: 15.27 GB / 31.92 GB
bash

Process ID (PID): 30128

Command line: C:\Program Files\Git\bin\bash.exe --init-file 'c:\Users\prof\AppData\Local\Programs\Microsoft VS Code Insiders\661f18fdeb\resources\app\out\vs\workbench\contrib\terminal\common\scripts/shellIntegration-bash.sh'

The following extensions have contributed to this terminal's environment:

GitHub Copilot: Enables use of copilot-debug and copilot commands in the terminal
Claude Code for VS Code
Git: Enables the following features: git auth provider
Shell integration: Rich

Shell type: gitbash
Current working directory: D:/git/@product/project
Seen sequences: P, EnvSingleStart, EnvSingleEntry, EnvSingleEnd, A, B
Prompt input: |
 The following extensions want to relaunch the terminal to contribute to its environment:

Claude Code for VS Code