Documentation
¶
Overview ¶
Package fork cuts an agent's transcript at one of the person's messages and writes what comes before it as a new session of the agent, which the agent CLI resumes as its own: the conversation goes on from that point, the old transcript stays as it was.
Neither CLI can be driven there by a flag of an interactive start: Claude Code's --resume-session-at is read only in print mode, and its Esc-Esc picker (like Codex's Esc-Esc backtrack) rewinds inside the same transcript, which then holds both branches one after the other. A new session file holds only the kept one, and `claude --resume <id>` / `codex resume <id>` take it as it is (the session id inside the lines is the file's own, a uuid of the same length, so every kept line stays at its byte offset and the feed's entry ids do not move).
Index ¶
Constants ¶
const ( Claude = "claude" Codex = "codex" )
Providers, as the conversations name them.
Variables ¶
var ( // ErrNotFound: the transcript holds no line of that message. ErrNotFound = errors.New("fork: the message is not in the transcript") // ErrNothingKept: the cut is before the first message, and an agent cannot resume a session without one. ErrNothingKept = errors.New("fork: nothing before the message") )