search
Semantically retrieve Claude Code session events by describing them in natural language. Apply filters for event type, session, project, tool, or file path.
Instructions
Semantic search across all stored Claude Code session events. Returns events matching a natural language query, with optional filters by event type, session, project, tool, or file path. IMPORTANT: Always pass session_id when you know which session to search — unscoped search returns noisy results. For finding a discussion WITH surrounding conversation context, use search_in_context instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max results (default 10) | |
| query | Yes | Natural language query | |
| max_chars | No | Max total output characters (default 12000). Set higher if you need full content. | |
| tool_name | No | Filter by tool name (Edit, Bash, Read, etc.) | |
| event_type | No | Filter: user_message, assistant_text, assistant_thinking, tool_call, tool_result | |
| project_id | No | Scope search to a project by project_id | |
| session_id | No | Scope search to a single session (prefix match) | |
| project_name | No | Scope search to a project by name substring (e.g. 'gonzo') | |
| file_path_contains | No | Filter to events with an explicit file_path containing this string (tool_call/tool_result events only — user messages won't have file_path metadata) |