[BUG] claudeCode.* settings are automatically deleted from user settings on extension activation
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?
All claudeCode.* settings (e.g., claudeCode.environmentVariables, claudeCode.useTerminal) are automatically deleted from VSCode user settings (settings.json) when the Claude Code extension is activated/loaded.
The settings disappear shortly after:
- Opening/reloading VSCode window
- Opening a DevContainer
- Any scenario where the extension is reloaded
When the Claude Code extension is disabled, the settings remain intact, confirming that the extension itself is causing this behavior.
What Should Happen?
The claudeCode.environmentVariables setting in user settings should remain intact when opening a DevContainer. User settings should not be modified by the extension, especially when the setting is needed for using Claude Code across multiple projects.
Error Messages/Logs
No error messages are displayed. The setting is silently removed from settings.json.
Steps to Reproduce
- Disable the Claude Code extension (Anthropic.claude-code)
- Add any
claudeCode.*settings to VSCode user settings:
- Location:
~/Library/Application Support/Code/User/settings.json(macOS) - Example content:
``json``
"claudeCode.environmentVariables": [
{
"name": "CLAUDE_CODE_USE_VERTEX",
"value": "1"
},
{
"name": "CLOUD_ML_REGION",
"value": "us-east5"
},
{
"name": "ANTHROPIC_VERTEX_PROJECT_ID",
"value": "my-gcp-project-id"
},
{
"name": "ANTHROPIC_MODEL",
"value": "claude-sonnet-4-5@20250929"
},
{
"name": "ANTHROPIC_SMALL_FAST_MODEL",
"value": "claude-haiku-4-5@20251001"
}
],
"claudeCode.useTerminal": false
- Enable the Claude Code extension
- Reload VSCode window (Cmd+R or "Developer: Reload Window")
- Result: All
claudeCode.*settings are deleted from user settings.json ✗
- Alternative reproduction: Instead of step 4, open a DevContainer
- Result: Same - all
claudeCode.*settings are deleted ✗
Note: The issue occurs whenever the extension is activated/loaded, not specifically tied to DevContainer environments.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.26 (Claude Code)
Platform
Google Vertex AI
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
Workarounds Attempted (all failed):
- Adding setting to
.vscode/settings.json(workspace settings) → User settings still deleted - Adding setting to
devcontainer.jsoncustomizations → User settings still deleted - Adding
"settingsSync.ignoredSettings": ["claudeCode.environmentVariables"]→ User settings still deleted - Disabling Settings Sync → User settings still deleted
Impact:
This prevents users from maintaining environment variables in user settings when working with multiple repositories/projects that use DevContainers. Users need these settings in user scope to apply across all projects, not just workspace-specific.
Additional Context:
- The deletion only occurs on subsequent DevContainer opens (without rebuild)
- On first rebuild, settings are preserved
- The behavior is consistent and reproducible
- No other VSCode settings are affected, only
claudeCode.environmentVariables
6 Comments
Additional Finding: All
claudeCode.*settings are affectedI conducted additional testing and discovered that this issue affects all
claudeCode.*settings in user settings, not justclaudeCode.environmentVariables.Test:
Added both settings to user settings.json:
Result:
When opening DevContainer (without rebuild), both settings were removed from user settings.
Observation:
This suggests the behavior may be affecting all Claude Code settings in user scope when running in DevContainer environments. I'm curious if this is intentional or if there's a specific reason for this behavior.
For users working with multiple projects using DevContainers, it would be helpful to maintain these settings at the user level so they apply consistently across all projects. Is there a recommended approach for handling this use case?
Update: The issue is not DevContainer-specific
I initially thought this was related to DevContainer environments, but further testing revealed that the issue occurs whenever the Claude Code extension is activated/loaded.
New findings:
Reproduction scenarios where settings are deleted:
This suggests the extension may be clearing its user-level settings during the activation/initialization process. I'm curious if there's an intentional reason for this behavior, or if this might be unintended.
---
I've updated the issue title and description to reflect this more accurate understanding of the problem.
<img width="591" height="280" alt="Image" src="https://github.com/user-attachments/assets/4d862a5a-e3e5-4b15-a076-0e0d812c58e9" />
from here in extersion.js
Sorry for this, I am working on a fix and going to roll out a hot fix today
Some of the settings end up were reset when restarting :/
We have pushed out a hot fix in 2.0.27. Unfortunately, you may need to reapply the settings for it to work. Apologies for the inconvenience here!
When you get a chance, can you give it a try and see if it happens again?
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.