[FEATURE] Conversation branches (/branch) should surface in agent view, with a merge-back path
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Claude Code now has three ways to fork a conversation — /branch, /fork, and --fork-session — plus the claude agents agent view for managing parallel sessions. But the fork primitives and the agent view are largely disjoint, and there's no way to merge a branch's work back. Two concrete gaps:
- A
/branchnever appears in the agent view./branchcreates a clean, isolated conversation fork (separate session ID, original preserved, reachable via/resume). But interactive sessions don't show up inclaude agentsuntil they're separately backgrounded (/bg,←on an empty prompt, or launching withclaude --bg). So a branch lives only in the/resumepicker; to make it a citizen of the fleet you have to branch and then background it — two disjoint mental models for what feels like one operation.
- There's no merge-back. Once you branch to explore an alternative direction, there's no way to fold the branch's conclusions/work back into the original (or any other) timeline.
/resumeonly switches sessions; it never combines them. Bringing the good parts back is a manual export-and-reread or git-commit chore.
Net effect: "fork off, explore, bring back the winner" — the entire reason to branch — is a multi-step dance across two subsystems with a manual merge bolted on at the end.
Proposed Solution
Treat conversation branches as first-class agent-view citizens, and add a deliberate merge path:
- Surface branches in the agent view. Either auto-register a
/branch'd session intoclaude agents, or add a single "branch into agent view" action/keybinding so forking and fleet-visibility are one step instead of/branch→/bg→←. A sticky setting to default new branches (or sessions) into the fleet would also resolve the recurring "do I need a CLI param for this?" confusion — today only per-session backgrounding exists.
- A merge-back mechanism. A
/merge <session>command (or an agent-view action) that folds a selected branch's work back into the current timeline on the user's terms — pulling its summary/conclusions, or its file diffs. Keep it a deliberate pull, not the auto-return that/forkalready does. The keyboard swap in the agent view (↑/↓to select,→/Enterto attach,←to detach) is already good; this just completes the branch → explore → merge round trip.
Alternative Solutions
Current workarounds, all friction-heavy and undiscoverable:
- Get a branch into the fleet:
/branch <name>, then/bg(or←on an empty prompt), then navigate. - "Merge":
/exportthe branch to a file and reread it from the other timeline, or have the branch land git commits and review them from the original. - Auto-attach: none. There's no settings.json key or env var to default sessions into the fleet — only
disableAgentView/CLAUDE_CODE_DISABLE_AGENT_VIEW(disable-only), andCLAUDE_AUTO_BACKGROUND_TASKS=1, which auto-backgrounds long-running subagents, not interactive sessions.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- I'm at a known-good point and want to try two implementation directions.
/branch approach-a, work it; back to the original,/branch approach-b, work that.- I want both visible in
claude agentsso I can swap between them with arrow keys — and let each run its own subagents/processes. - Approach-b wins. I want to fold its conclusions (and/or its diffs) back into my main timeline, without manually exporting and rereading.
Today, step 3 requires separately backgrounding each branch, and step 4 has no built-in path at all.
Additional Context
Related naming friction (noted as context, not a separate ask): the three fork primitives use "fork"/"branch" in confusingly opposite ways. /fork <directive> spawns a background subagent that returns its result into the parent conversation (a round-trip "jaunt"), while /branch and claude --continue --fork-session are clean, independent forks that never talk back. Same vocabulary, opposite cross-talk behavior — it's easy to reach for /fork expecting a clean branch and instead get an auto-returning subagent. Worth disambiguating in docs and/or naming as this area stabilizes.
Related issues: #12629 (expose in-session branching — largely shipped; this is the next layer up) and #60272 (fork-in-agents-TUI working-directory semantics — adjacent, different angle).
Offered as constructive feedback on the agent-view beta (area:agent-view): the primitives are each great, they just don't compose yet.