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:

  1. Honor a config key (for example default_thread_mode = "worktree") for all newly created threads.
  2. Precedence should be:
  • explicit per-thread override (if provided)
  • default_thread_mode from config
  • current default behavior (local)
  1. For worktree mode:
  • if cwd is inside a git repo, create a detached git worktree for the new thread and use that as thread cwd
  • if cwd is not in a git repo, fall back to local cwd (non-fatal)
  1. Surface the resolved thread cwd in 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):

  1. Set default_thread_mode = "worktree" in config.
  2. Start a new thread from a git repo in the app.
  3. Observe new thread still uses repo root cwd instead 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗