[BUG] Permissions error with git fsmonitor

Resolved 💬 4 comments Opened Mar 23, 2026 by dgilmanAIDENTIFIED Closed Apr 21, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The sandbox on macOS rejects access to git's fsmonitor UNIX domain socket in the .git directory. If it's safe to run git commands it's safe to access this thing. I investigated the same issue with codex, see the details here https://github.com/openai/codex/issues/14372

Sandbox mode is "Sandbox BashTool, with auto-allow", overrides is "Allow unsandboxed fallback"

What Should Happen?

Don't sandbox the fsmonitor socket and let git work

Error Messages/Logs

⏺ Bash(git diff HEAD -- my_file.py | head -80)
  ⎿  error: fsmonitor_ipc__send_query: unspecified error on '.git/fsmonitor--daemon.ipc'
     fatal: unable to create temp-file: No such file or directory

  Searched for 1 pattern (ctrl+o to expand)

⏺ Bash(git diff HEAD -- my_file.py 2>/dev/null | head -80)
  ⎿  (No output)

  Searched for 1 pattern (ctrl+o to expand)

⏺ Bash(git diff HEAD -- my_file.py 2>&1 | head -100)
  ⎿  (No output)

⏺ Bash(git diff -- my_file.py 2>&1 | head -120)
  ⎿  (No output)

⏺ Bash(git status -- my_file.py 2>&1)
  ⎿  error: fsmonitor_ipc__send_query: unspecified error on '.git/fsmonitor--daemon.ipc'
     On branch my-branch
     Changes not staged for commit:
     … +5 lines (ctrl+o to expand)

⏺ Bash(GIT_OPTIONAL_LOCKS=0 git diff my_file.py 2>/dev/null | head -120)
  ⎿  (No output)

⏺ Bash(GIT_OPTIONAL_LOCKS=0 git diff my_file.py)
  ⎿  Error: Exit code 128
     error: fsmonitor_ipc__send_query: unspecified error on '.git/fsmonitor--daemon.ipc'
     fatal: unable to create temp-file: No such file or directory

⏺ Bash(GIT_CONFIG_NOSYSTEM=1 git -c core.fsmonitor=false diff my_file.py 2>&1 | head -120)
  ⎿  (No output)

⏺ Bash(GIT_CONFIG_NOSYSTEM=1 git -c core.fsmonitor=false diff my_file.py 2>&1)
  ⎿  Error: Exit code 128
     fatal: unable to create temp-file: No such file or directory

⏺ Bash(GIT_CONFIG_NOSYSTEM=1 git -c core.fsmonitor=false show HEAD:my_file.py 2>&1 | head -120)
  ⎿  (No output)

⏺ Bash(TMPDIR=/private/tmp/claude-501 GIT_CONFIG_NOSYSTEM=1 git -c core.fsmonitor=false show HEAD:my_file.py 2>&1 | head -120)
  ⎿  (No output)

Steps to Reproduce

Repeated runs of git commands in the sandbox eventually triggers the block.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.80

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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