[Bug] Windows: Agent tasks frequently fail due to Worktree errors and unexpectedly stop

Bug description

Since updating to the latest version of Cursor on Windows, I frequently encounter two problems when using Agent:

  1. Worktree-related errors cause the Agent task to terminate
  2. Agent tasks sometimes stop unexpectedly without any clear error

This happens frequently enough to affect normal use of long-running Agent tasks.

Environment

  • OS: Windows 11
  • Cursor: Latest version
  • Git: Installed and working normally
  • Agent: Cursor Agent
  • Project: Local Git repository

Problem 1: Worktree error interrupts the Agent

During an Agent task, Cursor sometimes reports a Worktree-related error.

After the error occurs, the current Agent task is terminated/interrupted instead of recovering and continuing.

This is particularly problematic for long-running tasks because the Agent may have already:

  • Modified multiple files
  • Executed multiple terminal commands
  • Completed part of the requested implementation

After the Worktree error, the task stops and I have to manually ask the Agent to continue.

Expected behavior

A Worktree failure should ideally:

  • Provide a clear error message
  • Preserve the current Agent task state
  • Recover automatically when possible
  • Or fall back to the current workspace if safe

A Worktree failure should not cause the entire Agent task to unexpectedly terminate.

Problem 2: Agent randomly stops

There are also cases where the Agent stops in the middle of a task without an obvious error.

For example:

  1. Start a relatively long coding task.
  2. Agent begins modifying files and executing commands.
  3. Agent works normally for some time.
  4. The task suddenly stops.
  5. There is no clear explanation for why the task was terminated.
  6. I have to manually send another message such as “continue”.

This makes it difficult to rely on Cursor for long-running development tasks.

Reproduction

The issue is not 100% deterministic, but it occurs frequently during longer Agent sessions.

Typical scenario:

  • Windows 11
  • Local Git repository
  • Agent mode
  • Multiple file modifications
  • Multiple terminal/tool calls
  • Long-running task

The longer the task runs, the more likely I seem to encounter an interruption.

Expected behavior

Agent should continue executing the requested task until:

  • The task is completed;
  • User intervention is required;
  • A genuine unrecoverable error occurs; or
  • The Agent explicitly reports that it cannot continue.

If an internal Worktree operation fails, the Agent should not silently/automatically terminate the entire task.

Additional information

I can provide:

  • Screenshots of the Worktree errors
  • Cursor version/build number
  • Agent logs
  • Git configuration
  • Reproduction steps
  • Relevant diagnostic logs

if these would help investigate the issue.

Could the Cursor team confirm whether there are known Worktree/Agent stability issues on Windows in the latest release?

Hi there!

We detected that this may be a bug report, so we’ve moved your post to the Bug Reports category.

To help us investigate and fix this faster, could you edit your original post to include the details from the template below?

Bug Report Template - Click to expand

Where does the bug appear (feature/product)?

  • Editor, Tab & Chat (autocomplete, Composer, in-editor agent)
  • Terminal & commands
  • Models, pricing & API keys (availability, Auto/Max, BYOK/Bedrock)
  • MCP & tools
  • Cloud Agents & Automations (cursor.com/agents, scheduled/event)
  • BugBot & Code Review
  • Cursor CLI
  • Cursor Mobile
  • Remote (SSH / Dev Containers / WSL)
  • Account, billing & login
  • Something else…

Describe the Bug
A clear and concise description of what the bug is.


Steps to Reproduce
How can you reproduce this bug? We have a much better chance at fixing issues if we can reproduce them!


Expected Behavior
What is meant to happen here that isn’t working correctly?


Screenshots / Screen Recordings
If applicable, attach images or videos (.jpg, .png, .gif, .mp4, .mov)


Operating System

  • Windows 10/11
  • MacOS
  • Linux

Version Information

  • For Cursor IDE: Menu → About Cursor → Copy
  • For Cursor CLI: Run agent about in your terminal
IDE:
Version: 2.xx.x
VSCode Version: 1.105.1
Commit: ......

CLI:
CLI Version 2026.01.17-d239e66

For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)


For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…


Additional Information
Add any other context about the problem here.


Does this stop you from using Cursor?

  • Yes - Cursor is unusable
  • Sometimes - I can sometimes use Cursor
  • No - Cursor works, but with this issue

The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!

Hey @Sylvan

Both symptoms trace to the same thing: mid-task the agent creates its own git worktree (a folder under .worktrees\) and re-roots into it, which interrupts the running turn and sometimes can’t complete. It’s not your setup and not really Windows-specific - it’s an issue we’re tracking, and I’ve added your report to it.

For now:

  1. Start the agent in the folder where the work should happen, rather than letting it create a worktree and move into it mid-task.
  2. If a task stops, a quick “continue” resumes it - nothing is lost.

To confirm we’re on the exact case, could you share the full text of the worktree error (a screenshot works), and whether your rules/workflow tell the agent to create worktrees under .worktrees\ and switch into them?