# Sessions A list of your saved coding-agent sessions (Claude Code, Codex and Kiro), newest first. It covers this computer and every connected machine, and you can narrow it to the shown space's repository, its machine, or everything. Type to search titles, folders and every prompt you typed. Click a session to resume it in a new tab, in the folder it worked in on its machine; shift-click forks it. Hover a row for a trash button that deletes the session, after asking. It's in the side panel next to Files and Changes, and `cmd-shift-s` opens it as a popup. ![Sessions](preview.png) ## What you see - **The Sessions button**, at the right end of the tab bar after Changes (and after Diff, if that mod is installed). It's a 26px pill with a clock-with-arrow icon (`sessions.svg`, 14px) and "Sessions", `selected` while its panel shows and `chrome` otherwise, like the tab bar's own panel buttons. - **Where it shows:** - In the side panel column (368px by default, 280–900): the mod fills it on `chrome`. - As a popup (`mod.open sessions`, `cmd-shift-s`): 460×600 on `popover`, with the search field focused. - **The header** (10px padding, 6px at the bottom, 7px gaps): - A row: "Sessions" (12px, semibold, `foreground`), then one 22px toggle per agent (Claude Code, Codex, Kiro), then a 22px refresh button. A toggle is the agent's 13px full-color icon (Herdr's `icons/claude.svg`, `icons/codex.svg`, `icons/kiro.svg`) on a `raised` square while shown, and the icon at 30% opacity with no square while hidden. The refresh button is `refresh.svg` 13px `muted`; while any machine is loading, it's the shipped `mods/workspace-chrome/spinner.svg` at 12px in `working`, spinning every 900 ms. - A 30px search field: 7px radius, 1px `border`, `background`. Shipped `mods/workspace-chrome/search.svg` at 13px in `dim`, then the input (12px) with the placeholder "Search titles, folders and prompts…". - Three scope chips (22px, 8px padding, 6px radius, 11.5px), the chosen one `foreground` on `raised` and the others `muted`: - the repository's folder name, or "This space", with its count - the shown space's machine name, or "This computer", with its count - "All" with its count - **Notes**, one per machine, below the header (11.5px, 12px by 6px padding): - "Reading 's sessions…" before the first list arrives - "Still reading 's history (first run)…" while a first scan is partial - ": " in `blocked` - **The list**, scrolling, 4px side padding. Each row is 8px by 5px padding with a 7px radius, on `hover` while hovered, selected or asking: - Line 1: - the agent's 14px icon - the title in `foreground`, truncated - "open" (10.5px, `accent`) when a live terminal runs it - the age at 11px in `dim`: "now", "5m", "3h", "2d", or "4mo" past 60 days - on hover, the age gives way to an 18px trash button: `trash.svg` 12px, `dim`, turning `blocked` on `raised` under the pointer - Line 2, indented 21px, 11px `dim`: "Claude Code · claude-opus-4-1 · 5 prompts". Then " · " and, `muted` and at most 150px wide: - outside the space scope, the folder's name - in "All", also the machine - **Asking to delete** replaces line 2 with a reason and the buttons: - The reason, truncated: - "Delete for good?" (with " on " for a remote one), `muted` - "Active 4m ago; an agent may still be running it." when it changed in the last 10 minutes - "It's open in a tab; close it there first." in `blocked`, with no Delete button - the error from a failed delete, in `blocked` - Then "Delete" (`blocked`) and "Cancel" (`muted`), 20px buttons at 11px. - While the delete runs, the row shows a spinner and "Deleting…". - **"Show 50 more · 120 left"**: a 28px bordered button under the first 50 rows. Each press adds 50 more. - **When nothing matches**, one line: "No sessions match “query”.", "No sessions in yet." or "No sessions yet.". When agents are hidden it adds "Kiro is hidden; click its icon above to show it." - **The footer**: a 1px `border` line on top, 11px `dim`, `foreground` on hover. On the left, "225 scripted runs hidden · show" or "Showing scripted runs · hide"; on the right, "⇧-click forks". ## How it behaves - **Machines:** this computer, plus every machine from `hc machine ls --json` that is `connected` and not `temporary`. Each one lists its own sessions with `scan.py`, which runs there through `exec("python3", ["-c", , …], {on})`. Nothing is installed on the remote side. - **Scopes:** - **Space:** sessions whose folder is inside the shown space's repository. The space's folder is its first terminal's live `cwd`, else the folder it was made in. That folder is resolved once per machine and folder with `git rev-parse --show-toplevel`, else `pwd -P`. - **Machine:** every session on the shown space's machine. - **All:** every machine. - The chosen scope, the hidden agents and the scripted toggle are kept in `localStorage`. - **Sources** (all newest first): - **Claude Code:** `~/.claude/projects/*/.jsonl`. - Only `user`, `custom-title`, `ai-title` and `summary` lines are read. - User lines that are tool results, `isMeta` or `isSidechain` are skipped. `…` blocks are stripped. Text starting with `<` (slash commands, shell escapes) or `[Request interrupted` isn't a prompt. - The title is the custom title, else the AI title, else the summary, else the first prompt. - The model comes from the last `assistant` lines read, stepping past ``, up to 20 of them. The time is the last `timestamp`. - Sessions with no prompts, or whose `entrypoint` starts with `sdk`, are left out. - **Codex:** - Sessions come from the `threads` table of the newest `~/.codex/state_.sqlite`, opened read-only: `archived = 0` and `source` in `cli`, `vscode`. - It reads `id`, `cwd`, `title`, `first_user_message`, `model`, `updated_at`/`updated_at_ms` and `git_branch`, whichever exist. - The title is used only when it differs from the first message. - Prompt counts and search text come from `~/.codex/history.jsonl` (`session_id`, `text`). - **Kiro v3:** - Each session is `~/.kiro/sessions//sess_*/` holding `session.json` and `messages.jsonl`. - Prompts are the `"type":"user"` payloads. The title "New Session" counts as none. - The model is `session_state.rts_model_state.model_info.model_id`, else `modelId`. - **Kiro v2:** - Each session is `~/.kiro/sessions/cli/.json` with `.jsonl`. - Prompts are the `"kind":"Prompt"` lines. - Every folder is recorded with symlinks resolved (`realpath`), the same way the space's folder is resolved. - **Scripted runs** (automated or cron agent runs) are marked and hidden unless the footer is clicked. A run counts as scripted when: - its folder is empty, `/`, or under `/tmp`, `/private/tmp`, `/var/folders/` or `/private/var/folders/` - or its first prompt starts with `[AGENT SYSTEM PROMPT]`, `[Previous chat history`, `