[BUG] claudeCode.* settings are automatically deleted from user settings on extension activation

Status Fixed / completed
Maintainer reply ✓ Yes — hackyon-anthropic
Activity 6 comments · opened Oct 24, 2025 · closed Oct 24, 2025
💡 Likely answer: A maintainer (hackyon-anthropic, collaborator) responded on this thread — see the highlighted reply below.

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

  1. Disable the Claude Code extension (Anthropic.claude-code)
  1. 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
``

  1. Enable the Claude Code extension
  1. Reload VSCode window (Cmd+R or "Developer: Reload Window")
  • Result: All claudeCode.* settings are deleted from user settings.json ✗
  1. 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.json customizations → 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

View original on GitHub ↗

6 Comments

hidekuro · 10 months ago

Additional Finding: All claudeCode.* settings are affected

I conducted additional testing and discovered that this issue affects all claudeCode.* settings in user settings, not just claudeCode.environmentVariables.

Test:
Added both settings to user settings.json:

"claudeCode.environmentVariables": [...],
"claudeCode.useTerminal": false

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?

hidekuro · 10 months ago

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:

  • The issue reproduces when reloading/restarting VSCode on the host machine (not just in DevContainer)
  • The settings are deleted shortly after the extension loads
  • With the extension disabled, settings remain intact across all scenarios (VSCode reload, DevContainer open, etc.)

Reproduction scenarios where settings are deleted:

  • Reloading VSCode window (Cmd+R / "Developer: Reload Window")
  • Restarting VSCode
  • Opening a workspace in DevContainer
  • Any other scenario where the extension is activated

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.

aceHubert · 10 months ago
## 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: The issue reproduces when reloading/restarting VSCode on the host machine (not just in DevContainer) The settings are deleted shortly after the extension loads With the extension disabled, settings remain intact across all scenarios (VSCode reload, DevContainer open, etc.) Reproduction scenarios where settings are deleted: Reloading VSCode window (Cmd+R / "Developer: Reload Window") Restarting VSCode Opening a workspace in DevContainer * Any other scenario where the extension is activated 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

hackyon-anthropic collaborator · 10 months ago

Sorry for this, I am working on a fix and going to roll out a hot fix today

hackyon-anthropic collaborator · 10 months ago

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?

github-actions[bot] · 10 months ago

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.