Retroactive Branching ("Split & Rollback") from a Specific Message in Cowork (and Code)

Resolved 💬 1 comment Opened Jun 3, 2026 by mischacoster Closed Jul 7, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet. It resembles #12629, #32631 and #4443 but differs from these fundamentally because this feature is about retroactive branching, not proactive.
  • [x] This is a single feature request (not multiple features)

Problem Statement

When interacting with AI, conversations often drift into tangent topics. Currently, users can use the "Restart conversation from here" (Rollback) feature. However, this action completely deletes or overwrites all subsequent messages.If the tangent topic contains valuable insights, the user is forced into a bad compromise: either they lose the off-topic-but-useful information by rolling back, or they keep a "polluted" chat history that degrades the AI’s context window for the original topic. There is currently no native way to cleanly separate these two conversational paths retroactively.

Of course the user has /btw and /fork available (in Code), but this requires the user to acknowledge the off-topic or split-topic character of the request beforehand, which is often not how this 'session scope creep' develops. It's often an on-topic thought or model response that triggers exploration and (when really exploring the idea) context consumption/pollution.

Additionally, the problem becomes even stronger and/or more frequent for users with a neurodivergent attentional system like seen in ADHD and ASD.

Proposed Solution

I propose adding a "Branch and Rollback" or "Split and Rollback" button right next to the existing restart/rollback icon under each user message block. When clicked, this button triggers two simultaneous actions:

  1. The New Thread (Branch): Spawns a brand-new, independent chat session. This new thread automatically imports
  • a condensed summary of the initial history (pre-split) to maintain core context
  • all the subsequent tangent messages that were cut from the original thread.
  1. The Original Thread (Rollback): Truncates the current conversation back to this exact message, allowing the user to continue the original topic without the "polluted" tangent context.

Would be a great feature or a great addition to (not replacement of, because the requests below do NOT cover the 'retroactive' core component of this proposal) existing feature requests:

Implementation considerations (getting ahead of the hard parts)

Let me name the tricky parts myself, because they are real and I would rather frame them than have them used to shoot the idea down.

  1. Rollback is context-only, not a world rollback. In Code and Cowork a message is not just text: it can carry tool calls, file edits, shell commands and MCP actions. Truncating the original thread cleans the conversation and the context window, but it does not undo side effects that already hit disk. So this is context hygiene, not an undo (which is fine for the goal here, as long as the copy does not promise more than that).
  1. The branch should import the tangent as a transcript, not replay it. Re-running the tangent's tool calls in a fresh session would be risky and often non-idempotent (re-running a migration, overwriting a file, re-calling a paid API). So the new thread should carry the tangent as a read-only record plus the summarized pre-split context, and continue forward from there. You keep the thinking and the outputs without re-triggering the actions.
  1. Tangents are rarely perfectly contiguous. The simple model ("cut everything after this message") assumes the tangent runs cleanly from the split point to the end. In practice on-topic and tangent messages interleave. A pragmatic v1 can handle the common contiguous case and offer a multi-select range for the messy case, instead of trying to auto-detect topic boundaries (a can of worms I would keep out of v1).

None of this blocks the feature. It mostly shapes the scope and the copy of v1: clean context plus a lossless capture of the tangent, explicitly not an action-level undo.

Alternative Solutions

  • Manual Copy-Pasting: The user manually copies the entire tangent text, opens a new chat, summarizes the old context themselves, and pastes it. This is tedious and disrupts user flow.
  • Simple Forking without Rollback: Duplicating the entire thread as-is into a new chat. This solves the new thread problem but leaves the original thread cluttered and polluted.
  • Giving the user a choice to 'promote' / branch a currently engaged /btw question into a new session.

Priority

Medium - Would be very helpful

Feature Category

Performance and speed

Use Case Example (1) - Claude Code

  1. Context: A developer is discussing database optimization in a long chat.
  2. Drift: Mid-conversation, they ask a quick question about Docker container security without using /btw because it feels like a relevant and on-topic quesstion. The AI gives a great, detailed answer, and they follow up on Docker for 5 more messages.
  3. Problem: The developer wants to go back to database optimization, but the AI's context window is now cluttered with Docker configurations.
  4. Action: The user goes back to the last database-related message, clicks "Branch & Rollback".
  5. Result:The current chat rolls back to the database topic, clean and on-track.A new chat named "Docker container security (branched)" is created, containing a summary of the database setup and the full 5-message Docker discussion.

Use Case Example (2) — knowledge work, Cowork (no code)

  1. Context: In Cowork, I am drafting a client proposal with Claude. We iterate on scope, pricing and tone across a long thread.
  2. Drift: A small remark about how I manage my own setup turns into a deep, genuinely useful exploration of instruction architecture, hooks and context management. None of it felt off-topic in the moment (that is exactly the trap), so /btw never crossed my mind.
  3. Problem: The proposal thread now carries a long architecture tangent. The original task is buried and diluted, and the model's attention on the proposal degrades. And unlike code, there is no commit or diff to fall back on, so the pollution is actually harder to undo.
  4. Action: I go back to the last proposal-related message and click "Split & Rollback".
  5. Result: The proposal thread is clean and back on track. A new thread "Instruction architecture (branched)" holds a summary of the proposal context plus the full tangent, so none of the thinking is lost.

I tagged area:cowork on purpose: in knowledge work the tangent is often the most valuable thinking of the session, and there is no version history to lean on.

Additional Context

Underneath every user message:

[ User message here ]
------------------------------------------------------------
[ ↻ Restart ] [ ⌥ Split & Rollback ] [ 📋 Copy ]

Icon Suggestion: A classic Git branch icon (⌥ or a splitting node symbol) placed next to the refresh/restart circle arrow. Tooltip Text: "Branch tangent topic to new conversation and rollback here"

UX Flow: Clicking the button prompts a subtle confirmation toast: "Original thread rolled back. Tangent moved to a new branched conversation with original context summary." with a direct link to open the new thread.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗