[BUG] Windows: auto-generated ~/.config/git/ignore uses backslash, making .claude/settings.local.json rule ineffective
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?
On Windows, Claude Code automatically creates ~/.config/git/ignore to globally exclude .claude/settings.local.json from Git. However, the pattern it writes uses a Windows-style backslash as the path separator:
**/.claude\settings.local.json
In gitignore syntax, path separators must be forward slashes. Backslash is treated as an escape character, not a path separator. As a result, the rule never matches and .claude/settings.local.json is NOT actually ignored on Windows. The same mechanism works correctly on macOS (which writes a forward slash).
What Should Happen?
Claude Code should write the pattern with a forward slash on all platforms:
**/.claude/settings.local.json
so that Git correctly ignores .claude/settings.local.json on Windows, matching the behavior on macOS and Linux.
Error Messages/Logs
Steps to Reproduce
Reproduced on my existing project; hex dump from my actual ~/.config/git/ignore attached above
Path:C:\Users\<username>\.config\git\ignore
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 2A 2A 2F 2E 63 6C 61 75 64 65 5C 73 65 74 74 69 **/.claude\setti
00000010 6E 67 73 2E 6C 6F 63 61 6C 2E 6A 73 6F 6E 0A ngs.local.json.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.98
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗