[BUG] git commit fails inside sandbox on macos

Resolved 💬 6 comments Opened Jan 12, 2026 by petergeneric Closed Feb 19, 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?

When I enable sandbox and then CC tries to commit via "git commit" it fails with:

⏺ Bash(git add "path/to/file.ts" && git commit -m "some example commit message…)
  ⎿  Error: Exit code 1
     (eval):1: can't create temp file for here document: operation not permitted
     Aborting commit due to empty commit message.

I'm running the latest Claude Code on macOS; my shell is zsh

What Should Happen?

The sandbox should not fail this operation because of here document temp file creation

Error Messages/Logs

⏺ Bash(git add "path/to/file.ts" && git commit -m "some example commit message…)
  ⎿  Error: Exit code 1
     (eval):1: can't create temp file for here document: operation not permitted
     Aborting commit due to empty commit message.

Steps to Reproduce

  1. be using macos and zsh
  2. open claude code
  3. enable sandbox
  4. ask claude to commit
  5. observe failure - claude automatically retries (outside of the sandbox presumably?) and then succeeds, adding latency and presumably lots of tokens to the context

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.4

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

I have added /tmp to my workspace in case this is the problem, but it continues to fail...

View original on GitHub ↗

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