[Bug] Sandbox blocks git operations in worktree directories

Resolved 💬 3 comments Opened Mar 12, 2026 by danielorbach Closed Mar 16, 2026

Bug Description
Sandbox blocks git operations in entered worktree.

  • What's Wrong?: After entering a worktree via EnterWorktree, git add fails with "fatal: Unable to create"

.git/worktrees/<name>/index.lock: Operation not permitted. The sandbox allowlist includes the worktree directory but not
.git/worktrees/<name>/, which git needs for index locks and refs.

  • What Should Happen?: EnterWorktree should add .git/worktrees/<name>/ to the sandbox write allowlist so git operations work without disabling the sandbox.
  • Error Messages: "fatal: Unable to create '/path/to/repo/.git/worktrees/bug-test/index.lock': Operation not permitted"
  • Steps to Reproduce:
  1. Start a conversation in a git repository
  2. Enter a worktree via EnterWorktree
  3. Create or modify a file
  4. Run git add <file> — fails with "Operation not permitted"
  • Additional: Related to #28248 (permission scoping in worktrees) but distinct — that issue is about display, this is about the sandbox

write allowlist missing the .git/worktrees/ path.

Environment Info

  • Platform: darwin
  • Terminal: WarpTerminal
  • Version: 2.1.74
  • Feedback ID: 713dffd2-8e54-423e-a2e4-6f47bf9506aa

Errors

[{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:03:41.001Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:03:41.064Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:03:42.518Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:04:09.778Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:04:14.540Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:04:18.208Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:04:42.086Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:10023)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-12T15:06:02.018Z"},{"error":"Error\n    at CI (/$bunfs/root/src/entrypoints/cli.js:74:1144)\n    at <anonymous> (/$bunfs/root/src/en…

Note: Content was truncated.

Workaround

Exit the session, and --resume it.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗