CRITICAL: Use ripgrep, not grep
NEVER use grep for project-wide searches (slow, ignores .gitignore). ALWAYS use rg.
rg "pattern"— search contentrg --files | rg "name"— find filesrg -t python "def"— language filters
File finding
- Prefer
fd(orfdfindon Debian/Ubuntu). Respects .gitignore.
JSON
- Use
jqfor parsing and transformations.
Install Guidance
- macOS:
brew install ripgrep fd jq - Debian/Ubuntu:
sudo apt update && sudo apt install -y ripgrep fd-find jq(aliasfd=fdfind)
Agent Instructions
- Replace commands: grep→rg, find→rg –files/fd, ls -R→rg –files, cat|grep→rg pattern file
- Cap reads at 250 lines; prefer
rg -n -A 3 -B 3for context - Use
jqfor JSON instead of regex