Verified Codex
Isolate a task in its own git worktree with --worktree
What it does
--worktree starts in a fresh managed git worktree so your current checkout stays clean; works for interactive sessions, codex exec and forks (local only).
How
codex exec --worktree "Rewrite the utils module"
How much to trust this
| Applies to | ≥ 0.163.0 |
|---|---|
| Verified | Oct 17, 2026 · v0.163.0 · tested locally 本机 codex-cli 0.163.0 的 --help 中存在相关参数 |
| Depends on | --worktree |
| Source | https://developers.openai.com/codex/cli/reference (official_docs) |