Feature Request: Add session fork functionality
Motivation
After finishing work in a session, I often want to branch into parallel tasks that share the same context. For example, after implementing a feature, I want to simultaneously write tests (in one session) and docs (in another) - both need the implementation context but should run independently.
Currently this requires re-explaining context in new sessions or working sequentially.
Proposed Solution
Add a --fork flag:
goose session --resume --fork
goose session --resume --name <session-name> --fork
goose session --resume --session-id <session-id> --fork
Creates a new session with all messages copied from the source, allowing independent continuation.
Alternatives Considered
- Manual DB duplication (error-prone, not user-friendly)
- Export/import session JSON (more complex than needed)
Additional Context
-
Claude Code has this via
--fork-session- proven UX -
Desktop UI: fork button in session history would be a nice future addition
-
[x] I have verified this does not duplicate an existing feature request
we have the functionality in the desktop (/cc @zanesq) - there's now a primitive to copy a conversation (which it looks like what you want) and a truncate (in the desktop you can edit a message further back in time and then fork from there, or wipe the rest of the conversation and continue with the new message).
@DOsinga / @zanesq I took a stab at implementing this in #5882 which builds on top of that copy session primitive - wondering what you think!