The Codex Changelog
All Episodes
Codex CLI Adds Native Worktrees for Safer Agent Multitasking

Codex CLI Adds Native Worktrees for Safer Agent Multitasking

0:00|0:00

This episode breaks down new native git worktree support in Codex CLI 0.154.0, showing how agents can work in isolated checkouts without disturbing your main branch. It also covers non-blocking inline Q&A, Windows daemon parity, copy formatting improvements, and the release’s key breaking changes and concurrency cautions.


Chapter 1

Native Worktrees for Zero Switch Agent Workflows

Ethan Park

You know, if you have ever had an AI coding assistant running in your terminal, and... and it is halfway through refactoring a feature, and suddenly a production hotfix comes in... it is total chaos. You either have to stash your dirty working tree, or dirty the git state so bad the agent gets confused and breaks everything. Before we dive into how to fix that, a huge shoutout to Jellypod for helping make this daily show possible every single day. So, in the new OpenAI Codex CLI release, version zero point one hundred fifty four point zero, they added native git worktree support with the worktree flag and the slash worktree command.

Maya

Oh, this is huge! Because, um, previously, if you wanted an agent to work on two things at once, you were basically copying folders manually or, or praying that git stash wouldn't break your build context. Now, it literally provisions isolated git checkouts on demand.

Ethan Park

Right. So if you are in the terminal, you can run codex dash dash worktree fix auth bug, or if you are already inside the interactive interface, you just type slash worktree. And... and what actually happens under the hood when you hit enter?

Maya

So under the hood, git creates a completely separate directory attached to the same repository history, but with its own isolated working tree and index. Codex spins up your new session inside that clean directory. So your main working directory... where you might have three uncommitted files and a broken test... stays completely untouched.

Ethan Park

Wow. So if I am working on a complex UI rewrite in my main terminal, and I drop into a worktree session for a quick bug fix, the agent in the worktree cannot see or mess up my uncommitted draft files?

Maya

Exactly. And even better, you can browse, switch between, and resume those worktree sessions later. It keeps the full agent session history attached to that specific isolated directory context.

Ethan Park

Okay, but as someone who used to test messy edge cases, you know there have got to be operational risks here. What happens if an agent session crashes or gets hard killed while it is sitting inside one of these worktrees?

Maya

Yep, you hit the nail on the head. If you force kill the process or the terminal dies unexpectedly, git does not automatically clean up that temporary directory on disk. You can end up with orphaned worktrees taking up space. And... and here is the other tricky part... if two separate background agents are operating on worktrees tied to the exact same git repository, and they both try to run rebase or commit commands at the same time, you can trigger git index lock conflicts on shared reference histories.

Ethan Park

Ah, right, because they still share the underlying dot git folder, even though their working trees are separate.

Maya

Precisely. So it gives you isolated file editing, but you still have to be mindful if multiple background processes are trying to manipulate git history simultaneously.

Chapter 2

Non Blocking Inline Answers, Windows Daemons, and QoL Fixes

Maya

Now, the worktree stuff is only half the story for multitasking in version zero point one hundred fifty four point zero. They also solved another massive annoying bottleneck with inline user questions.

Ethan Park

You mean when the agent stops cold and waits for you to answer a clarification question?

Maya

Yes! It used to block the entire terminal execution pipeline until you responded. Now, Codex introduces non blocking inline Q and A. So while the background agent is grinding away on compilation or running tests, a terminal overlay prompts you with suggested choices or a custom text field. And... and the best part is, it does not wipe out or interrupt your active draft prompt buffer while you answer.

Ethan Park

Oh, that is so nice. So you can answer its quick question without losing whatever long instruction you were currently typing out into the composer.

Maya

Exactly. It just keeps working in the background without stealing your focus or resetting your draft state.

Ethan Park

Beyond that, there are some pretty major system level updates in this release too. Windows users finally get feature parity with the background server daemon using codex daemon, meaning Windows sessions can now share a persistent background server with managed lifecycle updates. Also, if you upgrade or rollback local plugins while a session is live, Codex rehydrates the tool skills and hooks automatically without forcing you to restart the whole app.

Maya

Oh, nice! And did I see something about copy formatting improvements too?

Ethan Park

Yeah, slash copy now preserves rich text formatting when pasting into rich text editors, or you can use it to target specific session fields directly. But... we should highlight a couple breaking changes and safety additions.

Maya

Right, like the deprecated entry point, codex mcp server... that is completely gone now, right?

Ethan Park

Gone completely. If you were still calling codex mcp server directly in your custom scripts, those will break until you update them. And there is a new concurrency safety lock. If you try to resume a session that is already open in another terminal or desktop window, Codex locks it into a read only transcript view with a retry prompt, so two windows cannot accidentally overwrite the same active conversation state.

Maya

When you combine isolated worktrees with non blocking prompts and background daemons, it really feels like Codex is shifting from a simple back and forth chatbot into a true concurrent workstation tool.

Ethan Park

Yeah, definitely. Alright, that is the quick breakdown for today. Talk to you all next time!