Skip to content

Subagent-driven development should not auto-create worktrees without user consent #991

@wesm

Description

@wesm

Problem

The subagent-driven-development skill currently auto-creates a git worktree when starting implementation, without asking the user first. If you're on main and ask for a spec to be implemented, the work gets silently redirected to a worktree branch — which is surprising and forces a git workflow the user didn't opt into.

This also creates cleanup burden: the worktree and its branch persist after the session unless the user explicitly removes them, even after the work has been merged back.

Observed behavior

  1. User asks to implement a plan
  2. subagent-driven-development skill invokes EnterWorktree without asking
  3. All work happens in an isolated worktree
  4. User has to discover and clean up the worktree afterward
  5. If work was already merged to main (e.g., via --ff-only), the worktree is redundant but still sitting on disk

Expected behavior

Worktree creation should be opt-in, not automatic. The skill should prompt the user before creating a worktree, similar to how it offers a choice between inline and subagent-driven execution.

Suggested flow:

"Plan ready. Before I start implementing:

  1. Execution: Subagent-driven (recommended) or inline?
  2. Isolation: Create a worktree for this work, or work in the current branch?"

If the user has set a preference (e.g., in settings or CLAUDE.md), respect it without asking.

Context

Filed at Jesse Vincent's request after discussion about this behavior. Jesse agrees this should prompt rather than auto-create.

cc @obra

Metadata

Metadata

Assignees

No one assigned

    Labels

    subagentsSubagent-driven development and dispatchworktreesGit worktree management

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions