Ripgrep

Fast, recursive text search tool written in Rust. Drop-in replacement for grep with smarter defaults.

ripgrep (rg) is the standard text search tool across all of Kevin's projects. The root agent instructions and Cursor rules both require rg / rg --files for repo search because it is fast, recursive by default, and respects ignore files unless told otherwise. Source: AGENTS.md; config/cursor/rules/ripgrep.mdc; BurntSushi/ripgrep README

Why ripgrep over grep

Dimension grep rg
Speed Single-threaded Parallel by default
Recursion Requires -r flag Recursive by default
.gitignore Ignored Respected by default
Binary files Searched unless excluded Skipped by default
Hidden/dot files Searched Skipped by default
Output Plain Colored, grouped, line-numbered
Unicode Partial Full UTF-8 support
Regex engine POSIX/PCRE Rust regex crate (fast, safe)

When grep still makes sense

  • Portability - POSIX shell scripts that run on minimal environments (Alpine Docker, embedded, CI containers without custom tooling).
  • Simple stdin pipes - for trivial echo x | grep y one-liners the performance difference is negligible, but rg works here too.

Key flags

rg "pattern"                    # Recursive search
rg "pattern" -t py              # Filter by file type
rg "pattern" -g "*.tsx"         # Filter by glob
rg "pattern" -i                 # Case insensitive
rg "pattern" -l                 # Files with matches only
rg "pattern" -c                 # Count matches per file
rg "pattern" -A 3 -B 3         # Context lines
rg "pattern" --json             # Machine-readable JSON output
rg -U "multi\nline"             # Multiline matching
rg "pattern" --no-ignore        # Include gitignored files
rg "pattern" --hidden           # Include hidden/dot files
rg "pattern" -w                 # Whole word matching
rg "pattern" --type-add 'web:*.{html,css,js}' -t web  # Custom type

Agent integration

Installation

brew install ripgrep     # macOS
cargo install ripgrep    # from source

Timeline