Worktrees.json ignored in Cursor Agents/Glass UI

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The new UI automates worktree creation with agents, but doesn’t respect existing configurations and documentation at all.

When the Agents Window creates a local worktree for a single-model agent, the
.cursor/worktrees.json setup-worktree-unix runner is never invoked.
Cursor’s WorktreeManager performs the git worktree add and immediately
hands control to the agent — the worktree-setup runner code path does not
fire. The “Worktrees Setup” Output channel is not even created. As a result,
the agent starts working in a worktree with no project-specific dependency setup.

Same .cursor/worktrees.json runs correctly when invoked from the Editor
window via /worktree, so the config itself is valid.

This appears to be the macOS continuation of the previously reported (and
auto-closed) issue:
Wortrees setup doesn't run on single model wortree creation
…where @stern87 reported the same on macOS in March, with no fix landed.
It also matches @Colin’s reply in
Cursor 3: Worktrees & Best-of-N - #13 by Colin
(“Better support for worktrees in the Agents Window is coming soon”).

Steps to Reproduce

  1. Repo with .cursor/worktrees.json containing a setup-worktree-unix value
    that does something visibly heavy (e.g. installs deps, copies an env file,
    touches a marker). Example used in repro:
    {
    “setup-worktree-unix”: [“./agents/worktree/create-worktree.sh --setup-only”]
    }
  2. Open the repo in Cursor 3.1.15.
  3. Open the Agents Window (Cmd+Shift+P → Agents Window).
  4. Create a new agent → enable the “Worktree” setting → keep “Use multiple
    models” off → send a trivial prompt.
  5. After ~3s, switch to the worktree’s window. View → Output → channel
    dropdown.

Expected Behavior

  • The “Worktrees Setup” Output channel exists.
  • It contains [worktree-setup] checking config {...} followed by either a
    selected setup spec + started terminal session block, or a clear
    “skipping because ” line.
  • The setup commands actually run before the agent acts in the worktree.

Operating System

MacOS

Version Information

Version: 3.1.15
VSCode Version: 1.105.1
Commit: 3a67af7b780e0bfc8d32aefa96b8ff1cb8817f80
Date: 2026-04-15T01:46:06.515Z
Layout: glass
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report and for linking the prior threads.

This is a confirmed bug. The Agents Window’s worktree creation path was missing the step that reads and executes your .cursor/worktrees.json setup commands. A fix for this has already shipped.

You’re on 3.1.15, and the fix landed in 3.1.16. Updating Cursor should resolve this. After updating, when you create a new agent with the Worktree setting enabled, the “Worktrees Setup” Output channel should appear and your setup-worktree-unix commands should run before the agent starts.

You may also find this related thread helpful, where another user reported the same inconsistency: Inconsistent worktree setup between agent and editor windows

I’m on 3.1.17 now and the setup-worktree-unix commands are invoked correctly!

I don’t see any Output Channel in Agents/Glass UI though. But it’s usable :slight_smile: