Skip to content

[Bug]: defaultThreadEnvMode "worktree" setting ignored — new threads don't create new worktrees #1989

@jameswasher

Description

@jameswasher

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web, apps/server

Related

Continuation of #1830, which was closed without an actual fix (the reporter found a manual workaround and self-closed).

Steps to reproduce

  1. Open Settings
  2. Under "Default thread mode", select "New worktree" (the setting labeled "New threads")
  3. Create a new thread
  4. Send a message

Expected behavior

Every new thread should automatically create a new, isolated git worktree — that's what the setting says it does. The label in settings literally says "New threads" with the option "New worktree." There should be no additional manual step required.

Actual behavior

Only the first thread gets a new worktree. Every subsequent new thread reuses the existing worktree instead of creating a fresh one. To actually get a new worktree, you have to:

  1. Create a new thread
  2. Manually change the selector at the bottom of the composer from "Current worktree" to "New worktree"
  3. Select "main" as the base branch

This defeats the entire purpose of the setting. If I have to manually select "New worktree" every single time I create a thread, the default setting is doing nothing.

Why this is a bug, not a feature request

The setting already exists. The UI already says "New threads → New worktree." It just doesn't work after the first thread. As analyzed in #1830, the prepareWorktree bootstrap payload is never sent for subsequent threads — the client sees an existing worktreePath and skips worktree creation instead of creating a new isolated one.

Impact

Major degradation or frequent failure

Version or commit

Latest (April 2026)

Environment

macOS, Claude Code provider

Workaround

Manually select "New worktree" from the composer dropdown every time you create a new thread — but this is exactly the workflow the setting is supposed to eliminate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions