command_chains
Reconstruct multi-step shell command sequences by searching for an anchor command and viewing time-ordered commands run within a configurable window around that match.
Instructions
Read-only. For each command matching query, returns the commands run within a time window around it (default ±5 min) — surfacing multi-step sequences like cd → npm run build → deploy. Useful for reconstructing "how did I do X last time?". Returns up to limit chains, each a time-ordered list of command rows. Local index only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of chains (one per anchor match) to return. Default 5. | |
| query | Yes | FTS5 query identifying the anchor command(s). Same syntax as `search_history`. | |
| window_ms | No | Half-width of the time window around each match, in milliseconds. Default 300000 (±5 min). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| chains | No | Each chain is a time-ordered list of command rows around one anchor match. |