Saphan StudioDocs
Reference/Commands

saphan session

Manages the sessions the installation's record knows about: conversations the console started, terminals opened in the console, and attached sessions — agent sessions running in your own terminal that

Manages the sessions the installation's record knows about: conversations the console started, terminals opened in the console, and attached sessions — agent sessions running in your own terminal that you declare so the console can show their turns. An attached session is only a declaration: nothing is started, and its turns are read, read-only, from the vendor's own transcript file inside the reading seat's profile directory.

⚠ --user and --config-dir select; they do not authenticate. Anyone who can run saphan against this workspace can name any console user and any absolute directory, so the boundary that protects sessions and transcripts is file-system access to the workspace's state directory and to each profile directory.

saphan session attach

Declares a session running in your own terminal, recording which stream it serves, which vendor wrote it, and the one transcript file the console may read. The transcript must lie inside the profile directory given by --config-dir (or this process's own), and must already exist, or the declaration is refused and nothing is written. --session-id, --stream and --workdir are required. Run it once per session, at its start.

saphan session attach
flagtypedefaultwhat it does
--backendstringWhich vendor wrote the transcript: claude-code or codex.
--config-dirstringThe seat's profile directory, as an absolute path; defaults to this process's CLAUDE_CONFIG_DIR or CODEX_HOME.
--namestringAn optional name for the session, shown on its card in the console.
--rolestringThe role this session works as, which decides the console screen it appears on; without it the session appears on every screen.
--session-idstringThe vendor's own id for this session.
--streamstringThe stream this session serves.
--userstringThe console user this session belongs to; defaults to the provisioned console administrator.
--workdirstringThe session's working directory, as an absolute path.

saphan session census

Counts the kinds of lines in a vendor session file and reports how many are read as turns and, by name, which kinds were not. It reads the file only and writes nothing.

saphan session census
flagtypedefaultwhat it does
--backendstringWhich reader to measure with: claude-code or codex.
--pathstringThe vendor's session file.

saphan session close

Marks a terminal or attached session as closed, removing it from the console's active sessions; a closed session is final and is never resumed. Console conversations are ended by the console itself and are refused here, as are unknown ids, sessions recorded under a user other than --user and sessions already closed.

saphan session close
flagtypedefaultwhat it does
--reasonstringclosed by the operatorWhy the session ended, as it should appear in the record; defaults to closed by the operator.
--session-idstringThe session to close; saphan session list shows the ids.
--userstringThe console user; defaults to the provisioned console administrator.

saphan session list

Lists every session that is not closed, of every kind, for one console user. It never lists all users at once.

saphan session list
flagtypedefaultwhat it does
--userstringThe console user; defaults to the provisioned console administrator.

saphan session turns

Prints the newest turns of an attached session from the transcript its record names, read-only. The read is confined to the reading seat's own profile directory (--config-dir, or this process's own), never to a directory taken from the record; both paths are resolved through symbolic links before they are compared. A session recorded under a user other than --user is refused. The console uses the same read.

saphan session turns
flagtypedefaultwhat it does
--config-dirstringThe directory the read is confined to, as an absolute path; defaults to this process's CLAUDE_CONFIG_DIR or CODEX_HOME.
--maxint20How many of the newest turns to print; defaults to 20.
--session-idstringThe attached session to read.
--userstringThe console user; defaults to the provisioned console administrator.

Global options apply to every command — see Every command.

On this page