grep
Search code structurally across files or directories, with AST-aware grouping by class/function and filtering of comments and strings. Automatically detects regex patterns.
Instructions
AST-aware structural search across a file or directory. Matches are grouped by enclosing class/function, with kind tags [def]/[import]. Comment/string noise is filtered by default. Regex is auto-detected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Narrow results by classification kind | |
| path | Yes | Absolute path to search | |
| count | No | Show match counts per file (-c) | |
| pattern | Yes | Search pattern (literal or regex, auto-detected) | |
| maxCount | No | Maximum number of matches per file (-m) | |
| filesOnly | No | List matching files only (-l) | |
| wordMatch | No | Match whole words only (-w) | |
| caseInsensitive | No | Case-insensitive matching (-i) |