Sandbox cwd tracking causes spurious exit code 1 and zsh warnings
Resolved 💬 3 comments Opened Jan 31, 2026 by therealbustermoon Closed Feb 4, 2026
Description
Bash commands succeed but return exit code 1 with spurious zsh warnings about sandbox temp directories.
Reproduction
Run any bash command in sandbox mode:
git status
git push
ls
Observed Behavior
Commands succeed but output includes:
Exit code 1
zsh:1: operation not permitted: /tmp/claude-501/cwd-XXXX
The /tmp/claude-501/cwd-* pattern appears to be Claude Code's internal working directory tracking. The sandbox blocks writes to this path, causing:
- A zsh warning on stderr
- Exit code 1 even when the actual command succeeds
Expected Behavior
- Commands that succeed should return exit code 0
- Internal cwd tracking should use sandbox-allowed paths (
/tmp/claude/is allowed per sandbox config)
Environment
- macOS Darwin 25.2.0
- Claude Code (latest)
- zsh shell
Impact
Low - commands work correctly, but the false errors cause confusion and noisy output.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗