[BUG] Option+K (Alt+K) overwrites context instead of adding multiple references in VS Code extension
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+Kinserted an@file:linereference directly into the chat input field as text - Multiple uses of
Option+Kwould add multiple@references to the input - Users could easily add context from multiple files
Current Behavior
-
Option+Kadds context to a panel below the chat input field - Using
Option+Kagain replaces the previous context instead of adding to it - Users cannot add multiple file/selection contexts using this shortcut
Steps to Reproduce
- Open VS Code with Claude Code extension
- Open File A, select some code, press
Option+K - Context from File A appears in the context panel
- Open File B, select some code, press
Option+K - Expected: Both File A and File B contexts are shown
- 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 @file2in 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)
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.
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/18083
- https://github.com/anthropics/claude-code/issues/18145
- 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
same issue