Ta treść nie jest jeszcze dostępna w Twoim języku.
Branch & Merge Sessions
Branch a session when you want to try something without cluttering the main conversation: a different approach, a side question, a risky experiment. The branch starts with the conversation up to the answer you picked. When you’re done, merge the useful part back into the main session as context.
Branch from an answer
- Wait for the agent to finish its answer. You can’t branch while the answer is still coming in.
- Click Fork from here under the answer.
A new session opens with the conversation up to and including that answer. Its title is the original title plus (fork #1), (fork #2) and so on. It works in the same project folder as the main session, so both see the same files.
You can also pick Fork from here on one of your own messages. The branch then starts just before that message, and the message text goes back into the message box so you can edit and resend it.
Merge back into the main session
- In the session sidebar, open the branch’s menu.
- Pick Merge into main session.
The merge sends the branch’s conversation to the main session as a context note. It isn’t a new instruction, so the main agent doesn’t start working on it. Your next message there can build on it.
- Only the text of your messages and the agent’s answers is sent. Tool output isn’t included.
- Long branches are summarized first. The message tells you which happened: “Merged into the main session.”, “Merged a summary into the main session.”, or “Merged only the latest messages into the main session.”
- Files aren’t copied, because the branch already works in the same folder. Any file the branch changed is already changed for the main session too.
- Each merge reads only the latest 200 messages of the branch. Older messages you haven’t merged yet are left out.
- You can merge again later. Only what’s new since the last merge is sent. If nothing changed, you see “Nothing new to merge since the last merge.”
After the merge, the app asks Delete this session?. Click Delete to remove the branch, or Keep to keep it. If you ignore the question, the branch stays.
You can’t merge while the main session or the branch is working. Wait for it to finish, then try again.
A branch of a branch merges into the branch it came from, not into the first session.
Branch or start a new session?
Start new session from this answer in the answer’s menu is a different feature. It starts a fresh session with only that answer and your instructions, without the earlier conversation, and it isn’t linked to the original. Use it to hand off a finished plan. Use Fork from here when the new session needs the whole conversation so far. See Session Goals for the options in that dialog.
Related
- Worktree Sessions: try changes in a separate copy of the files instead of the same folder
- Drafts: try changes in a copy of the project with other people