Skip to content

Conversation

@planger
Copy link
Contributor

@planger planger commented Nov 26, 2025

What it does

Add automatic session forking when users edit requests in Claude Code chat. This allows exploring alternative conversation paths while preserving the original conversation thread.

Implementation:

  • Add forkSession option to ClaudeCodeOptions interface
  • Add isEditRequest() helper to detect edited requests via referencedRequestId
  • Automatically fork sessions when editing requests with existing session IDs
  • Maintain backward compatibility: normal continuations use same session

The feature leverages Theia's existing chat hierarchy infrastructure where referencedRequestId is set when users edit requests. When both a previous session ID exists and the request is an edit, the Claude Agent SDK's forkSession option is enabled to create a new session branch.

Fixes #16502

How to test

Screencast.from.2025-11-26.22-13-11.mp4

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

Add automatic session forking when users edit requests in Claude Code chat.
This allows exploring alternative conversation paths while preserving the
original conversation thread.

Implementation:
- Add forkSession option to ClaudeCodeOptions interface
- Add isEditRequest() helper to detect edited requests via referencedRequestId
- Automatically fork sessions when editing requests with existing session IDs
- Maintain backward compatibility: normal continuations use same session

The feature leverages Theia's existing chat hierarchy infrastructure where
referencedRequestId is set when users edit requests. When both a previous
session ID exists and the request is an edit, the Claude Agent SDK's
forkSession option is enabled to create a new session branch.

Fixes #16502
@planger planger requested a review from sdirix November 26, 2025 21:15
@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Nov 26, 2025
@ndoschek ndoschek mentioned this pull request Dec 5, 2025
29 tasks
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great for me

@github-project-automation github-project-automation bot moved this from Waiting on reviewers to Needs merge in PR Backlog Dec 9, 2025
@planger planger merged commit fe7fe9a into master Dec 9, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Dec 9, 2025
@planger planger deleted the planger/issues/16502 branch December 9, 2025 09:59
@github-actions github-actions bot added this to the 1.67.0 milestone Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Editing messages doesn't resume at message but continue session

3 participants