Filters
Each free-text word is a substring of the title, summary, directory, branch, model, agent, excerpt, or the name set with n. Quote a phrase to keep it together: "auth bug". Tokens and free text combine. A leading ~ expands to the home directory.
ai9s search 'agent:claude dir:my-repo date:<7d "auth bug"'
| Token | Meaning |
|---|---|
agent:claude | Agent id, or a substring of it. agent:clau matches while you type. Also a:. An empty agent: is ignored. |
dir:repo | Working directory contains the text. Also cwd: and directory:. dir:~/repo expands ~. |
branch:main | Git branch contains the text. |
model:sonnet | Model name contains the text. |
date:<7d | Updated in the last 7 days. Units: m, h, d, w. |
date:>30d | Updated more than 30 days ago. |
date:2026-03-02 | That calendar day. date:2026-03 is the whole month. |
sort:messages | recent (default), oldest, messages, or title. title follows the NAME column. |
In the UI
/ edits the filter text directly. The list updates as you type. Up and down move through the matches while the field stays focused. ⌘↑ and ⌘↓ move a page of rows. ⌘← and ⌘→ move a page of columns. Plain left and right stay in the field. Esc from describe returns to the list and leaves the filter. Esc after opening sessions from a group returns to that group and clears the filter. On that group, or on the sessions list itself, Esc clears the text and stays there. Esc in the manual or command mode leaves the filter alone. : opens command mode, where the same tokens are listed. Up and down select one, and Enter writes it into the filter. Setting a token replaces the previous value of that token. A value with a space is quoted.
The header shows the token names as a hint: agent: dir: branch: model: date:<7d sort:recent.
Opening ai9s in a project directory lists sessions whose working directory is that directory or a subdirectory. Opening it in your home directory lists every session. A dir: token narrows the list further. Esc clears the token and leaves the starting directory in place. ai9s search still searches the whole index.
Metadata
The preview and ai9s show print a context line and a token line when the session file has them: latest prompt size, context window, input, output, cache read, cache write, reasoning tokens, cost, premium requests, and reasoning effort. The CTX column is the latest context size, or used/window when both are known.
Claude records per-turn usage and cost. Codex records token totals and, when present, the context window. Copilot CLI records the latest prompt size, cache, reasoning effort, and premium requests. OpenCode records session token totals and the latest prompt size. Grok records the latest context and window, token totals, cache, reasoning, cost, and reasoning effort. Hermes records token totals, cost, and the latest prompt size, and does not record a window. Cursor records the latest context and window when composer data has them, and does not record a session token total. Antigravity records the latest context and window and sums per-generation input, output, cache read, and reasoning. OpenClaw records the context window separately from the estimated prompt size. Goose and Cline record token totals, and Cline records cost. Gemini, Junie, Jules, Aider, and Kiro leave the token lines empty. Kiro's database does not store those numbers.