/branch (/fork) should keep the current process in the original session

Resolved 💬 2 comments Opened Mar 17, 2026 by satokupo Closed Apr 15, 2026

Summary

The /branch (and its alias /fork) command automatically switches the current process to the newly created branch session. This forces the user to leave the original session, which is unintuitive and inconvenient for parallel workflows.

Current Behavior

  1. User is in session A (working on a task)
  2. User runs /branch myname
  3. Current process is switched to the new branch session (new UUID)
  4. The original session A can only be resumed via claude -r <original-UUID>
  5. Unless the user ran /rename beforehand, there's no friendly name to resume the original

Expected Behavior

The current process should stay in the original session, and the branch should be created as a separate session that can be opened in another terminal:

  1. User is in session A
  2. User runs /branch myname
  3. User remains in session A
  4. Branch is accessible via claude -r myname in another terminal

Why This Matters

  • The current behavior requires users to always run /rename before /branch as a workaround, which is easy to forget
  • Users who want to work on both the original and branch in parallel (common use case) are forced to copy/paste a raw UUID to get back to the original
  • The mental model is counterintuitive — "branching" typically means creating something new from where you are, not moving to the new thing

Workaround

Currently users must:

/rename my-session    ← name the current session first
/branch my-branch     ← then branch (auto-switches to branch)
claude -r my-session  ← resume original in another terminal

Suggested Improvement

Either:

  1. Default to staying in the original session (preferred — matches git branch mental model where git branch foo doesn't switch to foo)
  2. Add a --no-switch flag to /branch
  3. Auto-assign a name to the original session before switching (e.g., derive from the branch name like myname-origin)

Environment

  • Claude Code version: 2.1.77
  • OS: macOS (Darwin 25.3.0, arm64)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗