[BUG] @ file mention fails to find .py files in VSCode/Cursor extension when system rg binary is not installed
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
In the Claude Code VSCode/Cursor extension, typing @ to mention files does not return any .py files in the autocomplete dropdown. Other file types (e.g. .html) appear normally. The issue affects all projects.
The same @ file mention works correctly when running claude in the terminal.
What Should Happen?
All file types including .py should appear in the @ file autocomplete dropdown, consistent with the terminal behavior.
Error Messages/Logs
The following warning appears internally (visible if extension logging is enabled):
Ripgrep search failed, falling back to VSCode findFiles: [Error: spawn rg ENOENT]
Root cause traced through extension.js:
// __dirname is hardcoded to the CI build path at compile time:
var __dirname = "/home/runner/work/claude-cli-internal/.../packages/claude-vscode/src/extension"
// Built-in rg path resolves to a non-existent path on user machines:
// → /home/runner/work/claude-cli-internal/vendor/ripgrep/arm64-darwin/rg
Because both the system rg (only a shell alias set by Claude Code's own shell integration, invisible to Node.js child processes) and the built-in ripgrep path (hardcoded CI path) fail, the extension falls back to VSCode findFiles API with a 100-result limit. Projects with a .venv/ virtual environment contain 10,000+
.py files that exhaust this limit, pushing out all project Python files.
Steps to Reproduce
- Use Claude Code extension in VSCode or Cursor
- Do not have ripgrep installed system-wide (only Claude Code's CLI installed)
- Open any Python project that has a .venv/ or venv/ virtual environment
- In the Claude Code chat input, type @ followed by any .py filename (e.g. @main)
- Observe: no .py files appear in the dropdown
Workaround: brew install ripgrep (macOS) installs a real rg binary that the extension's Node.js process can find, bypassing the broken fallback.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
N/A — worked after installing system ripgrep (brew install ripgrep).
Claude Code Version
2.1.63 (Cursor extension: anthropic.claude-code-2.1.63-darwin-arm64)
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Suggested Fix
Resolve the built-in ripgrep path using the actual runtime extension directory instead of the hardcoded compile-time __dirname:
// Replace hardcoded __dirname with runtime extension path
const rgPath = path.resolve(context.extensionPath, "vendor", "ripgrep",
${process.arch}-${process.platform}, "rg");
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗