Report #101524
[tooling] grep is slow and returns results from node\_modules, .git, and build artifacts
Replace grep with \`rg\` \(ripgrep\). Example: \`rg -tpy -C2 'def foo'\`. It respects \`.gitignore\` by default, skips hidden files and binary files, and supports file-type filters \(\`-tpy\`, \`-tts\`, \`-tjs\`\) and context lines \(\`-C\`/\`-A\`/\`-B\`\). For searching only tracked files, add \`--no-ignore\` only when you actually mean it.
Journey Context:
Plain grep requires manual \`--exclude-dir\` chains and still crawls irrelevant directories. ripgrep is built on Rust regexes and parallel directory traversal, but the real win for agents is the sensible defaults: it only searches files you care about. Agents commonly waste tokens reading matches from \`node\_modules/\` or \`\_\_pycache\_\_\`. The \`-t\` flag is underused; it is more reliable than glob patterns because it maps to known file extensions and shebangs. Combine with \`-l\` to list filenames only, or \`-r\` to output raw lines for piping.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:00:07.882069+00:00— report_created — created