Search tools
Parent: Tools and workspace.
grep searches file contents with a regex. glob lists files whose paths match a pattern. Both run in-process and do not need rg, fd, or RTK. Prefer these tools over shell search for workspace inspection. grep content mode mints chainable [path#TAG] snapshots and match line numbers for the default edit format. Match text is search preview only.
- Patterns:
greptakes a Rust/regexpattern.globtakes a path glob; a pattern with no/(for example*.rs) matches nested paths as**/*.rs. - Defaults: both honor
.gitignore, skip hidden files, and never follow symlinks. Passinclude_hiddenwhen you need dotfiles. - Order: results come back in walk order, sorted by name within each directory, so repeat runs agree and a capped result is the first N paths shown rather than an arbitrary sample.
- Caps: results are bounded (default 200).
grepalso caps matches per file and trims long lines. Every capped, timed-out, or cancelled search says so in its summary, including when it found nothing. - Output:
grepgroups matches by file. Content mode prefixes each file with a chainable[path#TAG]header andN | textmatch previews. With the defaultedittool, copy the tag and line numbers intoPUTandCUToperations. Do not copy preview bodies because they may be truncated. Useread_filewhen you need exact line text. Setoutput_modetofiles_with_matchesorcountwhen you only need paths or tallies; default iscontent. - Permissions: both request read access only, so they work in every permission mode, including
plan.