[FEATURE] VSCode extension auto-includes opened files as context — should be opt-in by default

Open 💬 7 comments Opened Mar 30, 2026 by yanglihui

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The VSCode extension automatically includes every file I open or switch to as conversation context for Claude. As a developer, I constantly open, browse, and switch between 20+ files for various reasons — reviewing code, checking references, reading logs, comparing implementations. The vast majority of these have nothing to do with my current Claude conversation.

This auto-inclusion pollutes the conversation context with irrelevant files, which misleads Claude's responses and wastes context window tokens. The current workaround is clicking the eye icon to hide each unwanted file, but this resets per message — making it impractical.

The fundamental issue: VSCode's primary purpose is editing and managing files. Claude is a plugin, not the host. A plugin should not assume all host-level file operations are intended as input for itself.

Proposed Solution

  • Default behavior: do NOT auto-include opened files. The conversation context should start clean.
  • Users explicitly add files via @-mention or drag-and-drop when they want Claude to see them.
  • Provide a setting claudeCode.autoIncludeOpenedFiles (default: false) for users who prefer the current auto-inclusion behavior.

This is an opt-in vs opt-out design change. For a feature that introduces noise in most workflows, the correct default is opt-in — let users choose what's relevant, rather than forcing them to constantly clean up what's not.

Alternative Solutions

Currently I manually click the eye icon to hide irrelevant files before each message. This is tedious and resets every message, so it doesn't scale.

Other AI coding tools (Cursor, GitHub Copilot Chat) handle this by letting users explicitly add files to context rather than auto-including everything that's open.

Related issues: #23968, #24726

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

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