Search file contents for text or patterns. Use this instead of shell grep.
<when_to_use> Use Grep when:
- Searching for text/patterns across files
- Finding where a function or variable is used
- Locating error messages, log strings, or comments
Do NOT use Grep when:
- Finding files by name → use
glob - Semantic symbol lookup → use
lsp_references(more accurate) - Need to understand code flow → use
agent - Reading a known file → use
view</when_to_use>
<pattern_tips>
- Simple text:
"handleLogin"finds literal matches - Regex:
"log\..*Error"finds log.SomethingError - Use
literal_text=truefor text with special chars:"user.name"with literal_text finds "user.name" exactly </pattern_tips>
Good: pattern: "TODO", path: "src/" → Find TODOs in src directory
Bad: pattern: "*.go" → This searches content, not filenames. Use glob for filenames.