[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
- be using macos and zsh
- open claude code
- enable sandbox
- ask claude to commit
- 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...
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is not a duplicate of #13583 but that issue shows a serious security issue of Claude ignoring its config...
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.
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
Allegedly fixed by #25990
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.