Cmd. /fork
Copy the conversation into a new background session.
Key takeaways
- Copy the conversation into a new background session.
- Check the input surface and availability before using the examples below.
Purpose
Copy the conversation into a new background session.
/fork [prompt]
/branch [name]
/subtask <task>Availability
| Field | Value |
|---|---|
| Input surface | Running CLI prompt |
| Kind | Built-in |
| Status | Current reference |
| Aliases | — |
| Documented minimum | Not specified |
| Reviewed against | 2026-09-22 · Claude Code 2.1.278 |
This guide describes Agent View behavior in v2.1.212+. With Agent View disabled, /subtask is unavailable and /fork retains the inherited-context subagent behavior.
Examples
/fork Investigate the flaky integration test in isolationEffects and persistence
/branch switches into a conversation branch; /fork creates a separate background session; /subtask returns its result to this conversation.
Choose where the result goes
| Command | Result |
|---|---|
/branch experiment | Switches into a new conversation branch; preserves the original |
/fork investigate the failing test | Starts a separate background session while this conversation continues |
/subtask inspect parser edge cases | Runs an inherited-context subagent and returns its result here |
Cautions
Branches and forks copy a point in the conversation; later messages are not synchronized automatically. Branch-local temporary approvals do not carry over.