Skip to content

Native git worktree Support for Concurrent/Parallel Agent Execution #1476

@danwild

Description

@danwild

Problem

Currently, SpecKit operates on the shared local repository state (checking out branches, modifying HEAD).

This makes it problematic to run multiple SpecKit agents concurrently (e.g., in separate Cursor AI terminals or tabs) without race conditions.

If Agent A switches branches while Agent B is writing files, the file system state becomes corrupted, or git lock errors occur.

Proposed solution

I suggest that SpecKit should support an "isolation mode" leveraging Git Worktrees.

Ideally, a flag or configuration option (e.g., --isolate or --worktree) would:

  1. Create a temporary git worktree for the specific task/plan (e.g., .worktrees/task-id).
  2. Execute the SpecKit plan within that isolated directory.
  3. Clean up/remove the worktree directory once the task is complete (or upon a specific exit command).

Alternatives

  • Cursor Cloud Agents / Native Parallel Mode: Cursor's native "Composer" and "Cloud Agents" already handle this by automatically spinning up isolated environments (remote VMs or local worktrees) for each task.
  • Multiple Clones: Cloning the repo multiple times consumes excessive disk space (duplicate node_modules, etc.).
  • Manual Worktrees: Manually creating worktrees works, but requires significant boilerplate setup before running SpecKit.

Loosely related to: #232 #841

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