github / github/copilot-cli

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

Đang mở
#2,058 9 bình luận 10 reaction 0 người được giao Xem trên GitHub
area:sessions
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.