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

Resolved 💬 6 comments Opened Oct 24, 2025 by hidekuro Closed Oct 24, 2025

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 ↗

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