Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Version 260203.1501 (523)
What subscription do you have?
ChatGPT Plus
What issue are you seeing?
In the Codex macOS app, when I use the UI flow to create a Git worktree, Codex always creates the worktree under a fixed default location:
/Users/{myuser}/.codex/worktrees/{worktreeid}/{MyProject}
There is no setting or UI option to choose/configure where the worktree should be created.
This is a major issue for workflows where the repo lives on an external/remote-mounted drive (e.g. SMB mounted volume). In my case, the repo lives here:
/Volumes/home/{MyProject}
Since the project is large and needs to run from the mounted volume, worktrees should ideally be created in the same volume (or at least a user-configurable directory). Instead, the worktree gets placed on the local machine under ~/.codex/worktrees/, which breaks the workflow.
What steps can reproduce the bug?
On macOS, open the Codex macOS app.
Open/import a Git repo located on a mounted volume, e.g.:
/Volumes/home/{MyProject}
In Codex, use the UI worktree creation flow to create a new worktree.
Observe that Codex creates the worktree in:
/Users/{myuser}/.codex/worktrees/{worktreeid}/{MyProject}
Confirm there is no setting to configure the worktree root/destination directory.
This occurs 100% of the time.
What is the expected behavior?
Codex should allow configuring the worktree destination directory / worktree root directory, e.g.:
Let the user choose a worktree root directory in Settings (global), and/or
Let the user choose the location during worktree creation (per-worktree)
For example, I should be able to configure worktrees to be created next to the repo on the mounted drive:
/Volumes/home/worktrees/...
Bonus:
- configure default paths per project
- default to placing worktrees near the repo if the repo is located on a mounted volume.
Additional information
No response
Activity
[-]Codex macOS app worktree UI always creates worktrees under ~/.codex/worktrees/... with no way to configure destination[/-][+]Way to configure location of worktrees[/+]gmetzker-4c commentedon Feb 13, 2026
Agreed this would be nice. I'm running into tooling issues when the parent directory is under a "dot" path. Would be nice to be able to pick your own path.
pyrefly-org/pyrefly#2402
iamsenseiken commentedon Mar 5, 2026
This is a significant problem.
itsadrianxv commentedon Mar 23, 2026
This is a significant problem not yet solved.
birtles commentedon Mar 26, 2026
Having this would also provide a workaround for #13762
richardwhatever commentedon Mar 26, 2026
come on guys. WSL users are a big and growing market.
datalogics-kam commentedon Mar 31, 2026
Codex should be following a standard like the XDG Base Directory Specification, and especially not mixing config and source code in the same directory root. If anything worktrees should go in a cache directory. It was really surprising to find that an automation to summarize work daily was copying source code outside of the source code work area without asking.
Ref: https://specifications.freedesktop.org/basedir/latest/
diogovalada commentedon Apr 19, 2026
I have the same issue...
Should be possible to place the worktrees folder in places like:
../<repo-folder-name>.worktreeskevinhorst commentedon Apr 19, 2026
Same issue here, I am getting frustrated trying to use Codex with worktrees.
As it is scoped to the sandbox environment, it is unable to commit by default, running into permission issues.
This completely breaks my workflow
MichaReiser commentedon May 8, 2026
A workaround for this feature is to create a symlink from
~/.codex/worktreesto your desired location. However, that's not a very obvious solution.Another motivation for this feature is that companies sometimes have specific directories that are excluded (or have less aggressive) antivirus scanning. Being able to move the worktrees into that directories can significantly help with performance (and battery life)
pessini commentedon May 24, 2026
+1 Would be great to have this.
frankie325 commentedon May 27, 2026
+1 it is significant to custom directory for worktrees
hyperlolo commentedon Jun 2, 2026
+1 absolutely need this especially for wsl environment, the default directory when set to work with wsl causes the agents to slow down by around 3-5x. Tested by using the same repo and sending the same simple prompt of checking git status for the repo on the app and in wsl terminal.
Terminal finished in 1min 34 seconds. App finished in 7minutes 8 seconds.
This makes the app useless if you want to work safely using worktrees
brendan-m-murphy commentedon Jun 8, 2026
Setting the env var
$CODEX_HOMEwill at least change the root where worktrees are created. I cannot stop codex from creating remote worktrees, which is also annoying.invoker-bot commentedon Jul 18, 2026
+1, we need this feature.
kevinhorst commentedon Jul 19, 2026
Come on codex. Poke
+1, still necessary
pablorxz commentedon Jul 22, 2026
Yep, same here
+1
paulkass commentedon Aug 20, 2026
Yes, please, this is a must-have!
JackD111 commentedon Aug 29, 2026
+1 my poor C drive already struggles to much
cwtuan commentedon Sep 10, 2026
A useful template needs to control directory layout, not only the worktree leaf name.
For example, Codex currently creates managed worktrees like:
~/.codex/worktrees/<opaque-id>/<repository-name>For people who work across many repositories, the inverse layout is much easier to browse and clean up:
~/.codex/worktrees/<repository-name>/<opaque-id>asiegelon1 commentedon Sep 10, 2026
I can't believe I'm telling OpenAI to copy Anthropic; you know something has gone sideways when that happens.
Just do it like Claude:
<PROJECT_ROOT>\.codex\worktrees\<WORK_TREE_NAME>How was this not the first implementation? @JackD111 's problem is the normal case, not the exception. And putting worktrees on a different drive introduces a whole separate class of filesystem behavior; cross-volume operations can become full copies instead of atomic moves, among other problems.
fedenunez commentedon Oct 6, 2026
Please! Fix this!