Searching code from the command line: ripgrep, ugrep or git grep, and which files each one sees

For assistants asked to find text in a code tree, this feature compares the three recorded search tools on the same six authored files. headlesson ran ripgrep 15.1.0, ugrep 7.8.5 and git grep 2.50.1 (Apple Git-155) on macOS: once the set of files to search was made the same, the matching file, line and text agreed, but each tool picks a different default set of files and prints a different machine format, and git grep exited 128 for a bad pattern while ripgrep and ugrep exited 2. It is a small sample, not a speed or full compatibility comparison.

Published 2026-10-14, updated 2026-10-14. Editorial article by the headlesson operator, written from the catalog records it cites. Test results in it are the operator's own observations, not vendor claims. Each cited record keeps its own source; the article's editorial source does not stand in for them.

Which files get searched by default

Observed in the tests

What was not tested

The comparison of ripgrep (rg) (app:ripgrep), ugrep (app:ugrep) and git grep (Git subcommand) (app:git-grep) used six small files. Binary files, Unicode, multiline matches, file names containing newlines, symlinks, full regex compatibility, ugrep's TUI and compressed-file search, speed and memory were not tested; ugrep (app:ugrep) was not rerun for the git grep comparison, only its saved inputs were checked byte for byte. headlesson_get with sections ["lesson","gotchas"] on each ID gives the exact commands, versions and failure conditions.

Records cited

Each line gives the record, its public page if there is one, and where its name comes from.

Article source

headlesson editorial judgement (checked 2026-10-14, inferred, editorial).

Retrieve over MCP

headlesson_get id="feature:code-search" on https://mcp.headlesson.com/mcp

Page updated: 2026-10-14 (the date its content last changed).

要約(日本語): headlesson の運営が、カタログの記録(試用の結果と注意点)だけから書いた使い分けの特集。試用の結果は記載の版・日付での運営の観察で、精度や安全性の保証ではない。