gage session
The gage session command manages sessions. For background, see
Sessions.
A session is either native, a file in a session source such as the Claude Code home directory, or stored, a copy in the Gage store. Commands that take session IDs accept unique ID prefixes.
Three options select which sessions a subcommand works on. They are accepted before or after the subcommand, and each excludes the other two.
--stored-remote names a remote of the store. The sessions are those that
gage fetch brought from that remote, which are kept
apart from the store’s own sessions until
gage merge merges them. Nothing is fetched and
nothing is written. list, view, and find accept the option. add,
delete, and move refuse it, because fetched sessions are read only. With
list --dataset or list --share, the dataset or share is one the remote
holds.
A source is SCHEME:PATH. A scheme alone, with or without the colon, is the
default directory of that scheme: claude and claude: name the same source.
A path with no scheme is an error, because the path does not say which driver
reads it. A source can also be a name that the native settings give a source;
see gage config. When --native
is omitted, the source is the default session source, which the
native.default setting names; see
gage config. When no config
sets it, the source is the default directory of the default driver, which the
drivers.default setting names.
The claude scheme reads Claude Code sessions under PATH/projects, or the
Claude Code home directory when PATH is omitted. The codex scheme reads
Codex sessions under PATH/sessions, or the Codex home directory when PATH
is omitted. See Codex sessions. The pi
scheme reads Pi sessions under PATH/sessions, or under PATH when it has no
sessions directory, or the Pi agent directory when PATH is omitted. See
Pi sessions.
session list
List available sessions.
Sessions are listed most recent first. A stored session is as recent as its
last entry, or as the store’s last write of it when no entry has a time. A
native session is as recent as the last modification of its file. --since
goes by the same time. The Active column of a stored listing and the
Modified column of a native listing show it. Sessions in a dataset are listed
in member order.
session add
Add sessions to the store.
Each session is read from the source and written as a session object. Adding a session that is already in the store updates it when its content changed. At least one session argument or selection option is required.
A session touches a directory when it wrote or read a file in the directory or below it, or when it started there.
--limit combines with --since to cap the sessions selected from the window.
--sample draws from sessions active in the past 30 days, or the window given
with --since.
A stored session is as recent as its last entry, or as the store’s last write
of it when no entry has a time. A native session is as recent as the last
modification of its file. --since, --limit, and --sample all use this
time.
session delete
Delete native sessions, or stored sessions with --stored.
Each native session’s files are removed from the source. Stored sessions are not affected.
With --stored, each session is unlinked from every dataset and share that
holds it and marked removed in the store. The native session is not affected.
To take a session out of one dataset and keep it in the store, use
gage dataset unlink.
A native Codex or Pi session is not deleted; the command reports that it is not supported.
session move
Move a native session to another project.
The session’s files are moved to the project at DIR, and DIR is recorded as
the session’s working directory, so Claude Code resumes the session from there.
Stored sessions are not affected. A session that is open in Claude Code is not
moved. A Codex or Pi session is not moved; the command reports that it is not
supported.
session view
View a session.
If you omit the ID, Gage lets you pick from a list. A trailing :LINES opens
the view at a session line, as in 7260:2956. LINES is a line (42), a
range (10-20), or a comma-separated list of them (10-20,42). The view opens
at the first line.
Each view option has a short and a long name. A leading ! turns an option
off, as in !user.
session find
Find sessions by message text.
The command searches message text in the default source, in each --native,
in the store with --stored, and in the sessions fetched from each
--stored-remote. It lists the matching messages, best match first. --native
and --stored-remote are repeatable here, and the three options combine.
Bare terms match any of them. a AND b, +a, -a, a quoted phrase, and a
field term such as type:assistant narrow a search.
--user, --assistant, and --tool search only messages of those kinds.
--user with --assistant searches both.
Sessions are listed most recent first. A stored session is as recent as its
last entry, or as the store’s last write of it when no entry has a time. A
native session is as recent as the last modification of its file. --since
goes by the same time. The Active column of a stored listing and the
Modified column of a native listing show it. Sessions in a dataset are listed
in member order.