You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: /branch command to create new session with compacted context #7826
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
When working on larger tasks, I often want to explore different ideas or directions without losing the context of what I've already discussed.
A /branch command would create a new session with a summary of the current conversation, letting you branch off to try different approaches while preserving shared context.
This is still very relevant, and I want to add a concrete workflow that would benefit from this.
A common case is: I have been discussing and refining a plan in one long session, the main implementation is basically done, and now I need to do some side-task work like preparing a git commit.
That git step is not part of the main problem-solving flow, but it can consume a surprising amount of context:
checking git status/diff
drafting or revising the commit message
maybe handling a small follow-up around staging
What I want is to branch/fork the current session into a temporary child session dedicated to that side task, while keeping the original session focused on the main thread.
Ideal UX would be something like:
fork current session into a new branch/session
optionally open it in a separate tab/window/pane
use that fork for commit / cleanup / publishing work
keep the original session available so I can continue the main task without polluting its context
So this is not only about “exploring alternative ideas”. It is also about isolating non-primary workflows that are useful but context-heavy.
If OpenCode already has low-level fork support in CLI, having a first-class TUI/Desktop workflow for this would be especially valuable.
A concrete reference point here: Codex has a /side command for this exact class of workflow.
/side starts a temporary side conversation from the current thread, with inherited history available as reference, while keeping the main thread focused. In practice it is useful for things like:
commit / staging / publish prep
quick investigation or codebase exploration
follow-up questions that are useful but not part of the main problem-solving thread
What I like about that model is that it is not just “fork for alternative ideas”. It is specifically a lightweight child thread for context-heavy side work, so the primary thread does not get polluted.
If OpenCode already has parent/child session infrastructure and subagent session navigation, a first-class UX around this kind of temporary side session could be very valuable.
This would be absolutely invaluable. I'm encountering a situation right now where I implemented changes using one context, now I need to rebase on origin's master and there are a lot of rebase conflicts. In this situation ideally I could branch my previous session and use the context to solve the merge conflicts in a way that align to my PR. I don't want to use the original cluttered context since this is essentially a new focused task that doesn't need to cost me a fortune in tokens, but I still want the new session to be aware what's happening. Currently I'm compacting the session to a file and copy+pasting it into the new session. Feels not very powerful.
Activity
github-actions commentedon Jan 11, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
qiankunli commentedon Apr 21, 2026
This is still very relevant, and I want to add a concrete workflow that would benefit from this.
A common case is: I have been discussing and refining a plan in one long session, the main implementation is basically done, and now I need to do some side-task work like preparing a git commit.
That git step is not part of the main problem-solving flow, but it can consume a surprising amount of context:
What I want is to branch/fork the current session into a temporary child session dedicated to that side task, while keeping the original session focused on the main thread.
Ideal UX would be something like:
So this is not only about “exploring alternative ideas”. It is also about isolating non-primary workflows that are useful but context-heavy.
If OpenCode already has low-level fork support in CLI, having a first-class TUI/Desktop workflow for this would be especially valuable.
qiankunli commentedon Apr 21, 2026
A concrete reference point here: Codex has a
/sidecommand for this exact class of workflow./sidestarts a temporary side conversation from the current thread, with inherited history available as reference, while keeping the main thread focused. In practice it is useful for things like:What I like about that model is that it is not just “fork for alternative ideas”. It is specifically a lightweight child thread for context-heavy side work, so the primary thread does not get polluted.
If OpenCode already has parent/child session infrastructure and subagent session navigation, a first-class UX around this kind of temporary side session could be very valuable.
MartyMcFlyInTheSky commentedon May 7, 2026
This would be absolutely invaluable. I'm encountering a situation right now where I implemented changes using one context, now I need to rebase on origin's master and there are a lot of rebase conflicts. In this situation ideally I could branch my previous session and use the context to solve the merge conflicts in a way that align to my PR. I don't want to use the original cluttered context since this is essentially a new focused task that doesn't need to cost me a fortune in tokens, but I still want the new session to be aware what's happening. Currently I'm compacting the session to a file and copy+pasting it into the new session. Feels not very powerful.