claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Global MCP config in ~./claude.json empties routinely

Open beyondoscar opened this issue 7 months ago • 2 comments

Environment

  • Claude CLI version: 1.0.21 (Claude Code)
  • Operating System: Ubuntu 24.04.2 LTS (Noble Numbat)
  • Terminal: Gnome Terminal

Bug Description

MCP server config prop in ~/.claude.json resetting routinely today, once was after update but it's happening frequently since.

Steps to Reproduce

reopen claude code

Expected Behavior

Claude code launches with normal config.

Actual Behavior

be prompted for spending mode and warned about prompt injection again (?). mcpServers: {} in ~/.claude.json

note: There is no documentation about .claude.json vs .claude/settings.json that I can find however it will never read an mcp config from settings.json currently.

beyondoscar avatar Jun 12 '25 03:06 beyondoscar

Take a look here, if your config file doesn’t parse (even due to a comment), it gets wiped

https://github.com/anthropics/claude-code/issues/1788#issuecomment-2986123456

mculp avatar Jun 19 '25 00:06 mculp

I don't get any configuration errors / if my claude config changes beyond me constantly re-adding my mcp server object it's claude itself doing it. Am still encountering this issue fwiw (albeit less often). It's also not wiping my projects just my global mcp config.

beyondoscar avatar Jun 27 '25 01:06 beyondoscar

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 03 '25 10:12 github-actions[bot]