Skip to content

compozy session fork

Fork a session with the same agent, whole or through one message and its turn

574 pages in CLI Reference

On this page6

Usage

compozy session fork <session-id> [flags]

Examples1

  1. Terminal
    compozy session fork sess_01J9R2K7M4T1
    compozy session fork sess_01J9R2K7M4T1 --message-id msg_01J9R2N3V0QF --name "Migration cleanup (alt)"

Options7

--expected-epochint
Transcript epoch the source must still have
--expected-generationint
Transcript generation the source must still have
--expected-max-sequenceint
Maximum event sequence the source must still have
--help-h
help for fork
--idempotency-keystring
Stable retry key (generated when omitted)
--message-idstring
Durable user message to fork through, including its turn (whole session when omitted)
--namestring
Name of the new session (defaults to the source title)

Inherited options3

--json
Emit JSON output
--output-ostring
Output format: human, json, jsonl, or toon (default "human")
--profilestring
Act as a profile for this command

Synopsis

Start a new session with the same agent, runtime, and account as the source. Without --message-id the whole conversation through the last settled turn is carried; with it, the conversation through that user message and its turn (the agent's reply and tool work). When the agent can clone its own session the new session loads that clone on its first prompt. The source session is never changed. Re-running with the same --idempotency-key and arguments prints the recorded result instead of creating a second session.

Output Formats

The root -o, --output flag accepts these values. A renderer is supported only when this command writes that result; jsonl is for commands that emit one JSON record per line.

FormatCommand result
humanInteractive terminal rendering
jsonMachine-readable JSON rendering
jsonlOne JSON record per line when supported
toonCompact agent-readable rendering

Example:

compozy session fork <session-id> -o json