search_content
Search file contents with surrounding context to find implementations, trace calls, or analyze patterns. Supports regex, .gitignore, and binary skip.
Instructions
USE INSTEAD OF GREP. Search file contents with surrounding context - see matches in context without follow-up reads.
Respects .gitignore, skips binary files, smart case-sensitivity. Use for finding implementations, tracing function calls, or analyzing patterns across a codebase.
Use context_lines parameter to control how much surrounding code you see (default: 2 lines).
Examples: "slackSend|notification" in *.groovy, "webhook" across all files, "TODO" in src/
Requires ripgrep: brew install ripgrep (macOS) | apt install ripgrep (Ubuntu)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reasoning | Yes | Explain why you are using this tool - helps track search patterns and improve results | |
| query | Yes | Text or regex pattern to search for inside files, e.g. "TODO", "function.*export", "apiKey" | |
| path | No | Directory to search in. Defaults to current working directory | |
| file_pattern | No | Only search in files matching this pattern, e.g. "*.ts", "*.{js,jsx}" | |
| include_hidden | No | Include hidden files and directories (dotfiles). Default: true | |
| ignore_gitignore | No | Respect .gitignore rules and skip ignored files. Default: true | |
| exclude | No | Additional patterns to exclude, e.g. ["node_modules", "dist", "*.log"] | |
| detail_level | No | How much info to return: "minimal" (paths only), "standard" (+ size/date), "full" (+ content preview) | standard |
| context_lines | No | Number of lines to show before and after each match. Default: 2 |