[BUG] v2.1.69 Edit tool fails with EEXIST error on paths containing spaces (OneDrive directories)

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

## Bug

The Edit tool fails with EEXIST: file already exists, mkdir when editing files in directories with spaces in the path (e.g., OneDrive synced folders).

## Expected behavior

Edit should handle existing directories with spaces in the path without attempting to re-create them.

## Workaround

Using sed via the Bash tool works. The issue is specific to the Edit tool's internal mkdir call.

## Notes

  • This was working in previous versions — appears to be a recent regression
  • The error consistently occurs regardless of forward-slash vs backslash path format
  • MCP connectors were disabled to rule out interference — same result

What Should Happen?

Files should edit with write tool.

Error Messages/Logs

EEXIST: file already exists, mkdir 'C:\Users<user>\OneDrive - <project><subdir>'

Steps to Reproduce

## Reproduction

  • Platform: Windows 11, Claude Code latest
  • Working directory: C:\Users\<user>\OneDrive - <org>\<project>\
  • Any Edit tool call targeting a file in this path fails with:

EEXIST: file already exists, mkdir 'C:\Users<user>\OneDrive - <project><subdir>'

  • The Read tool works fine on the same paths
  • The Write tool has not been tested

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

v2.1.68 probably

Claude Code Version

v2.1.69

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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