Multi-agent copy from worktree

Describe the Bug

When using multiple models to plan I chose one to build. The build happens in the worktree. The agent tries to run tests, finds out it can’t, and copies the files from the worktree into the main repo. It does not do any confirmation. It just copies. Later one, it tries to copy something inside the main repo and asks for approval to use cp because I don’t have it as an allowed command.

Steps to Reproduce

  1. Do a plan with multiple agents with ‘run tests’ as the last step
  2. Build the plan

Expected Behavior

Not to copy without confirming since it’s not an approved command

Operating System

MacOS

Version Information

Version: 2.4.27
VSCode Version: 1.105.1
Commit: 4f2b772756b8f609e1354b3063de282ccbe7a690
Date: 2026-01-31T21:24:58.143Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.2.0

For AI issues: which model did you use?

Opus 4.5

For AI issues: add Request ID with privacy disabled

Request ID: 30e8aa0f-c5de-4701-99c0-0a5ea91b9613

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is a known issue with worktrees. The agent sometimes switches to the main repo instead of staying in the worktree, and it can bypass the command confirmation system.

The team is aware of the bug. Your Request ID will help with debugging.

For now, the workaround is to keep an eye on which directory the agent is working in, and stop it if it starts copying into the main repo. Not ideal, but that’s what we have for now.

Let me know if you notice anything else.