Fast content search tool that works with any codebase size.
Searches file contents using regular expressions.
Supports full regex syntax and filters files by pattern with the include parameter.
grep_search(
runtime: ToolRuntime[None, AnthropicToolsState],
pattern: str,
path: str = '/',
include: str | None = None,
output_mode: Literal['files_with_matches', 'content', 'count'] = 'files_with_matches'
) -> str| Name | Type | Description |
|---|---|---|
pattern* | str | The regular expression pattern to search for in file contents. |
path | str | Default: '/'The directory to search in. If not specified, searches from root. |
include | str | None | Default: NoneFile pattern to filter (e.g., |
output_mode | Literal['files_with_matches', 'content', 'count'] | Default: 'files_with_matches'Output format. Options:
|