ripgrep (rg): fast text search for agents
Note, . Status: reviewed. Tags: ai, agents, research. Authorship: synthesis by iinventedlight from the cited sources; text drafted with AI assistance (Grok Bot), reviewed by Cole Withington on 2026-11-02.
ripgrep (rg): fast text search for agents
Summary
rg PATTERN [PATH] searches files recursively, skipping files ignored by .gitignore. Use -n for line numbers, -l for file names only, -c for counts and --json for machine-readable output. Exit code 1 means no match, not an error.
Draft. License: CC0 1.0. Sources: [S1] ripgrep project (BurntSushi), "ripgrep user guide"; [S2] Grok Bot box, "Grok Bot box run: rg --version".
Agent access
- CLI: yes (
rg, tested ripgrep 14.1.1). MCP connector: none needed. API: none. - Best route: CLI.
- Permissions: read-only filesystem access.
Facts
- id: F1 claim: ripgrep searches directories recursively and respects .gitignore and hidden-file rules by default. confidence: medium date: 2026-11-02 sources: [S1] license: CC0 1.0 checked_on: 2026-11-02
- id: F2 claim:
-nshows line numbers,-cshows match counts per file,-llists matching files only; tested on ripgrep 14.1.1. confidence: high date: 2026-11-02 sources: [S1, S2] license: CC0 1.0 checked_on: 2026-11-02 - id: F3 claim:
--jsonemits one JSON object per event (begin, match, end, summary), which an agent can parse reliably. confidence: high date: 2026-11-02 sources: [S1, S2] license: CC0 1.0 checked_on: 2026-11-02 - id: F4 claim: rg exits 0 when it finds a match, 1 when it finds none, and 2 on an error; treat 1 as a normal result in scripts. confidence: high date: 2026-11-02 sources: [S1, S2] license: CC0 1.0 checked_on: 2026-11-02
- id: F5 claim: Use
-uuor--no-ignore --hiddento include ignored and hidden files when a search seems to miss things. confidence: medium date: 2026-11-02 sources: [S1] license: CC0 1.0 checked_on: 2026-11-02
Cite this
iinventedlight. 2026. "ripgrep (rg): fast text search for agents." iinventedlight Library, iil:note:d5zcka9b, version of 2026-11-02. https://iinventedlight.com/library/notes/cli-ripgrep-search/. License: CC0-1.0.
@misc{iil_note_d5zcka9b,
author = {{iinventedlight}},
title = {{ripgrep (rg): fast text search for agents}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-02},
url = {https://iinventedlight.com/library/notes/cli-ripgrep-search/},
note = {Permanent ID iil:note:d5zcka9b. License: CC0-1.0.},
}
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/cli-ripgrep-search.md.