[BUG] Edit/Write tool fails with EEXIST on OneDrive paths (Windows)

Resolved 💬 3 comments Opened Mar 9, 2026 by topkung1 Closed Mar 13, 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?

Edit and Write tools fail with EEXIST: file already exists, mkdir '<path>' when targeting files inside OneDrive-synced folders. The Read tool works fine on the same path. The tool internally calls mkdir on the parent directory before writing, which fails because the directory already exists.

What Should Happen?

Edit/Write tools should work normally on OneDrive paths. The mkdir call should use { recursive: true } or skip mkdir if the directory already exists.

Error Messages/Logs

EEXIST: file already exists, mkdir 'C:\Users\...\OneDrive\...'

Steps to Reproduce

  1. Have a file inside a OneDrive-synced folder on Windows
  2. Use Read tool on the file — works fine
  3. Use Edit tool on the same file — fails with EEXIST
  4. Write tool also fails with same error
  5. Pausing OneDrive sync does not fix it

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude for Windows 1.1.5749

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Tested 10+ times in single session. Both forward slashes and backslashes produce same error. Bug appeared after updating Claude Code.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗