forkSession vs enableFileCheckpointing
People think forking a session also copies the files, and it does not. forkSession copies the chat into a new session with its own ID. That lets you try a second idea. A file the fork edits is changed for real, for each session in that folder. File checkpoints are what back files up, so the edits can be rolled back.
forkSession Option
The option that starts a copy of an old session, with a new ID. The first one stays as it was.
forkSession is the Agent SDK option that, used with resume, starts a new session from a copy of the old one. In Python it is fork_session. The copy gets its own session ID, and the original stays as it was. It branches the chat, not the files. Edits the fork makes on disk are real and shared with any session in that folder.
enableFileCheckpointing Option
The option that lets you put files back the way they were.
enableFileCheckpointing is the Agent SDK option that backs up files before the agent changes them, so you can roll them back. It covers the Write, Edit and NotebookEdit tools, not shell commands. Each prompt is a checkpoint, named by its message ID. Pass that ID to rewindFiles to put the files back. The chat stays as it is.
In one line
- forkSession Option
- The option that starts a copy of an old session, with a new ID. The first one stays as it was.
- enableFileCheckpointing Option
- The option that lets you put files back the way they were.