Tools · Files and code
grep_files
Read-onlySearch file contents in the local project using ripgrep when available.
When to use: Use this to find symbols, error strings, config keys, query fragments, and code references across the project.
Example
Run for real by scripts/tool-examples.py in a small demo project, with Haiku 5.5 where the tool calls a model. The output is exactly what the tool returned.
The call
{
"tool": "grep_files",
"arguments": {
"pattern": "def ",
"glob": "*.py"
}
}Real output
tests/test_pricing.py:4:def test_team(): src/pricing.py:6:def price(plan: str, seats: int) -> float:
Parameters
| Name | Type | Description |
|---|---|---|
| pattern* | string | Regex or plain-text pattern to search for |
| path | string | Optional relative directory to search from |
| glob | string | Optional glob filter such as *.py |
| limit | number | Maximum number of matching lines to return |
| case_sensitive | boolean | Whether the search should be case-sensitive |
* required
More in Files and code
Read, search and edit the project; run commands, code and git.