search
Find code with regex, text, AST patterns, or symbols across a codebase, using filters, context, and pagination.
Instructions
High-performance unified code search engine combining ripgrep (regex/text) and ast-grep (AST patterns and YAML rules). Supports pagination with searchId and offset/limit for large results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Directory or file to search in (default: current directory '.') | . |
| type | No | Search engine/type: 'regex' (default), 'text', 'ast', 'ast_rule', 'hybrid', 'symbol' | regex |
| limit | No | Maximum matches to return for this chunk (default: 50) | |
| query | No | Search query: plain text, regex, AST pattern, or YAML rule | |
| offset | No | Starting index for pagination (1-based, default: 1) | |
| context | No | Number of context lines before and after match (-C) | |
| fileType | No | Ripgrep file type filter, e.g. 'ts', 'py', 'rust', 'json' | |
| language | No | Target language (e.g. 'typescript', 'python'). If omitted, auto-detected from file extension | |
| noIgnore | No | If true, do NOT respect .gitignore (search ignored files). Default is false (respects .gitignore) | |
| searchId | No | Previous search result ID to view remaining results instantly without re-scanning | |
| multiline | No | Match regex across multiple lines (-U) | |
| wordMatch | No | Match whole words only (-w) | |
| filePattern | No | Glob pattern to filter files, e.g. '*.{ts,tsx}' or '!**/*.test.ts' | |
| outputFormat | No | Output format: 'content' (default), 'compact' (file:line only), 'files_only', 'json' | content |
| caseSensitive | No | Match case sensitively. If omitted, smart-case is used | |
| includeHidden | No | Search hidden files and folders (-.) | |
| maxLineLength | No | Max characters per line before truncating long lines (default: 500) | |
| excludePattern | No | Pattern to exclude, e.g. '**/dist/**', '**/*.spec.ts' |