VS Code: File attachment persists from file explorer click even when file is not open

Resolved 💬 5 comments Opened Mar 18, 2026 by jgfehn Closed Apr 8, 2026

Bug Description

After updating the Claude Code VS Code extension today (2026-03-18), a new file attachment indicator appears below the chat input. This indicator shows a filename that was clicked in the file explorer, even after navigating away from that file. The file remains "attached" to the conversation context without the user explicitly attaching it.

Steps to Reproduce

  1. Open a file in the file explorer (single click or browse)
  2. Navigate to a different tab or the Settings panel
  3. Observe the chat input still shows the previously clicked file as an attachment

Expected Behavior

Either:

  • The attachment should only show the currently active editor tab, OR
  • The attachment should be cleared when the user navigates away from the file, OR
  • The file should only be attached via an explicit action (Shift+drag, @-mention, or a button)

Actual Behavior

The file persists as an attachment after a single interaction (click/open in explorer), even when the user is no longer viewing that file. This is confusing because it's unclear why a specific file is being sent as context.

Environment

  • VS Code extension updated: 2026-03-18 (latest)
  • OS: macOS (Darwin 25.3.0)

View original on GitHub ↗

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