Skip to content

Way to configure location of worktrees #10599

Open

Description

@adnanjpg

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:

  1. configure default paths per project
  2. default to placing worktrees near the repo if the repo is located on a mounted volume.

Additional information

No response

Activity

  1. added
    app
    on Feb 4, 2026
  2. added
    enhancement
    on Feb 4, 2026
  3. changed the title [-]Codex macOS app worktree UI always creates worktrees under ~/.codex/worktrees/... with no way to configure destination[/-] [+]Way to configure location of worktrees[/+] on Feb 4, 2026
  4. gmetzker-4c commented on Feb 13, 2026

    @gmetzker-4c

    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

  5. iamsenseiken commented on Mar 5, 2026

    @iamsenseiken

    This is a significant problem.

  6. itsadrianxv commented on Mar 23, 2026

    @itsadrianxv

    This is a significant problem not yet solved.

  7. birtles commented on Mar 26, 2026

    @birtles

    Having this would also provide a workaround for #13762

  8. richardwhatever commented on Mar 26, 2026

    @richardwhatever

    come on guys. WSL users are a big and growing market.

  9. datalogics-kam commented on Mar 31, 2026

    @datalogics-kam

    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/

  10. diogovalada commented on Apr 19, 2026

    @diogovalada

    I have the same issue...
    Should be possible to place the worktrees folder in places like:
    ../<repo-folder-name>.worktrees

  11. kevinhorst commented on Apr 19, 2026

    @kevinhorst

    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

  12. MichaReiser commented on May 8, 2026

    @MichaReiser

    A workaround for this feature is to create a symlink from ~/.codex/worktrees to 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)

  13. pessini commented on May 24, 2026

    @pessini

    +1 Would be great to have this.

  14. frankie325 commented on May 27, 2026

    @frankie325

    +1 it is significant to custom directory for worktrees

  15. hyperlolo commented on Jun 2, 2026

    @hyperlolo

    +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

  16. brendan-m-murphy commented on Jun 8, 2026

    @brendan-m-murphy

    Setting the env var $CODEX_HOME will at least change the root where worktrees are created. I cannot stop codex from creating remote worktrees, which is also annoying.

  17. invoker-bot commented on Jul 18, 2026

    @invoker-bot

    +1, we need this feature.

  18. kevinhorst commented on Jul 19, 2026

    @kevinhorst

    Come on codex. Poke
    +1, still necessary

  19. pablorxz commented on Jul 22, 2026

    @pablorxz

    Yep, same here
    +1

  20. paulkass commented on Aug 20, 2026

    @paulkass

    Yes, please, this is a must-have!

  21. JackD111 commented on Aug 29, 2026

    @JackD111

    +1 my poor C drive already struggles to much

  22. cwtuan commented on Sep 10, 2026

    @cwtuan

    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>

  23. asiegelon1 commented on Sep 10, 2026

    @asiegelon1

    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.

  24. fedenunez commented on Oct 6, 2026

    @fedenunez

    Please! Fix this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions