[BUG] "Reset to default" on invalid settings.json overwrites the file without creating a backup

Open 💬 1 comment Opened Jun 30, 2026 by jimiflowers

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

  1. Have a ~/.claude/settings.json with substantial configuration

(hooks, permissions, MCP servers, etc.)

  1. Introduce a JSON syntax error manually (e.g. remove a closing brace)
  2. Launch Claude Code
  3. Claude Code detects the invalid JSON and prompts:

"Reset to default" or "Edit manually"

  1. Choose "Reset to default"
  2. settings.json is 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_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗