grep
Search cached files for exact strings or regex patterns. Returns line-numbered matches quickly without disk access—seed files first via read tools.
Instructions
Search cached file contents for an exact string or regex.
Fast, exact, line-numbered matching over files already in the cache — it
does NOT touch disk, so seed files first with batch_read/read (empty
results usually mean the files aren't cached). For concept-level questions
where you don't know the exact term, use search instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Optional filter — an exact path, a path suffix, or a glob. | |
| pattern | Yes | A regular expression, or a literal string when `fixed_string=true`. | |
| max_files | No | Cap on the number of files returned. | |
| max_matches | No | Cap on total matches returned across all files. | |
| fixed_string | No | Match `pattern` literally instead of as a regex. | |
| context_lines | No | Lines of surrounding context to include per match. | |
| case_sensitive | No | Match case-sensitively. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | ||
| files | No | ||
| pattern | No | ||
| truncated | No | ||
| fixed_string | No | ||
| context_lines | No | ||
| files_matched | No | ||
| total_matches | No | ||
| case_sensitive | No | ||
| truncated_files | No | ||
| truncated_matches | No |