🧩forkSession Option
Also known as forkSession, fork_session, Agent SDK fork, Claude Agent SDK forkSession
The option that starts a copy of an old session, with a new ID. The first one stays as it was.
Think of it like
It is like a copy you make to try a new idea.
Example
Leo wants to try two fixes from the same point. He forks the session twice and lets each branch try one.
Why it matters
You can try a risky path without losing the chat you had.
Definition
Common mistake
Key takeaways
- 1Use with resume. Then fork.
- 2New session ID. Original kept.
- 3Chat only. Not files.