[BUG] Persistent EACCES on Bash tool output dir (mkdir .../tasks) with two sessions in same project
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?
Two Claude Code sessions were running in the same project directory. Both sessions became unable to run any Bash tool call. Every call failed while trying to mkdir its per-invocation output directory, and the failure was persistent — it did not recover across retries over several minutes.
Removing the shared tmp tree fixed it, but sudo was required; plain rm -rf as the normal user was not enough:
sudo rm -rf /private/tmp/claude-<uid>
After removal, the next Bash call rebuilt a fresh valid path and worked normally.
What Should Happen?
Bash tool calls should keep working. Two sessions open in the same project should not be able to leave each other's (or their own) tmp output dir in an unusable state, and Claude Code should never end up needing sudo to recover its own tmp directory. If the tmp dir is not writable at startup, it should fail with a clear, actionable message instead of an opaque EACCES on every Bash call.
Error Messages/Logs
EACCES: permission denied, mkdir '/private/tmp/claude-<uid>/<project-slug>/<session-id>/tasks'
System-reminder that appeared in the tool result:
bash output unavailable: output file ... could not be read (EACCES). This usually means another Claude Code process in the same project deleted it during startup cleanup.
Steps to Reproduce
Not reliably reproducible. It occurred with two Claude Code sessions running in the same project directory at the same time. Attempts to force it afterward (opening two sessions, restarting one) did not reliably trigger it, so the exact timing/trigger is unknown. The conditions observed:
- Two Claude Code sessions open in the same project directory.
- Both sessions hit the persistent
EACCESonmkdir .../tasksfor every Bash call. - Recovery required
sudo rm -rf /private/tmp/claude-<uid>(plainrmwas not enough).
Is this a regression?
Unknown — first time observed; not enough history to say.
Claude Code Version
2.1.229
Platform / Operating System
macOS 26.6.1 (build 25G76)
Terminal/Shell
zsh
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗