search_codebase
Search your indexed codebase to find relevant code patterns, usage examples, and architectural context. Supports intents for edit, refactor, or migrate with preflight readiness checks.
Instructions
Routes to the active/current project automatically when known. Search the indexed codebase. Default compact mode returns at most 6 ranked results with light graph context (importedByCount, topExports, layer), a patternSummary, bestExample, nextHops, and response-budget metadata. Use mode="full" for today's richer response with full hints arrays and all memories — identical shape as before this parameter existed. IMPORTANT: Pass the intent="edit"|"refactor"|"migrate" to get preflight: edit readiness check with evidence gating.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language search query | |
| mode | No | Response mode. compact (default): max 6 results with light graph context, pattern summary, best example, next hops, and budget metadata. full: today's richer shape + budget metadata. | compact |
| intent | No | Optional. Use "edit", "refactor", or "migrate" to get the full preflight card before making changes. | |
| limit | No | Maximum number of results to return (default: 5) | |
| includeSnippets | No | Include code snippets in results (default: false). If you need code, prefer read_file instead. | |
| filters | No | Optional filters | |
| project | No | Optional project selector for this call. Accepts a project root path, file path, file:// URI, or a relative subproject path under a configured root. | |
| project_directory | No | Deprecated compatibility alias for older clients. Prefer project. |