Skip to content

Build1 publisher2 min readPublished

Codex CLI's /fork clones the chat into a worktree session with a separate checkout

OpenAI's Codex CLI refresh, builds 0.156.0 to 0.160.0, pitches /fork as a separate checkout, but its command reference says /fork clones only the chat. Two agents on one repo need a worktree session, started from the new agent command center.

The Engineer · Build desk

Drafted by a language model from the sources cited here and checked against its claim ledger before publication. How we use AISend a correction

What happened

  • OpenAI's announcement pitches a full-screen terminal interface, better readability and "ways to manage parallel work" without leaving the terminal.
  • A new agent command center, called the /agents view in the announcement, lists sessions, filters them by status and starts worktree sessions.
  • Enter mid-turn injects instructions, Tab queues a follow-up for the next turn, and Escape twice on an empty composer edits the last message and forks from there.
  • Codex Workshop, citing OpenAI's worktree guide, says managed worktrees sit under $CODEX_HOME/worktrees on a detached HEAD.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • contradiction Teams that take the announcement's wording will expect /fork to isolate files; the command reference limits it to the chat, so the reference is the document to plan parallel runs against.
  • constraint Git's rule that a branch can be checked out in only one worktree at a time still applies, so two parallel agents cannot both work on the same checked-out branch.
  • cost An agent moved into a managed worktree starts without .env and other ignored files, so local secrets and config have to be copied in before it can run against them.

In Codex CLI, a separate checkout comes from a worktree session. The 0.156.0 notes say you start one from the agent command center, and worktree support is on by default [9]. The `/fork` command works on the conversation. According to OpenAI's command reference, it copies the current conversation into a new one with its own ID, and the original transcript is not modified [7].

The announcement, as relayed in press coverage, describes more. It says you can "/fork a conversation into a worktree with the same context and a separate checkout" [8]. The two documents agree only if the worktree comes from a step outside `/fork` itself [7][8]. Skip that step and let both threads keep writing to the same directory, and two agents are editing one working tree, according to the dev.to compile that set the documents side by side [10].

I think the on-by-default worktree is the right call. The compile describes the refreshed CLI as closer to a supervisor for several agent threads than the terminal chat loop it used to be [20]. Naming is the weak spot. The announcement calls the session list the `/agents` view, while the command reference sends you to `/agent` or `/subagents` for subagent threads [4][5]. For now the slash menu may be the most current document in the set: Codex Workshop's advice is to type `/` and check what your build actually offers [5].

The check before a second agent writes is two commands. Run `git worktree list` and confirm the second session has its own path. Then run `/status` inside each session and confirm the writable roots point at the path you expect [14]. For permissions, the docs suggest `codex --sandbox workspace-write --ask-for-approval on-request` for low-friction local work and warn against `--yolo` outside an isolated VM [16].

Version drift adds a second variable. The refresh spans five version numbers over nine days [23][21]. The September 29 announcement landed two days before 0.160.0 shipped on October 1 [22]. The compile's point is that the version you have decides what you see [17]. Pinning `@openai/codex@0.160.0` gets the October 1 build exactly [18]. `codex doctor --summary` checks install, config, auth, Git and terminal [19].

The evidence is a documentation gap. The dev.to post is an attributed compile. Its author restates OpenAI's changelog and command reference, says they did not run the new build, and labels the shell snippets adapted patterns from documented commands [15]. It does not report a reproduced case of two forked agents colliding in one tree [15].

What to watch

  • Whether OpenAI revises the announcement or the command reference so both describe /fork the same way.
  • A later build in which /fork opens a worktree session itself would bring the command in line with the announcement's wording.
  • A reproduced test of two forked Codex agents writing to one directory would show how the shared-tree case behaves in a real session.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories