Cmd. /worktree
Run new or forked sessions in isolated Git checkouts
Key takeaways
- Run new or forked sessions in isolated Git checkouts
- Check the input surface and availability before using the examples below.
Purpose
Run new or forked sessions in isolated Git checkouts
/worktreeAvailability
| Field | Value |
|---|---|
| Input surface | Running CLI prompt |
| Kind | Built-in |
| Status | Experimental |
| Aliases | — |
| Documented minimum | Not specified |
| Reviewed against | 2026-09-22 · Codex CLI 0.155.1 |
| Release evidence | v0.154.0 |
Experimental feature evidenced in 0.154.0. Requires a Git repository and supported build; the CLI also offers --worktree.
Examples
/experimental
/worktree/worktree and CLI --worktree provide experimental worktree sessions. Start new work or a fork in a separate checkout, then browse and resume that session.
codex --worktreeCheck the branch and checkout path when entering isolated work. In 0.155.0 the agents view shows worktree ownership and asks for confirmation before deleting clean managed worktrees. Archiving a conversation and deleting its worktree are separate operations.
See thread lifecycle for the wider workflow.
Effects and persistence
Starts or forks work in a separate Git worktree. Check the new checkout's path and branch.
Cautions
Experimental feature evidenced in 0.154.0. Requires a Git repository and supported build; the CLI also offers --worktree.
Official sources
Complete command list · Verification scope · History for this command