codex fork
The CLI subcommand to fork a saved session (picker by default; --last to fork the most recent).
Specs
Verified:
- Kind
- CLI subcommand (TUI launch)
- Syntax
- codex fork [--last]
- First seen
- —unverified
The official help for `codex fork` reads "Fork a previous interactive session (picker by default; use --last to fork the most recent)". It pairs with the in-TUI `/fork` as the two entry points; since 0.166.0 it preserves approvals, permissions, and reasoning-token accounting (#57227/#57839). First-seen version is unverified.
Timeline
- 0.166.0: resume/fork preserve approvals, permissions, and reasoning-token accounting (#57227/#57839)
Key features
- Fork a variant from a saved session
- Approvals/permissions preserved since 0.166.0
Use cases
Branch two explorations from the same history — A/B approach comparison.
Install
`codex fork` opens the picker; `codex fork --last` forks the most recent session.
Caveats
Fork branches; it does not resume — use `codex resume` to continue the original.
Added
Updated
Verified