[BUG] Persistent ENOENT mkdir error in local-agent-mode-sessions on Windows — non-recursive mkdir attempted with sibling .json file path

Resolved 💬 1 comment Opened May 17, 2026 by rabagoyevgeniy Closed Jun 16, 2026

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?

Persistent error toast ENOENT: no such file or directory, mkdir 'C:\Users\<user>\AppData\Roaming\Claude\local-agent-mode-sessions\<sessionId>\<subId>\local_<uuid>' appears every time a Cowork / Agent-mode task is started on Windows 11.

The error reappears with a NEW local_<uuid> on every single task submission, even after manually pre-creating the parent directory chain (mkdir -p local-agent-mode-sessions\<sessionId>\<subId>\).

After the manual fix, the app DOES successfully write local_<uuid>.json (a file) into the parent folder, but it then ALSO attempts a separate mkdir on a path with the same base name but no extension (local_<uuid> as a directory), which fails with ENOENT.

This looks like a non-recursive fs.mkdir(path) call where { recursive: true } is missing, combined with an unintended duplicate creation attempt (file vs. folder with the same UUID).

The error is non-blocking (the task still runs), but the toast appears on every action and clutters the UI.

What Should Happen?

The app should:

  1. Create the full directory chain automatically using fs.mkdir(..., { recursive: true }) before writing any session data.
  2. Not attempt to create both a local_<uuid>.json file and a local_<uuid> directory at the same level.
  3. Not display ENOENT toasts on a fresh install when starting an Agent-mode / Cowork task.

Error Messages/Logs

ENOENT: no such file or directory, mkdir 'C:\Users\ASUS\AppData\Roaming\Claude\local-agent-mode-sessions\8ea19d94-02e6-4299-9b9c-14fb9b5f572b\e52f12bd-a342-42a0-b75a-f33773aa42db\local_f7a884f2-cf9d-46a7-a003-b04a75f7aecb'

# Same error returns with a new UUID on the very next task,
# even though the parent directory chain has been manually created:

ENOENT: no such file or directory, mkdir 'C:\Users\ASUS\AppData\Roaming\Claude\local-agent-mode-sessions\8ea19d94-02e6-4299-9b9c-14fb9b5f572b\e52f12bd-a342-42a0-b75a-f33773aa42db\local_83262bb6-a1bc-4d01-8eaf-53a0fa5274ce'

# Filesystem state after the second error (parent chain pre-created manually):
# C:\Users\ASUS\AppData\Roaming\Claude\local-agent-mode-sessions\
# └── 8ea19d94-02e6-4299-9b9c-14fb9b5f572b\
#     └── e52f12bd-a342-42a0-b75a-f33773aa42db\
#         └── local_83262bb6-a1bc-4d01-8eaf-53a0fa5274ce.json   <-- written OK by app
#             (mkdir of local_83262bb6-a1bc-4d01-8eaf-53a0fa5274ce without .json fails)

Steps to Reproduce

  1. Fresh install of Claude Desktop on Windows 11 (no %APPDATA%\Claude\local-agent-mode-sessions\ directory present yet).
  2. Launch the app and open the Cowork tab.
  3. Create or open any task and submit any prompt (e.g., "say hi").
  4. Observe: a toast appears with:

ENOENT: no such file or directory, mkdir 'C:\Users\<user>\AppData\Roaming\Claude\local-agent-mode-sessions\<sessionId>\<subId>\local_<uuid>'

  1. Workaround attempt (without restarting the app):

In an admin PowerShell / Git Bash, run:
mkdir -p "C:\Users\<user>\AppData\Roaming\Claude\local-agent-mode-sessions\<sessionId>\<subId>"

  1. Submit a new prompt. The app writes local_<newUuid>.json into the folder successfully, but a fresh ENOENT toast still appears with the same template path and a new UUID.
  2. Restart Claude Desktop and repeat step 6 — same result on every task.

For comparison: the sibling directory %APPDATA%\Claude\claude-code-sessions\<sessionId>\<subId>\ (legacy / Code mode) stores only flat local_<uuid>.json files — no per-UUID subdirectories. The new local-agent-mode-sessions codepath appears to expect a folder alongside each JSON, which looks unintentional.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

N/A — this bug is in Claude Desktop (Electron app), not in the claude CLI. The claude --version command is unrelated to the Desktop app's Cowork/Agent-mode feature.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Important clarification: this bug is in Claude Desktop (the standalone Electron app on Windows), not in the claude Code CLI. Filing here because local-agent-mode-sessions strongly suggests the Agent SDK / claude-code engine is embedded in the Desktop app's Cowork feature, and the sibling folder %APPDATA%\Claude\claude-code-sessions\ confirms shared session storage.

Environment:

  • OS: Windows 11 Home 10.0.26200 (build 26200)
  • App: Claude Desktop (Cowork tab → Agent mode)
  • Feature affected: Cowork / Agent mode task submission
  • Working directory of session: arbitrary (E:\Projects\... in my case)

Likely root cause (guess based on observation):
The codepath that initializes a new Agent-mode session under
%APPDATA%\Claude\local-agent-mode-sessions\<sessionId>\<subId>\local_<uuid>
calls fs.mkdir (or equivalent) WITHOUT { recursive: true }. On a fresh install where the parent chain doesn't exist, the call fails with ENOENT. Even after the parents are created manually, a separate / duplicate mkdir call still fails because either:
(a) the path is normalized differently between the two call sites, or
(b) the app intends to create both local_<uuid>.json (file) and local_<uuid> (folder) at the same level, but only the file write succeeds while the folder mkdir errors out.

Suggested fix:

  • Use fs.mkdir(path, { recursive: true }) (or fs.promises.mkdir(..., { recursive: true })) for all directory creation under local-agent-mode-sessions\.
  • Audit whether the local_<uuid> directory creation is actually needed alongside local_<uuid>.json. The legacy claude-code-sessions\ codepath does not need it.

Severity: Non-blocking — task still completes — but the error toast is shown on every single user action which is severely degrading UX.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗