Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

ripgrep

$ rg Community Low Risk
BurntSushi (OSS) · Files & Search · MIT / Unlicense · macos / linux / windows

ripgrep (rg) is the gold-standard local code search tentacle used inside virtually every coding agent harness. Zero side effects, millisecond Rust startup, .gitignore filtering, and structured --json match output.

FCRS-1.0 Score
98 /100
Excellent
High Confidence
Zero-Friction Install
brew install ripgrep
CLI vs MCP Decision CLI Preferred vs MCP

Local rg searches thousands of files in milliseconds with zero RPC round-trips; there is rarely any reason to wrap local grep in an MCP server.

Agent-Readiness Checklist

Local Probe Evidence
✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md
Version
ripgrep 14.1.1
Startup
16 ms
Exit Codes (help / invalid)
0 / 2
NO_COLOR Clean / Non-TTY Safe
Yes / Safe
Captured --help excerpt
ripgrep 14.1.1
Andrew Gallant <[email protected]>

ripgrep (rg) recursively searches the current directory for lines matching
a regex pattern. By default, ripgrep will respect gitignore rules and
automatically skip hidden files/directories and binary files.

Use -h for short descriptions and --help for more details.

Project home page: https://github.com/BurntSushi/ripgrep

USAGE:
    rg [OPTIONS] PATTERN [PATH ...]
    rg [OPTIONS] -e PATTERN ... [PATH ...]
    rg [OPTIONS] -f PATTERNFILE ... [PATH ...]
    rg [OPTIONS] --files [PATH ...]
    rg [OPTIONS] --type-list
    command | rg [OPTIONS] PATTERN
    rg [OPTIONS] --help
    rg [OPTIONS] --version

POSITIONAL ARGUMENTS:
    <PATTERN>
        A regular expression used for searching. To match a pattern beginning
        with a dash, use the -e/--regexp flag.

        For example, to search for the literal '-foo', you can use this flag:

            rg -e -foo

        You can also use the special '--' delimiter to indicate that no more
        flags will be provided. Namely, the following is equivalent to the
        above:

            rg -- -foo

    <PATH>...
        A file or directory to search. Directories are searched recursively.
        File paths specified on the command line override glob and ignore
        rules.

INPUT OPTIONS:
    -e PATTERN, --regexp=PATTERN
        A pattern to search for. This option can be provided multiple times,
        where all patterns given are searched, in addition to any patterns
        provided by -f/--file. Lines matching at least one of the provided
        patterns are printed. This flag can also be used when searching for
        patterns that start with a dash.

        For example, to search for the literal -foo:

            rg -e -foo

        You can also use the special -- delimiter to indicate that no more
        flags will be provided. Namely, the following is equivalent to the
        above:

            rg -- -foo

        When -f/--file or -e/--regexp is used, then ripgrep treats all
        positional arguments as files or directories to search.

    -f PATTERNFILE, --file=PATTERNFILE
        Search for patterns from the given file, with one pattern per line.
        When this flag is used multiple times or in combination with the
        -e/--regexp flag, then all patterns provided are searched. Empty
        pattern lines will match all input lines, and the newline is not
        counted as part of the pattern.

        A line is printed if

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 24 / 25

Supports --json NDJSON output, --color never / NO_COLOR, non-TTY auto-plain formatting, and clean exit codes (0 match, 1 no match, 2 error).

  • Native --json NDJSON format and non-TTY plain stdout detection
  • Distinguishes no-match (exit 1) from syntax/IO errors (exit 2)
Trust & Safety 25 / 25

Strictly read-only with zero network calls, zero credential requirements, and automatic skipping of .gitignore / binary files.

  • Pure local read-only binary; no write or network side effects
Setup & Portability 15 / 15

Zero-dependency Rust binary packaged everywhere (brew, apt, cargo, winget, and bundled inside major coding agents).

  • Single static binary across macOS, Linux, and Windows
Utility & Efficiency 15 / 15

Unbeatable speed and token efficiency via -l, --max-count, and glob filters.

  • Industry-standard codebase search tool for AI coding agents
Maintenance & Lineage 10 / 10

Battle-tested OSS cornerstone (BurntSushi/ripgrep) with spotless reliability.

  • Widely adopted OSS project under MIT/Unlicense
Docs & Verifiability 9 / 10

Comprehensive --help, man page, and GUIDE.md.

  • Detailed GUIDE.md and man page

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates purely on local readable files.

Side Effects
Read-Only
Cost & Quotas

100% free, offline, and open-source (MIT / Unlicense).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# ripgrep (rg) Agent Rules
- Prefer `rg -l` first when scoping broad searches, then read targeted line ranges.
- Use `--json` or `--vimgrep` when parsing structured positions programmatically.
- Pass `--max-count` or `head` bounds on huge monorepos to avoid context bloat.

Agent-Ready Command Recipes

Safe Read-Only Queries

Emit structured NDJSON match events
rg --json "export function" src/

Outputs line-delimited JSON objects with exact file path, line number, and submatches.

List matching files only (minimal tokens)
rg -l "TODO" src/

Returns only file paths so the agent avoids flooding context with match lines.

Strengths for Agents

  • + Zero-risk, purely read-only local tentacle with millisecond startup.
  • + Automatically disables ANSI colors when piped and provides --json NDJSON.
  • + Respects .gitignore out of the box, keeping node_modules and secrets out of agent context.

Caveats & Pitfalls

  • ! Returns exit code 1 when zero matches are found (normal grep convention—agents should not treat exit 1 as a crash).

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI