count
Tally matching lines or total occurrences of a pattern in files, optionally per file, without returning match content to save tokens.
Instructions
Count matching lines or total occurrences of a pattern in files without retrieving match content, saving tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Directory or file to count matches in (default: '.') | . |
| type | No | Engine mode: 'regex' (default), 'text', 'ast' | regex |
| query | Yes | Search pattern to count | |
| perFile | No | If true, shows breakdown of matches per file | |
| fileType | No | File type filter | |
| language | No | Language for AST mode | |
| noIgnore | No | Whether to count inside gitignored files | |
| countLines | No | Count matching lines (true) or total occurrences (false) | |
| filePattern | No | Glob pattern to filter files | |
| excludePattern | No | Glob pattern to exclude |