You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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.
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.
Activity
Kansai53 commentedon Aug 13, 2025
Same issue, it's deleting conversation data without permission. How to disable?
coygeek commentedon Aug 16, 2025
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:{ "cleanupPeriodDays": 99999 }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.JGKle commentedon Aug 16, 2025
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 :)
github-actions commentedon Aug 25, 2025
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.