Write/Edit tools fail with EEXIST on OneDrive directories (v2.1.69 regression)

Status Fixed / completed
Reported on v2.1.69
Maintainer reply None cached
Activity 8 comments · opened Mar 5, 2026 · closed Mar 5, 2026

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

  1. Have a working directory inside a OneDrive-synced folder
  2. Read any file using the Read tool (succeeds)
  3. Attempt to Edit or Write to 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.

View original on GitHub ↗

8 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/30903
  2. https://github.com/anthropics/claude-code/issues/30923
  3. https://github.com/anthropics/claude-code/issues/30924

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

ReignOfComputer · 5 months ago

+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.

ttokttokttok · 5 months ago

This worked, thank you!

dandanmarcovici · 5 months ago

+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

labradoe · 5 months ago

+1 — Claude tells me the Edit tool is trying to mkdir the parent directory instead of editing the file. Reverting to v2.1.68 fixed this.

jackomak · 5 months ago
+1 — Claude tells me the Edit tool is trying to mkdir the 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!

mpurnell1 · 5 months ago
I fixed this on Windows by rolling back to 2.1.68: PWSH> & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.68

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" />

github-actions[bot] · 5 months ago

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.