In my opinion, one of Cursor’s biggest problems today is how it handles worktree and branch context for agents.
When I am working with a specific agent inside a specific worktree, that context should be explicitly preserved. Whether in the agent context itself or in the Git changes area, there should be something like a clear indicator or even a checkbox such as:
“This is the primary worktree for this agent.”
Because right now the workflow breaks like this:
I start working in a worktree.
I make a commit.
I open a PR.
I keep working with the same agent, on the same line of development.
I make another commit.
I update the PR.
And then suddenly Cursor starts working in another worktree for no clear reason.
The issue is that this other worktree often:
-
does not contain the code I was working on;
-
does not contain the real context of the task;
-
does not even contain the codebase related to the description of the work in progress.
So the agent completely loses continuity.
For people who use worktrees seriously as part of their development workflow, this is not a minor issue. It breaks context, productivity, and trust in the tool.
To me, this is one of Cursor’s most critical problems today:
the agent needs an explicit and persistent binding to the correct worktree/branch for as long as that line of work is active. In my opnion this is not a agent.md configuration or skill it is a cursor harness controlling it