VSCode extension: `claudeCode.preferredLocation` silently overwrites an explicitly-set user preference

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 10, 2026

Environment

  • Extension: anthropic.claude-code v2.1.226 (darwin-arm64)
  • Host editor: Cursor
  • OS: macOS (Darwin 25.5.0)

Description

claudeCode.preferredLocation is documented as "Where Claude opens by default. This setting updates automatically when you open Claude in a new location."

That auto-update writes to user settings.json, so an incidental action silently overwrites a preference the user set deliberately. There is no way to pin the setting, and no indication it changed — the next session just opens somewhere else with no explanation.

Steps to reproduce

  1. Set "claudeCode.preferredLocation": "sidebar" in user settings.json.
  2. Open Claude in an editor tab — via Claude Code: Open in New Tab, Claude Code: Open in Primary Editor, or reopening a session in a way that lands in the editor area.
  3. Inspect user settings.json.

Expected

preferredLocation stays sidebar. It's a user preference; opening a session elsewhere once is a transient action, not a new default.

Actual

preferredLocation has been rewritten to panel. Every subsequent session opens as an editor tab. Setting it back to sidebar holds only until the next incidental tab open, at which point it silently flips again.

Impact

The failure is confusing rather than merely annoying, because the cause is invisible. From the user's side, an extension update appeared to relocate the UI permanently and ignore the setting meant to control it — there's nothing pointing at the self-write as the mechanism. Reverting the value looks like it didn't work, since the flip recurs later and seemingly at random.

Suggested fix

Separate the two concepts that are currently sharing one key:

  • Keep an internal, non-user-facing "last used location" for restore behavior.
  • Leave claudeCode.preferredLocation as a real preference that only changes when the user edits it.

If the auto-update behavior is intentional and worth keeping, please make it opt-in (e.g. claudeCode.rememberLastLocation, default off), and reword the setting description — "preferred" reads as user-owned, which is what makes the current behavior surprising

View original on GitHub ↗