Feature request: add new config for default thread mode (Local, Worktree or Cloud)
Resolved 💬 1 comment Opened Mar 2, 2026 by caiofbpa Closed May 16, 2026
What variant of Codex are you using?
App (macOS), via app-server-backed threads.
What feature would you like to see?
A persistent config default so every newly created thread starts in either local, worktree or cloud mode automatically (without needing an explicit per-thread setting each time).
Today, I have to remember to set thread mode to Worktree explicitly at the start of each session/thread. I often forget, and then edits run in the main checkout.
Proposed behavior:
- Honor a config key (for example
default_thread_mode = "worktree") for all newly created threads. - Precedence should be:
- explicit per-thread override (if provided)
default_thread_modefrom config- current default behavior (
local)
- For
worktreemode:
- if
cwdis inside a git repo, create a detached git worktree for the new thread and use that as threadcwd - if
cwdis not in a git repo, fall back to localcwd(non-fatal)
- Surface the resolved thread
cwdin existing thread metadata/response so clients can render it.
Why this helps:
- avoids accidental edits in the main checkout
- makes branch/worktree-isolated development the safe default
- removes repetitive setup friction on every new thread
Additional information
Repro (current behavior):
- Set
default_thread_mode = "worktree"in config. - Start a new thread from a git repo in the app.
- Observe new thread still uses repo root
cwdinstead of a dedicated worktree path.
Acceptance criteria:
- New threads default to worktree mode when configured.
- Explicit per-thread mode still overrides config default.
- Non-git paths degrade gracefully to local mode.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗