Skip to content

[FEATURE]: /branch command to create new session with compacted context #7826

Closed as not planned

Description

@tobiastornros

Feature hasn't been suggested before.

  • 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.

Similar to git branches but for conversations.

Related to #4596 but with a different approach.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 11, 2026
  2. github-actions commented on Jan 11, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  4. qiankunli commented on Apr 21, 2026

    @qiankunli

    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.

  5. qiankunli commented on Apr 21, 2026

    @qiankunli

    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.

  6. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
  7. MartyMcFlyInTheSky commented on May 7, 2026

    @MartyMcFlyInTheSky

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions