Skip to main content
reopt Handbook
reopt Handbook
Codex Command MasterLabels and command selectionHow to read a detail guideComplete command listTerminal CLI Commands and Options

Task guides

Core Command GroupSession Command GroupCustom Command GuideMCP Command and Integration GuideDesign Workflows

Conversation and context

Cmd. /archiveCmd. /copyCmd. /importCmd. /cd

Planning and execution

Cmd. /goalCmd. /app

Models and settings

Cmd. /model

Permissions and integrations

Cmd. /pluginsCmd. /hooksCmd. /mcp

Display and input

Cmd. /statuslineCmd. /tuiCmd. /worktreeCmd. /voice

Account and usage

Cmd. /usage

Verification and history

Current verification scopeHandbook updatesRelease coverage historyEarlier verification recordsCommand change history
Handbook›Codex Command Master›Cmd. /worktree
한국어KOEnglishEN

Cmd. /worktree

Run new or forked sessions in isolated Git checkouts, enabled by default from 0.156.0

Written and reviewed by Eric Han · Co-founder & CTO, reopt

Key takeaways

  • Run new or forked sessions in isolated Git checkouts, enabled by default from 0.156.0
  • Starting with /worktree or codex --worktree runs work in a separate checkout; from 0.162.0 Codex can create and list managed worktrees itself.

Purpose

Run new or forked sessions in isolated Git checkouts, enabled by default from 0.156.0

/worktree

Availability

FieldValue
Input surfaceRunning CLI prompt
KindBuilt-in
StatusCurrent reference
Aliases—
Documented minimumNot specified
Reviewed against2026-10-23 · Codex CLI 0.163.0
Release evidencev0.156.0

Added as an experimental feature in 0.154.0 and enabled by default from 0.156.0. Requires a Git repository; the agent command center can also create worktree sessions.

Examples

/worktree

/worktree and CLI --worktree provide worktree sessions, added as experimental in 0.154.0 and enabled by default from 0.156.0. Start new work or a fork in a separate checkout, then browse and resume that session.

codex --worktree

Check 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. From 0.156.0 the agent command center filters tasks by status and creates worktree sessions directly.

0.162.0 adds tools that let Codex create and list managed Git worktrees from trusted local projects when the worktrees feature is enabled. According to the pull-request description, the tools are create_worktree, get_worktree_creation_status, and list_worktrees, and a worktree is created asynchronously and attached to the requesting task. Without a ref, it starts from the repository's remote default branch. The task's working directory and uncommitted changes in the source checkout stay in place, and creation is rejected in ephemeral side conversations and untrusted projects.

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

Added as an experimental feature in 0.154.0 and enabled by default from 0.156.0. Requires a Git repository; the agent command center can also create worktree sessions.

Official sources

  • Changelog
  • Developer Commands
  • Rust V0.156.0
  • Rust V0.162.0

Complete command list · Verification scope · History for this command

Related docs

Multi-session Workflow

Claude Code Complete Guide · Run parallel Claude Code sessions with git worktrees and agent view without losing branch, context, or verification control.

Cmd. /batch

Claude Code Command Master · Parallelize a large change across worktree subagents (skill).

Cmd. /voice

Voice conversations, enabled by default from 0.156.0, with the F8 toggle and /voice settings

Handbook updates

Codex CLI: Recent handbook structure improvements with links to dated release coverage and audit records.

Thread Lifecycle

Advanced Codex Usage · Manage Codex sessions across start, resume, fork, compact, archive, delete, and handoff.

Cmd. /tui

Choose the fullscreen UI for your next launch; fullscreen transcripts are the default from 0.157.0.

Cmd. /voice

Voice conversations, enabled by default from 0.156.0, with the F8 toggle and /voice settings

On this page

PurposeAvailabilityExamplesEffects and persistenceCautionsOfficial sources