Command reference Β· Codex CLI
/worktree
Runs the chat in a new Git worktree.
A worktree is a second working copy of the same repository β so the chatβs changes stay separate from your main branch.
β WHEN TO USE IT?
Let Codex work in isolation without touching the main branch
/worktree
β WHEN NOT TO?
The project is not a Git repository
a worktree requires Git.
Better: stay in the normal workspace
SOURCES
- Codex CLI docs: Slash Commands β developers.openai.com