Command reference ยท Codex CLI
/fork
Branches the current session into a new, independent copy.
/fork is part of the official list of interactive slash commands and serves the same purpose as the CLI subcommand of the same name, which belongs to session management alongside archive/unarchive/delete. It lets you use the session history so far as the starting point for a new, separate session.
โ WHEN TO USE IT?
Try two different approaches from the same starting point
/fork โ branch off from the current session state to test an alternative approach without altering the original session
Test a risky next step in isolation
/fork โ create a copy of the session before a larger change
โ WHEN NOT TO?
There should only be a single, linear session
/fork creates an additional, separate session copy, which is unnecessary overhead here.
Better: Simply keep working in the existing session
SOURCES
- Codex CLI Doku: Slash Commands โ developers.openai.com