Skip to content

[BUG] ENOENT on mkdir of per-session tasks dir when running parallel Claude Code sessions #49512

Description

@ekatchour

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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 claude sessions 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

  1. Start 2–3 claude sessions in parallel in different terminals.
  2. Let one session exit (normally or via timeout).
  3. Continue using or start another session shortly after.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on LinuxregressionstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions