# Claude Code: Restore a corrupted .claude.json

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/claude-code-corrupted-claude-json-restore
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, restore the backup using the copy line printed in the error. If none is offered, repair the JSON or use another preserved backup. Start with the printed cp

**Not for:** Claude Desktop MCP server discovery and its separate config file.

Subjects: anthropic, claude-code

Do first: Run the `cp` line printed by Claude Code when it identifies a backup.

## Symptom
The documented startup output includes this message (the path below is the documentation's example):
```text
Claude configuration file at ~/.claude.json is corrupted: <JSON parser's message>
```
A non-interactive start such as `claude -p` exits with code 1. Related reports of this message: [MoralStrike](https://github.com/anthropics/claude-code/issues/70002) (opened 2026-06-22); [samudzi](https://github.com/anthropics/claude-code/issues/40226) (opened 2026-03-28); [luckymikey999-coder](https://github.com/anthropics/claude-code/issues/46479) (opened 2026-04-11).

## Cause
Claude Code cannot parse `~/.claude.json`, which contains account details, MCP servers, and per-project state.

## Fix
1. Printed `cp` line | copy the named backup back | run it in your terminal; on Windows, use PowerShell. [Documentation](https://code.claude.com/docs/en/errors#configuration-error-in-claudejson).
2. No copy line, or error returns | repair the JSON | if the file still contains your configuration. Otherwise copy another `.claude.json.backup.<timestamp>` from `~/.claude/backups/` over it if available, or rename it. [Documentation](https://code.claude.com/docs/en/errors#configuration-error-in-claudejson).
3. Configuration missing | locate a `.claude.json.corrupted.<timestamp>` with the configuration | repair its JSON and copy it over `~/.claude.json`. If none can be found or repaired, try a backup that contains the configuration. If none does, rename `~/.claude.json` and add MCP servers again with `claude mcp add`. [Documentation](https://code.claude.com/docs/en/errors#configuration-error-in-claudejson).

## If it still fails
- Starting without `~/.claude.json` uses defaults and loses access to everything that file held. The page provides no way to reconstruct configuration absent from all retained copies.

Not for: Claude Desktop MCP server discovery; see claude-desktop-mcp-server-not-showing-config-json-restart-logs.

## Sources
- [Error reference](https://code.claude.com/docs/en/errors#configuration-error-in-claudejson), Anthropic documentation, read 2026-11-24: "Claude Code couldn't parse `~/.claude.json`"
- [Configuration corruption during non-interactive startup](https://github.com/anthropics/claude-code/issues/70002), MoralStrike, opened 2026-06-22, closed 2026-08-14 (not_planned); status read 2026-11-24
- [Concurrent writes corrupt configuration](https://github.com/anthropics/claude-code/issues/40226), samudzi, opened 2026-03-28, closed 2026-06-11 (not_planned); status read 2026-11-24
- [Temporary-file crash loop](https://github.com/anthropics/claude-code/issues/46479), luckymikey999-coder, opened 2026-04-11, closed 2026-05-25 (not_planned); status read 2026-11-24

## Checked
2026-11-24; read the linked documentation, issue records and changelog top entry; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.