[BUG] git commit fails inside sandbox on macos

Status Fixed / completed
Reported on v2.1.4
Maintainer reply None cached
Activity 6 comments · opened Jan 12, 2026 · 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 ↗

6 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/13583
  2. https://github.com/anthropics/claude-code/issues/2943
  3. https://github.com/anthropics/claude-code/issues/16462

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

petergeneric · 7 months ago

This is not a duplicate of #13583 but that issue shows a serious security issue of Claude ignoring its config...

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

petergeneric · 6 months ago

Still not fixed, still screaming into the void like all other issues in this repo. Please keep it open in the vain hope that Anthropic will look at issues in this repo one day

petergeneric · 6 months ago

Allegedly fixed by #25990

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.