Itdaily - Claude Code deletes conversation history after 30 days by default

Claude Code deletes conversation history after 30 days by default

Claude Code logo: the name in orange block letters with a shadow on a black background.

Claude Code deletes conversation history after 30 days without notifying users.

Users of Claude Code report that the AI tool automatically deletes conversation history without informing them. The default setting clears transcripts older than thirty days as soon as Claude Code is launched, which can cause developers to lose important context and documentation.

The cause lies with the configuration option cleanupPeriodDays, which is set to thirty days by default. Upon every startup, Claude Code checks local transcript files and automatically deletes all conversations older than the set retention period. According to several users, this happens without warning, recovery options, or a log of the deleted files.

Anthropic calls it a security measure

Anthropic defends the default setting, stating that the retention period was deliberately chosen for security and privacy reasons. Transcripts may contain source code, passwords, API keys, or other sensitive data. By automatically deleting these files after thirty days, the company aims to prevent such information from remaining stored locally for long periods.

According to Anthropic, the feature has been present since the launch of Claude Code and is described in the documentation. However, users point out that the application does not mention anywhere during installation or initial startup that conversations are automatically deleted.

Developers lose valuable context

For many developers, the loss goes beyond just chat history. Conversations often contain design choices, error analyses, and the reasoning behind code changes. Especially in research and development projects, this context is an important part of the workflow.

Additionally, several users report that increasing the retention period does not always help. According to analyses from GitHub discussions, Claude Code bases the deletion on the modification date of the transcript file rather than the actual last activity. As a result, files modified via a backup, synchronization service, or script may be incorrectly considered outdated and still disappear automatically.

Currently, there is no built-in way to recover deleted transcripts. Users therefore advise regularly backing up local transcript files. At the same time, many developers are asking Anthropic for clearer warnings, a recovery period, or a less aggressive default setting for automatically cleaning up conversation history.