[BUG] Claude fails to read settings.json and .mcp.json files because of UTF-8 BOM in the beginning
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?
Claude reports in /doctor that files are malformed jsons. However they are correct jsons and the only difference is BOM in the beginning. BOM is not visible to the user, so it will be a long time until they figure it out.
<img width="600" height="226" alt="Image" src="https://github.com/user-attachments/assets/c7f4b5d1-96b3-44b2-8a37-95ab946265e6" />
<img width="1224" height="861" alt="Image" src="https://github.com/user-attachments/assets/70019a2e-ef5b-4933-ac88-fc19c15b453e" />
<img width="1222" height="498" alt="Image" src="https://github.com/user-attachments/assets/0f8b394a-968a-4805-b85c-e0e767112f37" />
---
Other than that, I would add a note that json validation is really strict for those files. Please change your JSON parser.
Allow comments and trailing comas, because they also make JSON unreadable by claude code.
Comments are really useful to explain config when it is shared with team.
Trailing comas appear really often when I copy-paste parts of config, like some mcp servers.
What Should Happen?
settings.json and .mcp.json files should be read correctly
Error Messages/Logs
Steps to Reproduce
Create settings.json file manually from IDE. In my case it was JetBrains Rider. Paste valid config into the file. Check if /doctor complains that it is not a valid JSON.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.22
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗