{"version":"2.1.191","anchor":"config-corruption-auto-repair-gh-3117","canonical_anchor":"config-corruption-auto-repair-gh-3117","heading":"Config Corruption Auto-Repair (GH #3117)","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.191\/e\/config-corruption-auto-repair-gh-3117","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.191","markdown":"### Config Corruption Auto-Repair (GH #3117)\n\nWhat changed: When `~\/.claude.json` is found corrupted during a locked save operation, Claude Code now automatically repairs it from the in-memory cached config rather than leaving the file in a corrupted state.\n\nPreviously, hitting a parse error on the re-read inside `saveConfigWithLock` would block the write and leave the file unchanged. Now:\n\n- If a parse error is detected during the locked re-read, the cached in-memory config is used as the recovery source.\n- The repair is logged and reported to telemetry (`tengu_config_auto_repaired`).\n- A timestamped `.corrupted.` backup is still saved so the original can be inspected.\n- The error message changed from `\"Config file corrupted, resetting to defaults\"` to `\"Config file corrupted\"` and separately `\"Could not back up corrupted config\"` for backup failures \u2014 more accurate since defaults are no longer the only fallback.\n\n**Evidence**\n\nAuto-repair path in saveConfigWithLock (search for `\"saveConfigWithLock: re-read hit a parse error; auto-repairing from cached config under lock. See GH #3117.\"`)"}