patternstringrequiredA regular expression.
pathstringWhere to search.
globstringOnly files matching this pattern, e.g. **/*.js.
ignore_casebooleanCase-insensitive.
max_resultsinteger100How many matching lines to return.
What comes back
src/auth.js:42: if (!token) throw new Unauthorized();
src/auth.js:88: // TODO: rotate the token here
src/session.js:14: const token = await exchange(key);Path, line, text — enough for the agent to decide which file to open, without opening any of them.
Narrow with glob, not with a bigger pattern
A pattern that matches a lot in a large tree fills the turn with lines. Restricting the files is cheaper than restricting the output, because the output is what is paid for.
The usual sequence
grep to find where, read { paths } to see the places, edit to change them. Three turns for a change across a project.