Skip to content

Disable auto-deletion of past conversations #4172

Closed

Description

@JGKle

Claude Code retains its history of conversations in ~/.claude/projects/xxx. However, when reviewing the diffs of a backup, I realized that it's silently deleting old conversations - it seems like after 30 days.

I definitely never opted into automatic data deletion, nor was I prompted to approve data deletion, nor can I find a way to disable this silent deletion of my conversation data.

How can it be disabled?

Activity

  1. Kansai53 commented on Aug 13, 2025

    @Kansai53

    Same issue, it's deleting conversation data without permission. How to disable?

  2. coygeek commented on Aug 16, 2025

    @coygeek

    This is correct. Claude Code has a default setting to automatically clean up local conversation history after 30 days.

    You can disable this behavior by configuring the cleanupPeriodDays setting in your settings.json file. To apply this setting globally for your user, create or edit the file at ~/.claude/settings.json.

    To effectively disable auto-deletion, you can set the cleanup period to a very large number of days. For example, add the following to your ~/.claude/settings.json file:

    {
      "cleanupPeriodDays": 99999
    }

    This setting is documented on the Claude Code settings page, which states:

    cleanupPeriodDays: How long to locally retain chat transcripts based on last activity date (default: 30 days)

    The Data usage page also mentions this behavior:

    Users' local Claude Code clients may store sessions locally for up to 30 days so that users can resume them. This behavior is configurable.

    Setting a high value for cleanupPeriodDays will ensure your local conversation history is retained for as long as you need.

  3. JGKle commented on Aug 16, 2025

    @JGKle
    Author

    Ah perfect, thanks! I tried looking in /config, and also googling for "claude code retention settings", but every result it turned up was about Anthropic data retention. Somehow that didn't come up.

    Closing :)

  4. github-actions commented on Aug 25, 2025

    @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.

  5. locked as resolved and limited conversation to collaborators on Aug 25, 2025
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:coreenhancementNew feature or requestmemoryquestionIssue is asking a question about how Claude Code works, or similar

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions