[BUG] ENOENT on mkdir of per-session tasks dir when running parallel Claude Code sessions
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?
Description
When running multiple Claude Code sessions in parallel as the same user, sessions intermittently crash with:
Error: ENOENT: no such file or directory, mkdir '/tmp/claude-999/-home-//tasks'
This did not happen with previous versions of Claude Code. The per-session tasks/ subdirectory layout appears to be new, and cleanup from
one exiting session seems to race with directory creation in a sibling session.
### Environment
- Claude Code version: 2.1.112 (Claude Code)
- OS: Linux 6.17.13-2-pve
- Shell: bash/zsh
- User UID: 999
- Running multiple
claudesessions concurrently in different working directories (and/or the same one)
What Should Happen?
Sessions should not interfere with each other's tmp directories. Cleanup of one session should not delete shared parents still in use by
others.
Error Messages/Logs
Error: ENOENT: no such file or directory, mkdir '/tmp/claude-999/-home-......
### Actual
Parent directory under `/tmp/claude-<uid>` is removed while a concurrent session needs it, causing the next `mkdir` to fail.
Steps to Reproduce
- Start 2–3
claudesessions in parallel in different terminals. - Let one session exit (normally or via timeout).
- Continue using or start another session shortly after.
- Observe ENOENT on
/tmp/claude-<uid>/.../tasks.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.112
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗