Preflight Checklist
What's Wrong?
When executing any Bash command in Claude Code CLI with sandbox mode enabled, a permission error appears before the actual command output:
zsh:1: operation not permitted: /tmp/claude-501/cwd-dd16
The error occurs on every Bash command execution. The underlying commands still work, but the error message is always present.j
What Should Happen?
Commands should execute without permission errors. The temporary directory operations in /tmp/claude-501/ should work seamlessly.
Error Messages/Logs
$ git status
zsh:1: operation not permitted: /tmp/claude-501/cwd-99da
On branch main
Your branch is up to date with 'origin/main'.
...
> The error consistently references `/tmp/claude-501/cwd-*` with varying suffixes (dd16, 99da, 860e, etc.).
Steps to Reproduce
- Install Claude Code CLI (
claude)
- Enable sandbox mode in
~/.claude/settings.json:
{
"sandbox": {
"autoAllowBashIfSandboxed": true,
"enabled": true
}
}
- Run
claude to start a session
- Execute any Bash command, for example:
- Observe the error message
zsh:1: operation not permitted: /tmp/claude-501/cwd-* appearing before the command output
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
2.1.21 (Claude Code)
Claude Code Version
2.1.23 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
- Using Claude Code CLI
- Sandbox mode enabled via
~/.claude/settings.json
- The error appears to be related to Claude Code's internal handling of temporary working directory files in sandbox mode
- The actual commands still execute successfully despite the error
- This may be related to sandbox mode's interaction with
/tmp directory operations on macOS
- The issue affects all Bash command executions, not just specific commands
Preflight Checklist
What's Wrong?
When executing any Bash command in Claude Code CLI with sandbox mode enabled, a permission error appears before the actual command output:
The error occurs on every Bash command execution. The underlying commands still work, but the error message is always present.j
What Should Happen?
Commands should execute without permission errors. The temporary directory operations in
/tmp/claude-501/should work seamlessly.Error Messages/Logs
Steps to Reproduce
claude)~/.claude/settings.json:{ "sandbox": { "autoAllowBashIfSandboxed": true, "enabled": true } }claudeto start a session/commit-commands:commitslash command (See: https://github.com/anthropics/claude-code/tree/main/plugins/commit-commands)git statuszsh:1: operation not permitted: /tmp/claude-501/cwd-*appearing before the command outputClaude Model
Opus
Is this a regression?
I don't know
Last Working Version
2.1.21 (Claude Code)
Claude Code Version
2.1.23 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
~/.claude/settings.json/tmpdirectory operations on macOS