Cursor agent fail on non-main breanch of worktree

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

due to team workflow restructuring, most of the current work is in non-main branch.

when I run ‘hi’ in worktree/main, cursor doesn’t produce error. However, when I run ‘hi’ in worktree/non-main, cursor outputs "Connection failed. If the problem persists, please check your internet connection or VPN.
Request ID: 9dd274e5-2d95-4fb4-8551-848ebd3cd278
" and also output on the lower right coner of cursor screen saying “fail to create git worktree. fail to execute git.”

cursor agent cannot run git.

Steps to Reproduce

  1. run ‘hi’ in worktree/main. no problem
  2. run ‘hi’ in worktree/non-main. outputs "Connection failed. If the problem persists, please check your internet connection or VPN.
    Request ID: 9dd274e5-2d95-4fb4-8551-848ebd3cd278
    " and also output on the lower right coner of cursor screen saying “fail to create git worktree. fail to execute git.”

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.36 (system setup)
VSCode Version: 1.105.1
Commit: 55c9bc11e99cedd1fb93fbb7996abf779c583150
Date: 2025-12-18T06:25:21.733Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

all models

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report.

This issue could be caused by a few things. To help investigate, could you share:

  1. The Output panel logs (View > Output, select “Worktrees Setup” from the dropdown) - it may contain error details
  2. The result of running git worktree list in your terminal
  3. Whether there are any uncommitted changes in your repo
  4. Whether your project has a .cursor/worktrees.json file

Also, please try this temporary workaround:

  • Commit or stash all changes before starting the agent
  • Check that Git is installed and available in your shell (git --version)

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.