Disable auto-deletion of past conversations
Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Jul 22, 2025 · closed Aug 16, 2025
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?
4 Comments
Same issue, it's deleting conversation data without permission. How to disable?
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
cleanupPeriodDayssetting in yoursettings.jsonfile. 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.jsonfile:This setting is documented on the Claude Code settings page, which states:
The Data usage page also mentions this behavior:
Setting a high value for
cleanupPeriodDayswill ensure your local conversation history is retained for as long as you need.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 :)
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.