{ "schemaVersion": 1, "kind": "workbook-command-inventory", "verification": "Implementation-backed expectations; runtime proof and public recipe execution pending Main. This data file does not inspect your session.", "purpose": "Choose a conversation boundary, not a filesystem undo operation.", "columns": ["modelContext", "durableJournal", "sessionIdentity", "providerState", "queues", "cwdAndWorkspace", "artifacts"], "commands": [ { "command": "/fork", "useWhen": "Keep the current conversation and explore another direction under a new identity.", "modelContext": "Retained at the current state. This command does not open a previous-message picker despite the registry description.", "durableJournal": "Entries copied into a new transcript; parent transcript retained.", "sessionIdentity": "New journal ID and file; parentSession records the previous ID.", "providerState": "Agent identity is resynchronized; the provider prompt-cache affinity may be inherited. This is not a guarantee of a cold provider cache or a /fresh equivalent.", "queues": "Steering and follow-up queues are retained by the fork path.", "cwdAndWorkspace": "Interactive fork keeps cwd. Files remain shared: no worktree, snapshot or rollback is created.", "artifacts": "Session artifact directory copied recursively where available. Missing sources are ignored; other copy failures are logged and do not undo the fork.", "guards": "The interactive controller refuses while streaming. A non-persistent session cannot fork. A session_before_switch hook can cancel.", "recovery": "Wait or abort the response before retrying. After cancellation or failure, inspect the actual journal ID and path before continuing." }, { "command": "omp --fork ", "useWhen": "Create another identity from an existing transcript at startup.", "modelContext": "Rebuilt from the copied history; no running-process queues are inherited.", "durableJournal": "A new transcript is written; source transcript retained.", "sessionIdentity": "New ID with parentSession pointing to the source ID.", "providerState": "Inherited prompt-cache affinity is possible; it is not workspace isolation.", "queues": "Startup has no parent-process steering/follow-up queues to clone.", "cwdAndWorkspace": "Uses the CLI launch cwd, unlike interactive /fork which keeps its existing cwd. No workspace files are copied.", "artifacts": "Same best-effort session artifact copy by default.", "guards": "--fork combined with --no-session is rejected. Unknown source ID is an error.", "recovery": "Use the disposable lab's explicit absolute source path and inspect the resulting header." }, { "command": "/fresh", "useWhen": "Refresh local provider transport/session state without dropping the conversation.", "modelContext": "Messages retained. Append-only provider prefix state is invalidated for rebuilding.", "durableJournal": "Unchanged; no new transcript and no reset boundary.", "sessionIdentity": "Persistent journal ID/file retained. AgentSession.sessionId is a provider-facing value and rotates; do not confuse it with SessionManager.getSessionId().", "providerState": "Cached local provider handles receive close(); the local handle map is cleared and a fresh provider-facing ID is minted.", "queues": "Retained.", "cwdAndWorkspace": "Unchanged.", "artifacts": "Unchanged by this operation.", "guards": "Refuses while streaming.", "recovery": "This establishes a local reset only. It does not prove that a remote outage, auth failure, retained provider data or external session is fixed." }, { "command": "/clear", "useWhen": "Drop the current live/model conversation while continuing the same persistent session.", "modelContext": "Messages and pending tool state cleared; subsequent rebuilds start after the newest reset boundary. Base/project context remains applicable.", "durableJournal": "Old entries retained, followed by reset_boundary. Full-history transcript views can still include pre-clear content.", "sessionIdentity": "Persistent ID, transcript path, title, model and settings retained.", "providerState": "Local handles closed and provider-facing identity rotated.", "queues": "Steering/follow-up and pending next-turn messages cleared; old asynchronous work is cancelled by the implementation.", "cwdAndWorkspace": "Unchanged. Clearing the conversation does not revert file edits.", "artifacts": "Existing artifacts remain. This is not deletion or disclosure protection.", "guards": "Refuses while streaming or foreground bash/Python runs. Controller first aborts/waits for compaction.", "recovery": "Wait or abort current work, then retry. An empty live view is not proof that the journal is empty." }, { "command": "/new", "useWhen": "Start a different session rather than continue the current identity.", "modelContext": "Conversation reset; base/project prompt is refreshed.", "durableJournal": "Previous journal retained; new session path allocated. An empty new transcript may not yet be materialized on disk.", "sessionIdentity": "New ID/path; the ordinary /new command does not create a fork parent link.", "providerState": "Local handles closed; transient provider identity cleared in favor of the new session ID.", "queues": "Cleared.", "cwdAndWorkspace": "Current project workspace remains; no rollback.", "artifacts": "Prior session artifacts are not deleted by ordinary /new and are not copied as a fork.", "guards": "A session_before_switch hook can cancel. Unlike /fresh and interactive /fork, the SDK new-session flow aborts current work after the veto point.", "recovery": "If vetoed, the session remains even though transient UI may already be cleared. Inspect identity, not a blank screen." } ], "warningOnly": { "commandName": "/drop", "exercise": "Do not run it in this workbook.", "implementation": "Controller requests newSession({drop:true}) for a persistent session. Deletion targets the prior session file/artifact directory. AgentSession catches/logs a deletion failure and can still continue into a new session whose UI says Session dropped.", "boundary": "Best-effort local deletion is not secure erasure. Forks, exports, backups, workspace files and provider-held copies can survive. There is no confirmation dialog in the inspected command path.", "verification": "Source inspection only; no deletion scenario is executed by the proof." }, "sourceAnchors": [ "packages/coding-agent/src/slash-commands/builtin-lifecycle.ts:80-129", "packages/coding-agent/src/slash-commands/builtin-session.ts:483-491", "packages/coding-agent/src/modes/controllers/command-controller.ts:924-1029", "packages/coding-agent/src/session/agent-session.ts:4437-4548,7153-7255,7271-7343,8238-8534", "packages/coding-agent/src/session/session-manager.ts:116-136,1419-1475,2302-2307,2700-2742", "packages/coding-agent/src/session/session-context.ts:289-293,365-404", "packages/coding-agent/src/main.ts:889-915" ] }