Multiple CC sessions in same project collide on temp dir, deleting each other's output files
Problem
When multiple Claude Code sessions run in the same project directory (e.g. ~/), they share the same temp directory namespace under /tmp/claude-<uid>/<project-hash>/. Each session's startup cleanup can delete output files that another active session is currently writing to or reading from, causing ENOENT errors:
bash output unavailable: output file /tmp/claude-1001/-home-terry/.../tasks/xxx.output
could not be read (ENOENT). This usually means another Claude Code process in the
same project deleted it during startup cleanup.
Root cause
The temp dir is namespaced by <uid>/<project-path-hash>, so all sessions targeting the same project collide. Session identity is not part of the namespace.
Suggested fix
Namespace temp dirs by session ID (or process ID), not just project path. e.g.:
/tmp/claude-<uid>/<project-hash>/<session-id>/tasks/
This would allow multiple CC sessions to coexist on the same project without interference — a common scenario when running parallel agents, background tasks, or multiple terminal tabs.
Workaround
Currently the only workaround is running each CC session from a different working directory (e.g. git worktrees), which is heavy-handed for what's essentially a temp file namespacing issue.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗