[BUG] Bash tool reports exit code 1 due to permission denied on wrong temp folder
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?
Every bash command exits with code 1 due to this error appended to output:
zsh:1: permission denied: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/claude-xxxx-cwd
The folder /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000 is owned by root,
not the current user. Claude Code appears to be resolving the wrong per-user
temp directory slot and trying to write the cwd tracking file there.
The actual commands succeed — only the cwd file write fails, but it poisons
the exit code and makes it impossible to distinguish real failures.
macOS Darwin 24.6.0, shell: zsh
What Should Happen?
No error code.
Error Messages/Logs
Steps to Reproduce
I run eny prompt in claude. It succeeds but got this error1
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.78 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗