Quick Start
1
Fork here, keep talking
Type The next message continues on the fork; the parent stays resumable.
/branch mid-conversation to fork at the current point and switch onto the fork:2
Fork from earlier
Rewind before forking with Forks from 3 user turns back and switches onto that fork.
--at N — N counts user turns back:3
Fork a saved session (no REPL)
Fork a session from the command line, then resume the fork:
How It Works
Forking routes through the sameHierarchicalSessionStore.fork_session substrate whether you branch in the REPL or from the CLI.
When to Fork
Pick the command that matches where you want to fork from.Options
/branch (REPL) and praisonai session fork (CLI) share the same substrate but differ in how the fork point is expressed.
/branch — REPL command
praisonai session fork — CLI verb
--at N in the REPL counts user turns back from the end. --at-message N in the CLI is a 0-based message index into the parent’s full history. They are different units — pick the one that matches the surface you’re on.Lineage
Forking records parent/child links that surface everywhere sessions are shown. The/session command prints lineage when set:
session list gains a Parent column — an 8-character parent id prefix, or - for a root session:
--json output includes parent_id per session:
Guardrails
Forking refuses unsafe operations rather than producing a corrupted timeline.Refuses while a turn is in flight
Refuses while a turn is in flight
/branch refuses if a response is still processing — otherwise the parent’s completed turn would land on the freshly-switched fork:/status), then branch.`/branch --at N` bounds
`/branch --at N` bounds
N must be a positive integer no greater than the number of user turns:`session fork --at-message N` bounds
`session fork --at-message N` bounds
--at-message is 0-based and validated up front against the parent’s message count — no silent slice wrap:Not-found handling
Not-found handling
A In the REPL,
session fork on an unknown id exits 1 with a remediation hint:/branch with no active session prints No active session to branch from. and a store failure prints Could not fork the current session. — neither crashes the REPL.JSON Output
session fork --json returns the fork result as a single object:
from_message_index and title are null when not passed.
Best Practices
Name your branches
Name your branches
Pass a title (
/branch jwt-attempt or --title "...") so session list reads like a menu of explorations instead of anonymous ids.Wait for the turn to finish
Wait for the turn to finish
Branch only after the current response settles —
/branch refuses mid-turn to keep the fork clean. Check /status if unsure.Resume the parent later
Resume the parent later
The parent timeline stays on disk. Note its id from the
✓ Branched: line so you can praisonai session resume <parent_id> to jump back.Fork from the right unit
Fork from the right unit
Use
/branch --at N to count user turns in the REPL; use session fork --at-message N for an exact 0-based message index from the CLI.Related
Session Command
Full
session sub-command reference, including forkInteractive TUI
REPL slash commands, including
/branch
