ripgrep
Installation
SKILL.md
ripgrep
Use rg instead of grep for recursive text search, and rg --files instead of find | grep for path discovery (rg --files | rg '(^|/)Dockerfile$'). Fall back to grep only when rg is missing or exact POSIX behaviour is the requirement. Read a known file directly rather than searching for it. Behaviour below was re-verified on ripgrep 15.2.0 (released 2026-07-15) on 2026-11-10 against the ripgrep CHANGELOG and a local run; if an example disagrees with the installed build, check rg --version and rg --help.
Defaults
-Ffor literals, especially user-supplied strings with punctuation; single-quote patterns and replacements so the shell does not touch$1,!or backslashes.- Narrow early with a path plus
-t typeor-g glob(-Texcludes a type). rg -lto find files before opening them;--count-matchescounts matches,-ccounts matching lines.- For scripts:
-n --color never --no-heading,--json(JSON Lines: begin/match/end/summary),-0or-lfor file lists, and--sort pathonly when determinism matters (it forces single-threaded search). - Exit codes: 0 match, 1 no match, 2 error;
-qwhen only the code matters.
Missing results
rg skips what is ignored (.gitignore, .ignore, .rgignore, precedence in that reverse order), hidden, binary, and symlinked. Choose the override that matches the suspicion instead of a ladder of retries: