claude-code - 💡(How to fix) Fix [BUG] Persistent ENOENT mkdir error in local-agent-mode-sessions on Windows — non-recursive mkdir attempted with sibling .json file path

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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>\). The error is non-blocking (the task still runs), but the toast appears on every action and clutters the UI.

Error Messages/Logs

Same error returns with a new UUID on the very next task,

Filesystem state after the second error (parent chain pre-created manually):

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

Root Cause

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.

Fix Action

Fix / Workaround

  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>'
  5. 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>"
  6. 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.
  7. Restart Claude Desktop and repeat step 6 — same result on every task.

Code Example

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)
RAW_BUFFERClick to expand / collapse

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?

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>'
  5. 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>"
  6. 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.
  7. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING