[FEATURE] Prioritize open/editor files in @ file reference autocomplete suggestions
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
When using the @ symbol to reference files in the Claude extension for VS Code, the autocomplete dropdown lists all
files in the workspace sorted by a generic order (e.g., alphabetical or path-based). It does not prioritize files that
are currently open in the editor.
This becomes a significant usability issue in projects that contain files with the same name across different
directories (e.g., src/utils/index.ts, src/components/index.ts, src/services/index.ts). In such cases, the user must
visually scan through a long list of identically named entries and inspect their full paths to select the intended
file, even though the target file is already open and visible in the editor.
This behavior breaks the expected workflow: when a file is already open, it is the most likely candidate for
reference, yet the autocomplete provides no indication of its open status or elevated relevance.
Proposed Solution
Reorder the autocomplete suggestions so that files currently open in the editor appear at the top of the list, above
all other workspace files. Specifically:
- Pin open files to the top — Files with open tabs in the editor should be displayed first in the @ autocomplete
dropdown, clearly distinguished from the rest.
- Visual indicator — Optionally append an icon or label (e.g., a tab icon or "Open" badge) to indicate that a
suggested file is currently open, making it easy to identify even among similarly named files.
- Preserve relative order among open files — Within the open-files group, maintain MRU (Most Recently Used) order, so
the most recently active file appears first.
This aligns with VS Code's native behavior in its own file pickers (e.g., Ctrl+P quick open), which already surfaces
open files before other results.
Alternative Solutions
• Filter-only approach — Add a dedicated modifier (e.g., @open: or @tab:) that restricts suggestions to only open
files. This gives users explicit control but adds cognitive overhead and discoverability concerns compared to
reordering.
• Fuzzy relevance scoring — Apply a relevance-based ranking that considers open status as one signal among others
(e.g., recency, frequency, proximity to the current file). This is more sophisticated but may produce less predictable
results than a clear open-files-first grouping.
• Path disambiguation UI — When multiple files share the same name, show a disambiguation sub-menu with full relative
paths. This addresses the symptom (same-name confusion) but not the root cause (open files should be easier to reach).
Priority
Medium - Would be very helpful
Feature Category
File operations
Use Case Example
_No response_
Additional Context
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗