Agent not waiting for setup-worktree script

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Agent using worktrees does not wait for the setup script to complete.
This leads to potential script executions and tool calls in an incomplete dev environment.

Steps to Reproduce

Create a worktree config file at ./.cursor/worktrees.json with the following contents:

{
  "setup-worktree": [
    "echo 'starting'",
    "sleep 10",
    "echo 'done!'"
  ]
}

In the Output bottom panel select Worktrees Setup and watch the logs when starting a new agent with any request in a git worktree. The script starts, but so does the agent.

Expected Behavior

When starting an agent in git worktree, wait for the setup script to complete.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.43 (Universal)
VSCode Version: 1.99.3
Commit: 8e4da76ad196925accaa169efcae28c45454cce0
Date: 2025-10-30T18:49:27.589Z (16 hrs ago)
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

Yes - Cursor is unusable

1 Like

hi @chris.in_action and welcome to Cursor Forum. Thank you for your bug report.

I have forwarded the details to our team for review.

1 Like