VS Code extension @ file search missing most workspace directories

Resolved 💬 3 comments Opened Feb 24, 2026 by evangriffiths Closed Apr 20, 2026

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

  1. Open a workspace with a large file tree (~2.4M files, mostly from node_modules and .venv)
  2. Type @ in the Claude Code chat to trigger file search
  3. Search for directories/files — only early-alphabetical directories (e.g., apps/) appear
  4. 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 (mostly node_modules)
  • node_modules/: 71,286 files
  • frontend/: 59,770 files (includes node_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 2 finds files across all directories as expected (ripgrep respects .gitignore and correctly skips node_modules/.venv)
  • VS Code Cmd+P works correctly: All directories are searchable
  • Attempted fixes (none resolved the issue):
  • Added files.exclude and search.exclude for **/.venv, **/node_modules, **/.mypy_cache in .vscode/settings.json
  • Set USE_BUILTIN_RIPGREP=0 environment 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.

View original on GitHub ↗

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