[BUG] "Reset to default" on invalid settings.json overwrites the file without creating a backup
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?
When settings.json contains a JSON syntax error, Claude Code detects it on
startup and prompts the user to either reset to default or edit manually.
Choosing "Reset to default" immediately overwrites the file with no backup,
permanently destroying all configuration (hooks, permissions, MCP servers,
env vars, etc.).
What Should Happen?
Before overwriting, Claude Code should create a timestamped backup (e.g.~/.claude/backups/settings.json.<timestamp>) and inform the user of its
location — consistent with how it already handles .claude.json corruption
via the existing ~/.claude/backups/ mechanism. Only then should it apply
the default.
Error Messages/Logs
none — the overwrite happens silently with no error output
Steps to Reproduce
Steps to Reproduce
- Have a
~/.claude/settings.jsonwith substantial configuration
(hooks, permissions, MCP servers, etc.)
- Introduce a JSON syntax error manually (e.g. remove a closing brace)
- Launch Claude Code
- Claude Code detects the invalid JSON and prompts:
"Reset to default" or "Edit manually"
- Choose "Reset to default"
settings.jsonis overwritten with a minimal default — all previous
content is permanently lost with no backup created
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.196 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗