Sandboxing blocks access to the .git file of a git worktree

Where does the bug appear (feature/product)?

Cursor IDE & Cursor CLI

Describe the Bug

When in a worktree, the sandbox incorrectly blocks reading of the .git worktree pointer file. It should allow read access to it. Without that all git operations in a worktree fail under sandbox.

Steps to Reproduce

  1. Create a git worktree from a git repository
  2. Open Cursor IDE/CLI with sandboxing enabled in the new worktree
  3. Instruct the agent to e.g. run git log - it is unable to do so, running the command fails in the sandbox
  4. Even trying to run cat .git fails

The chain of failure

  1. Git opens .git (the worktree pointer file) to learn where the real repo is
  2. Sandbox blocks this read (EACCES)
  3. Git dies immediately — it never gets to discover the gitdir path
  4. All git commands fail in the sandbox

Expected Behavior

The agent should be able to run cat .git just fine when in a worktree and under sandbox.

Subsequently, any git command should succeed (after adding the “full repo” path to additionalReadwritePaths)

Operating System

Linux

Version Information

Version: 2.6.12
VSCode Version: 1.105.1
Commit: 1917e900a0c4b0111dc7975777cfff60853059d0
Date: 2026-03-04T21:41:18.914Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.1.0

(remote development, ssh’d to a linux machine)
About Cursor CLI - on the remote machine:

CLI Version 2026.02.27-e7d2ef6
Model Claude 4.6 Opus
OS linux (x64)
Terminal unknown
Shell bash

Additional Information

This seems to be a sandboxing issue - happens both in IDE and CLI.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Instructing the agent to run stat .git under the sandbox gives:

  File: .git
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: f7h/247d	Inode: 2           Links: 1
Access: (0000/----------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2026-03-06 18:03:07.378678129 +0100
Modify: 2026-03-06 18:03:07.378678129 +0100
Change: 2026-03-06 18:03:07.378678129 +0100
 Birth: 2026-03-06 18:03:07.378678129 +0100

Hi Matej!

Thanks for the excellent file report. I’ve filed this with the team.

Unfortunately, I think the only workaround at the moment is to not use the sandbox.

How does one disable the sandbox?

@mikej96 In the IDE, go to Cursor Settings > Agents > Auto-Run Mode and set it to Ask Every Time or Run Everything.

With the Cursor CLI, type /sandbox to enable or disable it.

1 Like