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.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗