feat: fork session (Ctrl+Shift+K) - #34
Merged
Merged
Conversation
added 2 commits
August 11, 2026 21:45
… restore forks - Replace the 'Show Diff' row button with a Fork button (^⇧K / Ctrl+Shift+K) - Fork button sends /fork to the Claude terminal; GFileMonitor on ~/.claude/projects/<encoded-cwd>/ detects the new .jsonl and spawns claude --resume <uuid> as a child session with its own VTE - Fork sessions are indented under their parent in the sidebar, selectable, and have their own terminal/stack entry (unlike robots) - sessions.txt gains a 4th pipe field (fork_parent_dir) so forks survive restart; two-pass startup restores parent→fork hierarchy - Clicking a recent directory also restores any saved forks for that dir - app.show-diff (Ctrl+Shift+D) remains accessible; not shown in shortcut bar
Replace GFileMonitor/polling detection with direct lookup: find the most-recently-modified .jsonl in the parent's claude projects dir and spawn `claude --resume <uuid>`, giving the fork the full conversation history. Drop the dead on_diff_btn_clicked handler from sidebar.c.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ctrl+Shift+K) sends/forkto the current Claude terminal, then watches~/.claude/projects/<encoded-cwd>/viaGFileMonitorfor the new.jsonlthat Claude createsclaude --resume <uuid>as a child session with its own VTE, stack entry, and selectable sidebar row — indented under the parentsessions.txtwith a 4th pipe field (fork_parent_dir) and restored on startup via a two-pass loadapp.show-diff(Ctrl+Shift+D) remains accessible; shortcut bar updated from^⇧D Diff→^⇧K ForkCloses #10
Test plan
nix buildsucceedsCtrl+Shift+Kon selected session triggers forkCtrl+Shift+Dopens the diff view