[FEATURE] Let /branch register the new session in agent view without a separate /bg
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
/branch and agent view are disjoint. Agent view lists only backgrounded sessions, so a branched session is reachable through the /resume picker but never appears in claude agents until it is separately backgrounded. Branching and putting the branch in the fleet feel like one intent, but they are two commands across two subsystems, and /branch's own output points only at /resume.
This was raised before in #69712, which was auto-closed as stale with no maintainer response. That issue bundled this with a /merge command. This one asks only for the visibility half.
Proposed Solution
Make a branched session able to land in agent view as part of branching, instead of as a follow-up action. Any one of these is enough:
- an argument on the command, e.g.
/branch <name> --bg, where the new session appears as an agent-view row and the current terminal stays on the original - a settings key that defaults new branches into agent view
- a second branch action in the TUI that registers the new session
The branch is already identifiable at creation time: since v2.1.214, SessionStart fires with source: "fork" for /branch, /fork, and --fork-session. The signal this would key on is already plumbed.
Alternative Solutions
The workaround is /branch <name>, then /bg or ← on an empty prompt inside the new session. It works, but it is a separate step and is not discoverable from /branch.
There is no setting that defaults a session into agent view. disableAgentView and CLAUDE_CODE_DISABLE_AGENT_VIEW are disable-only, and --bg applies at launch, not to a session created mid-flight by /branch.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- At a known-good point, branch
approach-aso it becomes an agent-view row. - Branch
approach-bthe same way. - Arrow between the original and both branches from agent view.
Today each branch has to be backgrounded individually after it is created.
Additional Context
Related: #69712 (same ask, stale-closed, bundled with merge-back), #73053 (branch lineage for hooks; source: "fork" shipped from it).