claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Option+K (Alt+K) overwrites context instead of adding multiple references in VS Code extension

Open mtskf opened this issue 1 month ago • 3 comments

Description

In the VS Code extension, using Option+K (Mac) / Alt+K (Windows/Linux) to add file context now overwrites the previous context instead of adding multiple references.

Previous Behavior

  • Option+K inserted an @file:line reference directly into the chat input field as text
  • Multiple uses of Option+K would add multiple @ references to the input
  • Users could easily add context from multiple files

Current Behavior

  • Option+K adds context to a panel below the chat input field
  • Using Option+K again replaces the previous context instead of adding to it
  • Users cannot add multiple file/selection contexts using this shortcut

Steps to Reproduce

  1. Open VS Code with Claude Code extension
  2. Open File A, select some code, press Option+K
  3. Context from File A appears in the context panel
  4. Open File B, select some code, press Option+K
  5. Expected: Both File A and File B contexts are shown
  6. Actual: Only File B context is shown (File A is overwritten)

Impact

This is a significant regression for workflows that require referencing multiple files:

  • Comparing two files
  • Asking about relationships between components and their types
  • Refactoring code that spans multiple files

Workaround

  • Manually type @file1 @file2 in the chat input
  • Drag and drop files (limited functionality per #3967)

Environment

  • VS Code: 1.108.0
  • Claude Code Extension: Latest version
  • OS: macOS

Related Issues

  • #3967 (multiple files context via drag-and-drop)

mtskf avatar Jan 15 '26 00:01 mtskf

Additional Context

This is a confirmed regression. The previous behavior (inserting @file:line as text in the chat input, allowing multiple references) was working correctly before.

After updating to the latest version of the VS Code extension, the behavior changed to the current overwrite behavior.

This suggests a recent update introduced this breaking change unintentionally.

mtskf avatar Jan 15 '26 00:01 mtskf

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18083
  2. https://github.com/anthropics/claude-code/issues/18145
  3. https://github.com/anthropics/claude-code/issues/18126

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Jan 15 '26 00:01 github-actions[bot]

same issue

developergunny avatar Jan 15 '26 13:01 developergunny