saphan session-hook
Runs Saphan Studio's built-in hook for one event of an agent session: sessionstart, pretooluse, posttooluse, precompact or stop.
Runs Saphan Studio's built-in hook for one event of an agent session: sessionstart, pretooluse, posttooluse, precompact or stop. A session's hook configuration calls this command instead of a script, and saphan init can write that configuration into the workspace's .claude/settings.json with your consent. The hook only reads, returns within about two seconds, and never breaks the session: if it cannot reach the record it still exits successfully. Under contract 2 it also prints, at session start only and within a fixed size, the seat's unread messages as this machine last fetched them and the remembered context for its role, which the agent vendor then injects into the session; a part it cannot read is printed as missing, with the reason.
| flag | type | default | what it does |
|---|---|---|---|
--contract | int | 0 | Required: the hook behaviour the configuration was written for — 1 injects nothing into the session, 2 adds unread messages and role memory at session start; an unsupported number is refused by name. |
--explain | bool | false | Print one line on standard error saying what the hook read, or why it read nothing. |
Global options apply to every command — see Every command.
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
saphan show
Prints a registered order — the instruction document a piece of agent work runs under — exactly as it was registered, read from the commit recorded with its registration.