claude-code
claude-code copied to clipboard
Feature Request: Session Branching / Conversation Forking
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:
-
/forkcommand - Fork the current session at this point, opening a new session in a new terminal/tab -
/fork <name>- Create a named branch for easier reference -
/branches- List branches/forks of the current session lineage - Keyboard shortcut - Quick fork without typing a command
Use Cases
- Exploring alternatives - Try two different implementation approaches from the same starting point
- Preserving a known-good state - Before attempting a risky refactor, create a branch to safely experiment
- 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.