github / github/copilot-cli

Add /fork command to branch a session for side quests without derailing the main objective

オープン
#2,058 コメント 9 件 リアクション 10 件 担当者 0 名 GitHub で見る
area:sessions
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the feature or problem you'd like to solve

When Copilot CLI is pursuing a multi-step objective and the user asks a side question (e.g., "how does X work?" or "what's the right approach for Y?"), Copilot shifts its entire objective to answering that question, then stops with "Task Complete" -- losing all context of the original goal. Claude Code handles this well with its /fork command, which branches the session so side quests don't derail the main task. Copilot CLI has no equivalent, forcing users to either avoid side questions entirely or manually reconstruct session state by copying the session GUID folder.

### Proposed solution

Add a /fork command that creates a branched copy of the current session state (conversation history, plan, todos, working context) in a new terminal window/tab. The original session continues uninterrupted on its main objective, while the forked session can be used for side questions, exploratory research, or alternative approaches. This is analogous to git worktree for conversation context.

### Example prompts or workflows

1. Side question during implementation: User is mid-task ("refactor the auth module"). They want to ask "what's the difference between JWT and session tokens?" -- instead of derailing, they run /fork, ask in the fork, get the answer, close the fork, and the original session never lost its place.
2. Exploring alternative approaches: User is implementing Option A but wants to spike Option B. /fork lets them explore Option B in isolation. If it's better, they continue there; if not, they return to the original session.
3. Debugging a sub-problem: Main task is "add caching to the API layer." User hits a weird NuGet restore error. /fork to debug the restore issue separately, fix it, then the main session is still focused on caching.

### Additional context

This came up in internal discussion -- multiple engineers confirmed this is a pain point. The workaround today is manually copying ~/.copilot/session-state/ to a new folder and resuming in a new terminal, which works but is clunky. Claude Code's /fork is cited as prior art. Model behavior varies (Opus handles side quests better than GPT), but a proper fork mechanism would solve it architecturally regardless of model.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。