[FEATURE] Add /fork (conversation branching) support to VS Code extension
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The CLI supports conversation forking via --fork-session (and /fork slash command), allowing users to branch a conversation at any point and explore a different direction while preserving the original session. This capability is available by clicking on a previous message, but this creates an issue where the context is lost when the message is far back in the conversation.
Proposed Solution
/fork slash command available in the VS Code extension prompt box (alongside existing commands like /compact, /usage, etc.)
Forked session appears as a new tab, preserving full conversation history up to the fork point.
This will allow the user to fork the message at that current point instead of going far back in the history and losing valuable context.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
PLEASE add this! This would be very useful!
Often times I send a message and then Claude will send many, many messages and context back so it would be nice to "/fork" from that current point instead of clicking on that message I sent a long time ago to "fork conversation from here"
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
Want to give credit to @ahartzog for creating the original issue that was prematurely closed, which I copied some text from since it was well worded
@ianwieds you _can_ sort of accomplish this with double-pressing escape but it's rather unintuitive and I think adding the
/forkcommand would be very helpful@ahartzog yeah that method is okay, but it still doesn't have the latest context since it's applied to an older user message, unless I'm missing something?
In the meantime, I made a workaround that works well enough, although it's super hacky. It's a skill that runs a shell command with 2 methods:
sedto swap in a new session ID, appends a title entry, and copies the session directory. Pure filesystem operation — faster, no CLI needed, no extra messages injected.--cli) — Callsclaude --resume <id> --fork-sessionwith--model haiku --effort low --safe-modeand a throwaway prompt to create the fork through the official mechanism. Slower and adds a small prompt/response to the new session's history.In either case, it then opens a new VS Code panel with the forked chat session. Hacky, but it does effectively "fork from here".
SKILL.md
fork.sh
Isn't what you want the same as what /branch command in CLI version do? And yes, I do not find such functionality in VS Code extension version. Now sure why but I use /branch command often. It is appreciated to have this in VS code because I love GUI.
This keeps getting dismissed as "just hit esc twice" when this is a completely different thing. The request is not for rewinding and forking from rewound point. The request is FOR FORKING FROM ACTIVE SESSION, WITHOUT THE REWIND. Also worth noting that claude-cli does not fork when rewinding, while claude for vscode does. Behaviors across these products are extremely inconsistent, with horrendous nomenclature.
@orcinus-evc 100%! Didn't know all that about the inconsistent behavior, but I'm not surprised, lol.