Skip to content

sessions: save and restore named session-list snapshots #145

Description

@grimmerk

The idea

Save the current set of sessions as a named snapshot, and later bring it back — either one session from it, or the whole set at once. The reference point is Session Buddy for browser tabs: you are not trying to keep everything open, you are trying to be able to put a working set down and pick it up again.

Why the existing tools do not cover it

CodeV already has three ways to keep a session findable, and none of them is this:

Mechanism What it is good at Why it is not a snapshot
Pins (#136, #137) "this one matters long-term" Flat and unbounded. 25 pins is already hard to read, and there is no notion of these five belong together.
Search (#132, #140) finding a session you can describe Requires remembering a distinguishing word. A working set is often "the four things I had open on Tuesday", which no query expresses.
Recency order what you touched last Decays. A set you put down two weeks ago is unreachable by scrolling.

A snapshot is the missing middle: a set, named, with a time, that survives being ignored.

Measured support for the gap, from the 2026-08-20 corpus survey: frecency ranking (the obvious "surface what matters" alternative) put only 3 of 7 real pins in its top 10, while three others ranked #26, #63 and #72. What people keep is not what they touch often — so an automatic ranking will not reconstruct a working set, and it has to be captured explicitly.

Sketch

  • Capture: the visible session list, or a hand-picked subset, under a name.
  • Restore: open one session from the snapshot, or launch/resume the whole set.
  • Browse: snapshots listed with their name and capture time.

Open design questions

  1. Does a snapshot store pin / hidden state too? Leaning yes, but stored beside the list rather than merged into it — a list records "what I was looking at", a pin records "this matters long-term", and merging them lets a restore silently rewrite pins.
  2. What does "restore the whole set" mean when sessions are dead? A snapshot can outlive its transcripts (see sessions: resume fails for sessions whose transcript was cleaned up — detect and mark as expired #135 — resume fails once a transcript is cleaned up). Restoring probably has to report which members are gone rather than failing as a batch.
  3. How does a snapshot survive /branch? A snapshot stores sessionIds, and /branch mints a new one for the same work — 23.9% of transcripts on disk carry forkedFrom (sessions: /branch creates generation chains — 23.9% of transcripts, and CodeV cannot tell them apart #142). Same failure mode as pin drift, and it wants the same answer: stable task identity across sessionIds, not per-feature patching. This is a reason to settle sessions: /branch creates generation chains — 23.9% of transcripts, and CodeV cannot tell them apart #142's C1 direction before building restore.
  4. Where does it live? session-marks.json in ~/.config/codev/ already holds pins and hidden state with atomic temp+rename writes and an fs.watch reload. A snapshot store is the same shape of problem; whether it shares that file or gets its own is an implementation call, but it must inherit the same authority invariant — PR feat(sessions): pin browse modes — recency order, ungroup, pinned-only #137 spent four review rounds narrowing "when is a read authoritative", and a second store that re-derives it will re-derive it wrong.

Priority

High value, medium-to-large effort. Group B in #144, sequenced after the search work (group A) and gated on question 3 above.

🤖 On behalf of @grimmerk — generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions