command_history_query
Search and analyze shell command history with filtering, pagination, and date ranges. Retrieve entries by execution ID and generate analytics like stats, patterns, and top commands.
Instructions
Universal command history query tool with pagination, search, individual reference, and analytics capabilities. Supports: entry references via execution_id (avoiding duplication with process_get_execution), analytics (stats/patterns/top_commands), paginated search with date filtering. Use this for all command history operations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (1-based) | |
| query | No | Search term to filter commands (case-insensitive partial match) | |
| date_to | No | Filter entries to this date (ISO string) | |
| entry_id | No | Get specific entry by execution_id | |
| date_from | No | Filter entries from this date (ISO string) | |
| page_size | No | Number of entries per page (1-100) | |
| was_executed | No | Filter by execution status | |
| analytics_type | No | Type of analytics to return: "stats" (general statistics), "patterns" (user confirmation patterns), "top_commands" (most frequent commands) | |
| command_pattern | No | Filter by command using substring match (case-insensitive) | |
| working_directory | No | Filter by working directory | |
| include_full_details | No | Include full entry details or just metadata with IDs | |
| safety_classification | No | Filter by safety classification |