Cursor's ripgrep commands are insanely slow - can I exclude directories?

Cursor gives LLMs access to ripgrep to search through directories. They call it like:

/tmp/.mount_cursorXBEwPl/usr/share/cursor/resources/app/node_modules/@vscode/ripgrep/bin/rg --hidden --no-require-git --ignore-case -g !/.git -g !/.svn -g !/.hg -g !/CVS -g !/.DS_Store -g !/Thumbs.db -g !/node_modules -g !/bower_components -g !**/*.code-search --no-ignore-parent --follow --crlf --engine auto --regexp Box prediction debug --no-config --no-ignore-global --json – .

(I spotted this via ps -ef).

These commands always time out after 2500ms. I’ve done everything I can do to remove bulky / numerous files from my codebase, but even if there’s a mere symlink so my code can find the files it needs, ripgrep follows it, tries grepping through way too much content, and times out, leaving the models without the info they tried to find.

How can I fix this? How can I keep ripgrep out of certain directories?

1 Like

Does adding search exclusions in your .vscode/settings.json file fix this?

e.g.

  "search.exclude": {
    "**/.wireit": true,
    "**/.pnpm/**": true,
    "**/.turbo/**": true,
    "**/.nx/**": true,
...
}

or whatever excludions prevnt it from looking at the directories you want to avoid?

I just installed version 0.46.9 and the problem is gone for me.
:star_struck: