| name | file-search |
| description | Modern file and content search using fd, ripgrep (rg), and fzf. Triggers on: fd, ripgrep, rg, find files, search code, fzf, fuzzy find, search codebase. |
| compatibility | Requires fd, ripgrep (rg), and optionally fzf. Install: brew install fd ripgrep fzf (macOS). |
| allowed-tools | Bash |
File Search
Modern file and content search.
fd - Find Files
fd config
fd -e py
fd -t f config
fd -t d src
fd -E node_modules
fd -E "*.min.js"
fd -e py -x wc -l
rg - Search Content
rg "TODO"
rg -i "error"
rg -t py "import"
rg -t js -t ts "async"
rg -C 3 "function"
rg -l "TODO"
rg -c "TODO"
fzf - Interactive Selection
fd | fzf
fd | fzf --preview 'bat --color=always {}'
fd -e ts | fzf -m | xargs code
Combined Patterns
fd -e py -x rg "async def" {}
rg -l "pattern" | fzf --preview 'rg -C 3 "pattern" {}' | xargs vim
Quick Reference
| Task | Command |
|---|
| Find TS files | fd -e ts |
| Find in src | fd -e ts src/ |
| Search pattern | rg "pattern" |
| Search in type | rg -t py "import" |
| Files with match | rg -l "pattern" |
| Count matches | rg -c "pattern" |
| Interactive | fd | fzf |
| With preview | fd | fzf --preview 'bat {}' |
Performance Tips
| Tip | Why |
|---|
Both respect .gitignore | Auto-skip node_modules, dist |
Use -t over -g | Type flags are faster |
| Narrow the path | rg pattern src/ faster |
Use -F for literals | Avoids regex overhead |
Additional Resources
For detailed patterns, load:
./references/advanced-workflows.md - Git integration, shell functions, power workflows