[BUG] /tmp/claude path collision on shared HPC/multi-user systems
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?
Claude Code hardcodes /tmp/claude/ for task management and background processes. On shared multi-user systems (HPC clusters, shared servers), the first user to run Claude creates this directory with default permissions (755). All subsequent users receive permission denied errors:
Error: EACCES: permission denied, mkdir '/tmp/claude/-global-home-users-username--claude/tasks'
This affects:
- The Task tool (agent subprocesses)
- Background tasks (run_in_background)
- Plugin installation
- Any operation that spawns child processes
Core functionality (Read, Write, Edit, Grep, Glob) still works, but agent-based workflows are broken.
What Should Happen?
Expected Behavior
Claude Code should either:
- Respect the TMPDIR environment variable for all temp directory operations
- Provide a configuration option (e.g., CLAUDE_TMPDIR or setting in settings.json)
- Use a user-specific temp path like /tmp/claude-$USER/ or $HOME/.claude/tmp/
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- User A runs Claude Code on a shared system → /tmp/claude created with permissions drwxr-xr-x owned by User A
- User B runs Claude Code on the same system → EACCES error because User B cannot write to /tmp/claude
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.2
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
PowerShell
Additional Information
Workarounds Attempted
- Setting TMPDIR environment variable → No effect, Claude ignores it
- Adding env vars to settings.local.json → No effect
- Manual directory creation → Cannot create inside /tmp/claude without permissions
Current Workaround
Contact system administrators to remove /tmp/claude so it can be recreated, but this is not sustainable on shared systems.
Additional Context
This is a common issue on:
- University HPC clusters
- Shared development servers
- Container environments with shared /tmp
- Any multi-tenant Linux system
Related issues: #14242, #10194, #11079
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗