Global gitignore write fails on Windows with EEXIST (mkdir targets existing home dir)
Status Open
Reported on v2.1.211
Maintainer reply None cached
Activity 0 comments · opened Jul 24, 2026
Environment
- Claude Code: 2.1.211 (native installer, auto-updated from 2.1.206)
- OS: Windows 11 Pro (10.0.26200)
Summary
On startup, adding an entry to the global gitignore fails with EEXIST because
Claude Code attempts to mkdir the parent path that already exists (the user's
home directory), instead of treating "already exists" as success or using a
recursive mkdir.
Error (from debug log)
[ERROR] Failed to add gitignore entry to global gitignore:
EEXIST: file already exists, mkdir 'C:\Users\<user>'
Expected
The global gitignore entry is written; an already-existing parent directory is
not an error.
Actual
The write throws EEXIST and the error flashes on every startup. Appeared after
the 2.1.206 -> 2.1.211 update.