Skip to content

[BUG] Did 2.1.1 delete all of your *local* chat logs > 30 days old without asking? #16978

Closed as not planned

Description

@knksmith57

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

I had (and regularly reference) 4+ months of chat logs (.jsonl) under ~/.claude/projects/; just now, after starting a new session, everything before December 4th has been deleted. I have explicitly configured cleanupPeriodDays to 99999:

jq '.cleanupPeriodDays' ~/.claude/settings.json
99999

Did Anthropic unilaterally decide that until I opt-into data sharing, that they'd bulk delete files from my local machine? Because I'm pretty sure that's what just happened.

Here's the prompt I was presented in the new session:

Image

All of my history was deleted and I haven't even selected a choice yet.

Is this intentional behavior? Does the latest release of Claude Code preemptively delete our local chat logs without authorization?

What Should Happen?

Claude Code should not delete chat logs fresher than cleanupPeriodDays.

Error Messages/Logs

Steps to Reproduce

  1. Upgrade Claude Code to latest

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

~2.0.76

Claude Code Version

2.1.1

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

No response

Activity

  1. knksmith57 commented on Jan 9, 2026

    @knksmith57
    Author

    x-referencing #16970 (comment)

  2. github-actions commented on Jan 9, 2026

    @github-actions

    Found 2 possible duplicate issues:

    1. [Bug] Project files deleted despite cleanupPeriodDays set to 1825 #15935
    2. [BUG] claude is losing chat history #16970

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. knksmith57 commented on Jan 9, 2026

    @knksmith57
    Author

    x-referencing evidence that this contradicts the documented behavior and contract promised by the official docs: #4172 (comment)

    Image

    See https://code.claude.com/docs/en/settings#available-settings

  4. dicksontsai commented on Jan 9, 2026

    @dicksontsai
    Collaborator

    There are two issues going on in this report that could be happening independently.

    Why your chat logs > 30 days got deleted

    It's possible that the new version detected your settings file containing cleanupPeriodDays as invalid. You should use claude doctor to see why. Version 2.1.0/2.1.1 introduced potentially stricter validation. The current behavior for invalid settings (which I would say is not ideal) is to use the default setting (30 days) when the file gets invalidated.

    • CC fix: Skip cleanup if cleanupPeriodDays is mentioned in an invalid settings file. The change is under review.

    Why the Consumer Terms modal shows up

    Consumer terms acceptance are tracked server-side. Version 2.1.1 introduced timeouts for server requests that could lead to silent failures.

    • CC fix: I have reverted the timeouts that were introduced, will come out in the next release.

    Unfortunately, there isn't a way to recover the history apart from any backups you maintain of the transcript files.

  5. knksmith57 commented on Jan 9, 2026

    @knksmith57
    Author

    Appreciate the context, @dicksontsai.

    My best guess, then, is that the described fallback behavior triggered as a result of the settings filewatcher (TIL that was a thing) firing while I was mid-way through modifying my ~/.claude/settings.json file to disable autoupdates during the botched 2.1.x rollout.

    To the very best of my knowledge and recollection, I did not start a new CC session/tty while the file was in a transient state. So I believe that implies one of two things:

    1. I'm wrong and I did start a new CC session while my ~/.claude/settings.json file was in a malformed state.
    2. Modifying ~/.claude/settings.json while a CC session is running can trigger cleanup to run.

    Iff the latter, then CC is breaking the contract promised by cleanupPeriodDays to only run at startup. And that's extremely dangerous.

    I always start CC with the --debug flag and here's what I see:

    Details
    2026-01-07T21:04:37.732Z [DEBUG] Checking for native installer update to version 2.0.76
    2026-01-07T21:04:37.733Z [DEBUG] Already running version 2.0.76 - no update needed
    2026-01-07T21:34:37.731Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-07T21:34:37.739Z [DEBUG] Downloading native installer version 2.1.1
    2026-01-07T21:34:41.264Z [DEBUG] Atomically installed binary to /Users/kyle/.local/share/claude/versions/2.1.1
    2026-01-07T21:34:41.270Z [DEBUG] Atomically updated symlink /Users/kyle/.local/bin/claude -> /Users/kyle/.local/share/claude/versions/2.1.1
    2026-01-07T21:34:41.276Z [DEBUG] Successfully updated to version 2.1.1
    2026-01-07T21:34:41.667Z [DEBUG] CDN dark read succeeded for 2.1.1
    2026-01-07T22:04:37.767Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-07T22:04:37.769Z [DEBUG] Version 2.1.1 already installed, updating symlink
    2026-01-07T22:04:37.769Z [DEBUG] Successfully updated to version 2.1.1
    2026-01-07T22:34:37.779Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-07T22:34:37.787Z [DEBUG] Version 2.1.1 already installed, updating symlink
    2026-01-07T22:34:37.789Z [DEBUG] Successfully updated to version 2.1.1
    2026-01-07T23:04:37.729Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-07T23:04:37.739Z [DEBUG] Version 2.1.1 already installed, updating symlink
    2026-01-07T23:04:37.742Z [DEBUG] Successfully updated to version 2.1.1
    2026-01-07T23:34:37.703Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-07T23:34:44.717Z [ERROR] Error: Error: NON-FATAL: Lock acquisition failed for /Users/kyle/.local/share/claude/versions/2.1.1 (expected in multi-process scenarios)
        at XZR (/$bunfs/root/claude:2430:2165)
        at GEB (/$bunfs/root/claude:2428:8637)
        at async R_1 (/$bunfs/root/claude:2428:11835)
        at async wx (/$bunfs/root/claude:2430:236)
        at async <anonymous> (/$bunfs/root/claude:2430:14362)
        at processTicksAndRejections (native:7:39)
    2026-01-08T00:04:37.647Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-08T00:04:44.658Z [ERROR] Error: Error: NON-FATAL: Lock acquisition failed for /Users/kyle/.local/share/claude/versions/2.1.1 (expected in multi-process scenarios)
        at XZR (/$bunfs/root/claude:2430:2165)
        at GEB (/$bunfs/root/claude:2428:8637)
        at async R_1 (/$bunfs/root/claude:2428:11835)
        at async wx (/$bunfs/root/claude:2430:236)
        at async <anonymous> (/$bunfs/root/claude:2430:14362)
        at processTicksAndRejections (native:7:39)
    2026-01-08T00:34:37.662Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-08T00:34:44.674Z [ERROR] Error: Error: NON-FATAL: Lock acquisition failed for /Users/kyle/.local/share/claude/versions/2.1.1 (expected in multi-process scenarios)
        at XZR (/$bunfs/root/claude:2430:2165)
        at GEB (/$bunfs/root/claude:2428:8637)
        at async R_1 (/$bunfs/root/claude:2428:11835)
        at async wx (/$bunfs/root/claude:2430:236)
        at async <anonymous> (/$bunfs/root/claude:2430:14362)
        at processTicksAndRejections (native:7:39)
    2026-01-08T01:04:37.725Z [DEBUG] Checking for native installer update to version 2.1.1
    2026-01-08T01:04:44.737Z [ERROR] Error: Error: NON-FATAL: Lock acquisition failed for /Users/kyle/.local/share/claude/versions/2.1.1 (expected in multi-process scenarios)
        at XZR (/$bunfs/root/claude:2430:2165)
        at GEB (/$bunfs/root/claude:2428:8637)
        at async R_1 (/$bunfs/root/claude:2428:11835)
        at async wx (/$bunfs/root/claude:2430:236)
        at async <anonymous> (/$bunfs/root/claude:2430:14362)
        at processTicksAndRejections (native:7:39)
    2026-01-08T01:05:31.092Z [DEBUG] Detected deletion of /Users/kyle/.claude/settings.json
    2026-01-08T01:05:31.101Z [DEBUG] Settings changed from userSettings, updating AppState
    2026-01-08T01:06:10.190Z [DEBUG] Detected change to /Users/kyle/.claude/settings.json
    2026-01-08T01:06:10.197Z [DEBUG] Settings changed from userSettings, updating AppState
    2026-01-08T02:22:58.935Z [DEBUG] AutoUpdaterWrapper: Installation type: native
    

    At no point did I delete my ~/.claude/settings.json; I'll defer speculating about why that message might have fired for now.


    Obviously we can't get back what's lost, so I'll try and wrap this with some constructive feedback: permanent customer data loss isn't an acceptable default.

  6. MarcosRodrigoT commented on Jan 19, 2026

    @MarcosRodrigoT

    I just opened a VS Code project I have been working on for the past few months and saw that the conversation history was empty.

    I checked on the terminal and not only the conversation history of this project, but all the other projects' conversations I had were deleted. Yesterday they were all there. The same thing happened to one of my co-workers.

    I did not set any cleanupPeriodDays (running jq '.cleanupPeriodDays' ~/.claude/settings.json returns null). I also did not manually update Claude. I wasn't prompted for any "data sharing" or anything else. All chats simply dissapeared without any warning or prompt.

    I tried recovering previous conversations from ~/.claude but there are only log files from today, everything previous to today has been permanently deleted.

    This is a serious issue, if at any point I can lose all chats without warning I will seriously reconsider my Claude subscription.

  7. changed the title [-][BUG] Did `2.1.1` delete all of your *local* chat logs > 30 days without asking?[/-] [+][BUG] Did `2.1.1` delete all of your *local* chat logs > 30 days old without asking?[/+] on Jan 21, 2026
  8. github-actions commented on Feb 28, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  9. github-actions commented on Mar 9, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  10. locked as resolved and limited conversation to collaborators on Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsmemoryplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions