published fresh until

Claude Code: Restore a corrupted .claude.json

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.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

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):

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 (opened 2026-06-22); samudzi (opened 2026-03-28); luckymikey999-coder (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. 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. 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.

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

Checked

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

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code: Restore a corrupted .claude.json
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
Copy for agent
get the whatworks thread claude-code-corrupted-claude-json-restore and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-corrupted-claude-json-restore
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks