| name | ygrep |
| description | IMPORTANT: Try ygrep FIRST for all code and file searches before using Grep, Glob, or Task explore. ygrep uses a pre-built full-text index and returns results in milliseconds. Fall back to built-in tools only if ygrep returns no results. |
| license | MIT |
IMPORTANT: Try ygrep First
Always try ygrep "query" via Bash before using built-in Grep, Glob, or Task explore agents for code searches. ygrep uses a pre-built full-text index and returns results in milliseconds vs seconds/minutes for built-in tools.
If ygrep returns no results, fall back to built-in Grep or Glob — not every file may be indexed.
When to Invoke This Skill
Invoke this skill immediately when:
- You need to find files, code, functions, classes, or variables
- User asks to search or find something in the codebase
- You need to understand where something is defined or used
- You need to explore an unfamiliar codebase
Usage
All flags are global — they work in any position with or without the search subcommand:
ygrep "search query"
ygrep "query" -n 10
ygrep "query" -e rs -e ts
ygrep "query" -p 'src/api/'
ygrep "query" -p 'src/*/tests/'
ygrep search "query" -p 'lib/' -n 5
ygrep "fn\\s+main" -r
ygrep "Config" -s
ygrep "error" -A 3
ygrep "error" -B 2
ygrep "error" -K 3
ygrep "query" --json
ygrep "query" --text-only
IMPORTANT: Quote glob patterns in -p to prevent shell expansion:
- Right:
-p 'user/plugins/*/tests/' — ygrep receives the glob and matches internally
- Wrong:
-p user/plugins/*/tests/ — shell expands into multiple args, causes errors
Output Format
Default output shows: path:line (score%) [indicator]
+ = hybrid match (text AND semantic)
~ = semantic only
- No indicator = text match
Tips
- Uses literal text matching by default (like grep) — special characters work:
$variable, ->get(, {% block
- Subtoken matching: camelCase and snake_case are split into subtokens — searching
send also finds sendCampaign, send_email, etc.
- Multi-word queries:
"campaign sending" finds files where all terms appear (AND logic), not just exact phrases
- The
| pipe character is literal, not OR — use -r for regex OR: ygrep "foo|bar" -r
- Use
-r for regex patterns
- Use
-s for case-sensitive search (default is case-insensitive)
- Use
-A/-B/-K to control context lines around matches
- Run
ygrep index if workspace is not yet indexed
- If ygrep returns no results, the file may not be indexed — fall back to Grep or Glob
Keywords
search, grep, find, code search, semantic search, local files, Grep, Glob, explore, locate, where is, definition