VS Code extension @ file search missing most workspace directories
Bug Description
The @ file mention/search feature in the Claude Code VS Code extension fails to show most top-level directories in a large workspace. VS Code's native Cmd+P file search works correctly for the same workspace.
Environment
- Claude Code VS Code extension v2.1.52 (darwin-arm64)
- VS Code on macOS (Darwin 25.2.0)
- System ripgrep 14.1.1
Steps to Reproduce
- Open a workspace with a large file tree (~2.4M files, mostly from
node_modulesand.venv) - Type
@in the Claude Code chat to trigger file search - Search for directories/files — only early-alphabetical directories (e.g.,
apps/) appear - Most top-level directories (
api/,frontend/,infra/,migrations/) are missing from results
Expected Behavior
All workspace directories and files should be discoverable via @ file search, consistent with Cmd+P behavior.
Actual Behavior
Only a subset of directories appear (seemingly alphabetically early ones like apps/). The rest are invisible in the @ file picker.
Diagnostic Details
- Workspace file counts by top-level directory:
infra/: 2,252,179 files (mostlynode_modules)node_modules/: 71,286 filesfrontend/: 59,770 files (includesnode_modules).venv/: 28,077 files.mypy_cache/: 10,397 files- All other source directories: < 500 files each
- System ripgrep works correctly:
rg --files --max-depth 2finds files across all directories as expected (ripgrep respects.gitignoreand correctly skipsnode_modules/.venv)
- VS Code
Cmd+Pworks correctly: All directories are searchable
- Attempted fixes (none resolved the issue):
- Added
files.excludeandsearch.excludefor**/.venv,**/node_modules,**/.mypy_cachein.vscode/settings.json - Set
USE_BUILTIN_RIPGREP=0environment variable - Reloaded VS Code window
- Fully quit and reopened VS Code
Hypothesis
The extension's @ file picker appears to hit a file count limit or timeout during indexing before it finishes scanning the workspace. Since node_modules and .venv are massive but gitignored, the built-in ripgrep should skip them — but it seems like either the built-in ripgrep isn't respecting .gitignore, or there's an internal cap on results that gets exhausted on early-alphabet directories.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗