Feature Request: Session Branching / Conversation Forking
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened Nov 28, 2025 · closed Aug 17, 2026
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.
Showing cached comments. Read the full discussion on GitHub ↗
10 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I found this issue searching for this functionality. I just found the
/forkcommand, which is for me just enough to make it workable: it forks the session, puts the current client in one of the forks (who's the original? who knows?) and lets youclaude -rto drop into the other one.+1 for this! I regularly hit this pain point during long sessions.
My typical workflow involves exploring multiple approaches from the same conversation state (e.g., brainstorming project plans, then wanting to branch into different implementation directions). Having to exit, remember the right CLI flags, and restart breaks the flow significantly.
A
/forkslash command (or even a keyboard shortcut likeCtrl+F) would make this much more accessible. The underlying--fork-sessionmechanism already works well — it just needs an in-session entry point.Would also love the
/fork <name>variant for easier session management later.I also support this feature request. At least I discovered here that there is a way with
--fork-session, but/forkwould make more sense.There is a
/forkcommand<img width="1244" height="144" alt="Image" src="https://github.com/user-attachments/assets/cc41f064-96df-4fd1-97bd-192399dc7083" />
The only thing you need to do manually is run that resume command in another terminal session. Which is something that I'd want anyway so I can control where that session is launched (e.g. in a new tmux pane or window)
I'd like to connect some dots across related issues.
Current state:
/forkexists and works — but the UX breaks flow. You fork, get aclaude -r <session-id>string, then have to manually open a new terminal and paste it. For a feature meant to preserve momentum, this is ironic.The missing piece is automatic terminal spawning. I elaborated on this in #24123, but the key insight is: the infrastructure already exists. Agent Teams (
teammateMode: "tmux") already spawns independent Claude Code instances in new tmux panes/windows./forkcould reuse this same mechanism — the only delta is inheriting the current conversation history instead of starting fresh.This would also address the broader UX gaps discussed here and in the now-closed #10370, #4443, and #1417:
| What | Status |
|------|--------|
| Core fork mechanism (
--fork-session) | ✅ Shipped || In-session
/forkcommand | ✅ Shipped || Auto-open fork in new terminal tab/pane | ❌ Missing (#24123) |
Just making
/forkopen in a new pane would already make session branching a practical, daily-use workflow instead of a CLI trick most users don't discover.+1, this is exactly what I need daily.
Real use case from today: I'm in a long session where Claude helped me build and ship 5 MCP servers, design a brand logo, set up CI/CD, list on registries, etc. Now I'm at a decision point — Claude asks "do you want to build the marketing pipeline now?" I want to say yes AND also branch off to improve my shipping playbook, both starting from this exact point with full context.
Right now my options are:
/compactand continue (loses the branch)What I want (like ChatGPT's branch feature):
git branchbut for conversationsThis is especially critical for long planning sessions where you reach a fork in the road and want to explore both paths without losing context. The current workaround of relying on memory files doesn't preserve the conversation flow, decision rationale, or the "we just discussed X so let's build on that" continuity.
@jonkhler @NickNick @wxtry @tbrebant @axelson
I had the same frustrations with /fork — the terminal hopping and session ID tracking kills the flow. I built an MCP server called Variantree that handles branching, switching, and tree visualization inside a single session through natural language.
Named checkpoints and branches (no session IDs to track)
Switch branches in-place — code and conversation context swap together automatically
Tree visualization showing all branches and checkpoints
Claude gets only the relevant conversation history for the active branch, no context pollution.
Would love any feedback if you try it out — still actively developing and happy to prioritize features that would help your workflows.
I just came back to Claude Code CLI after using 'desktop' client for some time. This feature is exactly what's missing for me when comparing with the desktop app. There, when you 'fork', it duplicates the current session into a new one and lands you in it automatically.
This is _very useful_ for side quests. For example, If I want to ask Claude Code a clarifying question about it's latest response without cluttering the main session thread (which is usually quite busy with long responses by Claude Code - which is fine).
With this feature - the functionality is complete and I can really easily 'thread out' on a need basis in Claude Code CLI. Without it - lot's of the 'parallelizing' functionality of fork/branch is nullified :(
In a nutshell: "Agents view" is completely missing fork/branch functionality and this issue is about brining this missing functionality into "Agents view".