Support opening /branch in new terminal tab with shared /color

Resolved 💬 3 comments Opened Apr 4, 2026 by brandontomlin2 Closed Apr 8, 2026

Feature Request

Problem

When using /branch to fork a conversation, the branch runs inline in the same terminal. There's no way to:

  1. Open the branch in a new terminal tab/window — useful for comparing or working across the original and branched sessions side-by-side
  2. Share /color between the original and branched sessions — so both terminals are visually grouped as related work
  3. Revert /color when the branch closes — returning the original session to its default color once the branch is no longer active

Why this matters

When branching a conversation to explore an alternative approach, it's natural to want both sessions visible simultaneously. Visual grouping via shared color makes it easy to identify which terminals are related. Reverting the color on branch close keeps the workspace clean.

Current limitations

  • /branch is an in-process fork with no terminal integration
  • /color is ephemeral and session-only — not stored in settings or accessible via hooks
  • No BranchCreate or BranchClose hook events exist, so there's no way to intercept branch lifecycle
  • No programmatic API to get/set /color from hooks or CLI flags

Proposed solution

  1. BranchCreate hook event — fires when /branch or /fork is called, exposing the new session ID in the hook input JSON
  2. BranchClose / BranchEnd hook event — fires when a branched session ends
  3. --color CLI flag — allow setting the session color via claude --resume <id> --color cyan, enabling hooks to propagate color to new tabs
  4. --new-tab option for /branch — optionally open the branch in a new terminal tab/window (e.g., /branch --tab my-experiment)

With these primitives, users could configure hooks to:

  • Open a new terminal tab on branch creation via AppleScript/iTerm2 escape sequences
  • Start the branched session with claude --resume <branch-session-id> --color <parent-color>
  • Revert the parent session's color on BranchClose

Alternative / simpler approach

A built-in /branch --tab flag that handles the new-tab + color-sharing behavior natively, without requiring hook configuration.

🤖 Generated with Claude Code

View original on GitHub ↗

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