claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Feature Request: Session Branching / Conversation Forking

Open jonkhler opened this issue 1 month ago • 2 comments

Problem

Claude Code has --fork-session functionality via CLI flags, but there's no way to access this from within a running session. Users must exit and restart with the right flags, which breaks flow and requires remembering session IDs.

Current State

The underlying functionality exists:

claude --continue --fork-session
claude --resume <session-id> --fork-session

But this requires:

  • Exiting the current session
  • Knowing the CLI flags exist (poor discoverability)
  • Manually tracking session IDs for later branching

Proposed Enhancement

Add in-session UI for forking:

  1. /fork command - Fork the current session at this point, opening a new session in a new terminal/tab
  2. /fork <name> - Create a named branch for easier reference
  3. /branches - List branches/forks of the current session lineage
  4. Keyboard shortcut - Quick fork without typing a command

Use Cases

  1. Exploring alternatives - Try two different implementation approaches from the same starting point
  2. Preserving a known-good state - Before attempting a risky refactor, create a branch to safely experiment
  3. A/B testing prompts - Test different instructions from the same conversation state to compare outcomes

Additional Context

The core functionality is already implemented - this is purely about exposing it through the in-session UI for better discoverability and workflow integration.


Updated: The original request was for session branching, which already exists via --fork-session. This issue now focuses on UI/UX improvements to make this feature more accessible.

jonkhler avatar Nov 28 '25 15:11 jonkhler