Write/Edit tools fail with EEXIST on OneDrive directories (v2.1.69 regression)
Description
Starting with v2.1.69, the Write and Edit tools fail with EEXIST: file already exists, mkdir on any file whose parent directory is a OneDrive sync directory. This was working correctly in prior versions.
Environment
- Claude Code version: 2.1.69
- OS: Windows 11 Pro 10.0.26100
- Shell: bash (Git Bash)
- Working directory: OneDrive-synced folder (
C:\Users\<user>\OneDrive - <org>) - Previous working version: 2.1.68 (or earlier — the issue appeared on the day 2.1.69 was installed)
Reproduction
- Have a working directory inside a OneDrive-synced folder
- Read any file using the
Readtool (succeeds) - Attempt to
EditorWriteto that same file
Example:
Edit file: C:\Users\User\OneDrive - Org\.ai\GAPS.md
old_string: "last-updated: 2026-03-02"
new_string: "last-updated: 2026-03-04"
Error: EEXIST: file already exists, mkdir 'C:\Users\User\OneDrive - Org\.ai'
The error occurs for every subdirectory level — .ai/, .claude/hooks/, .claude/skills/self-improve/briefs/, and even the root OneDrive folder itself.
Root Cause
OneDrive Files On-Demand marks all directories with the ReparsePoint attribute (used for cloud file placeholders). PowerShell confirms:
.claude/hooks: ReparsePoint=True Attrs=ReadOnly, Directory, Archive, ReparsePoint
.ai/context: ReparsePoint=True Attrs=ReadOnly, Directory, Archive, ReparsePoint
The Write/Edit tools appear to run mkdir on parent directories before writing. When the parent directory exists but is a reparse point, mkdir throws EEXIST instead of recognizing the directory as already present.
Workaround
Writing files via Python through the Bash tool works correctly:
python -c "open(r'path\to\file.md', 'w').write(content)"
The filesystem itself is healthy — only the tool's directory-creation logic is affected.
Expected Behavior
Write/Edit should succeed on files in OneDrive-synced directories, as they did in v2.1.68 and earlier. The mkdir call should use mkdir -p equivalent logic (e.g., fs.mkdir(path, { recursive: true }) in Node.js) or check for directory existence before attempting creation.
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
+1, can confirm, specifically on OneDrive folders too.
I fixed this on Windows by rolling back to 2.1.68:
PWSH> & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.68
And added
"DISABLE_AUTOUPDATER": "1",to the env block in Claude's settings.json.This worked, thank you!
+1 here.
Update(tasks.md)
⎿ Error: EEXIST: file already exists, mkdir
Write(tasks.md)
⎿ Error: EEXIST: file already exists, mkdir
I also tested moving the folders to C:\, no One-Drive and it still gives the error
+1 — Claude tells me the Edit tool is trying to
mkdirthe parent directory instead of editing the file. Reverting to v2.1.68 fixed this.Wasted 1.5hrs on this this morning, thanks your fix worked!
I was using the VS Code extension, so what fixed it for me was clicking the dropdown next to the uninstall button on the Claude Code for VS Code Extension page, then selecting 2.1.68 and un-checking Auto Update.
<img width="392" height="148" alt="Image" src="https://github.com/user-attachments/assets/3b32430d-4b36-45a6-ac5c-d438350fef0b" />
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.