← Catalog

@timmyjl12/pi-session

A full-screen session browser overlay for the pi coding agent — prompt history, latest, per-project and all sessions with a live preview pane, a transcript viewer, and one-key session loading.

Extension

Install

Install with PiG

pig install npm:@timmyjl12/pi-session

Install with Pi

pi install npm:@timmyjl12/pi-session
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.1 (README.md). PiG does not review it.

@timmyjl12/pi-session

A full-screen session browser for the pi coding agent. Browse every past session, search your prompt history, read a whole transcript without leaving the overlay, and load any session with one key.

╭─ Sessions — Latest ─────────────────────────────────────────── 2,998 sessions · 62 projects ╮
│                                                                                             │
│  Most recent sessions across every project                                                  │
│ ⌕ Search titles, prompts, folders, models…                                   50/50 · newest │
│                                                                                             │
│  History 2,000    Latest 50    Project 40    Pinned 2    All 514    Settings                │
├─ Sessions ─────────────────────────────────────┬────────────────────────────────────────────┤
│ ❯ ● Fix rounding in custo… extensions      now │ Fix rounding in customer growth            │
│   ★ Model picker polish    extensions       2h │ D:\dev\extensions                          │
│     Deploy prefect flow    prefect   yesterday │ ★ pinned · 01a1e49f                        │
│                                                │ started 2026-11-16 08:50 · active now      │
│                                                │ 4 prompts · 9 replies · 22 tool calls      │
│                                                │ 182k tokens · $1.42 · 2.1 MB               │
│                                                │ ── recent prompts ──────────────────────── │
│                                                │ › run the tests again                   1m │
├────────────────────────────────────────────────┴────────────────────────────────────────────┤
│  ↑↓ move · enter read · ctrl+L load · Tab tab · ctrl+P pin · type search · esc close        │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯

Install

pi install npm:@timmyjl12/pi-session

Then run /sessions (or /session-browser) inside pi.

Tabs

TabShows
HistoryEvery prompt you sent, newest first, across all projects (or only this one — see Settings). Enter opens the session scrolled to that prompt.
LatestThe most recent sessions across every project.
ProjectSessions started in the current folder.
PinnedSessions you pinned with ctrl+P.
AllEvery session, grouped by project folder (ctrl+G flattens).
SettingsOptions, plus rescan and rebuild of the index.

The right-hand pane previews the highlighted session: folder, id, start and last-activity time, prompt / reply / tool-call counts, tokens, cost, file size, models used, its recent prompts and the last reply.

Keys

List

KeyAction
↑ ↓ PgUp PgDn Home EndMove
Tab / shift+Tab (or → / ← when the search is empty)Switch tab
typeSearch (every word must match title, prompts, folder, id or model)
EnterRead the session in the viewer
ctrl+LLoad the session now
ctrl+PPin / unpin
ctrl+SCycle sort (last activity, created, message count, cost)
ctrl+GGroup / flatten the All tab
F5 / ctrl+RRescan for changed sessions
EscClear the search, then close

Viewer

KeyAction
↑ ↓ / j k, PgUp PgDn / space, g GScroll
n / p (or ] / [)Next / previous prompt
Enter or ctrl+LLoad this session
tTool output: first lines → full → hidden
hShow / hide thinking
ctrl+PPin / unpin
Esc, ← or qBack to the list

The viewer shows the session's active branch — the same conversation pi restores when you load it.

Loading uses pi's own session switch, exactly like /resume. If the agent is still working you are asked first (turn this off in Settings). There is no keyboard shortcut on purpose: pi only lets commands switch sessions.

Settings

Stored in ~/.pi/agent/pi-session/settings.json (pi's agent directory, so PI_CODING_AGENT_DIR is respected).

SettingDefault
Open on tabLatest (or "Last used")
Sort sessions bylast activity
Group All by projecton
Latest tab size50
History coversevery project
Hide empty sessionson
Show subagent sessionsoff — child sessions created by subagents (reviewer#1a2b3c4d) are hidden; pinned ones always show
Hide temp-folder sessionson — sessions started under the system temp folder or /tmp (test runs, scratch) are hidden; pinned ones always show
Tool output in viewerfirst lines
Show thinking in vieweroff
Confirm load while busyon

How it stays fast

pi's own session list reads every session file in full each time. With thousands of sessions that takes a while (about 28 s for 3,000 sessions / 3.3 GB on the author's machine). pi-session keeps its own index in ~/.pi/agent/pi-session/index.json:

  • Session files are append-only, so each file's entry remembers how many bytes it has read. A rescan reads only the bytes added since, and only for files whose size or modification time changed.
  • Tool results and system prompts make up most of the bytes. Each line is classified from its first bytes, and only user and assistant messages, names and model changes are parsed.
  • The overlay opens immediately on the cached index and refreshes in the background, newest files first.

On the same 3,000 sessions the first index build took about 7 s, and a reopen with nothing changed about 0.1 s. Use Settings → Rebuild index if the cache ever looks wrong.

Session files are only ever read — pi-session never edits, renames or deletes them.

Environment

VariableEffect
PI_SESSION_GLYPHS=asciiASCII glyphs for terminals that draw ❯ ⌕ ▾ ⚙ two cells wide
PI_SESSION_DIRWhere settings and the index cache are stored

Development

npm install
npm run check                       # typecheck + tests
npm run preview                     # render every tab against synthetic sessions
npm run preview -- --real --plain   # render against your real sessions (read-only)

License

MIT