Claude Code Silently Deletes Conversation Transcripts After 30 Days

Tools & Releases

Claude Code Silently Deletes Conversation Transcripts After 30 Days

A default cleanup setting in Anthropic’s Claude Code command-line tool silently purges project conversation logs older than 30 days without warning.

AZAli Zayed · Founder & EditorJune 30, 20262 min read✓ Independently fact-checked
The quick version
  • Anthropic’s Claude Code command-line tool deletes local .jsonl conversation transcript files older than 30 days by default upon startup.
  • The deletion occurs silently without any first-run disclosure, warning messages, or visibility within the standard configuration interface.
  • Developers can lose months of valuable AI prompt and interaction history unless they manually override the undocumented cleanupPeriodDays setting.

Anthropic’s command-line interface, Claude Code, silently deletes local conversation transcript files older than 30 days by default. According to a bug report filed on the official GitHub repository, the tool purges these .jsonl files from the user’s local directory on startup. The deletion occurs automatically without issuing a warning, providing a first-run disclosure, or displaying the cleanup policy within the standard configuration menus.

Why the data loss occurs

The issue stems from a default configuration parameter named cleanupPeriodDays, which is pre-configured to 30 days. When a developer launches Claude Code, the utility scans the ~/.claude/projects/ directory and permanently removes any session log files that exceed this age limit. Because this setting is not surfaced when users run the standard /config command, most developers remain unaware that their local history is being actively pruned.

The bug was highlighted by developer joelhochstetter, who discovered they had lost months of conversation history across multiple projects. While the underlying codebases and Git histories remain unaffected, the step-by-step reasoning, prompts, and context of the AI interactions are lost permanently once the 30-day threshold is crossed. The user’s local history.jsonl file may show a record of past sessions, but the actual detailed transcripts inside the project-specific directories are wiped clean.

How to prevent transcript deletion

To stop Claude Code from deleting old conversation logs, developers must manually edit their local settings.json file to override the default cleanupPeriodDays value. Because the setting is undocumented and hidden from the standard command-line configuration tool, users must locate their global configuration file directly to make the change.

For developers who require reliable, long-term logging of their AI interactions without hidden deletion scripts, evaluating alternative platforms may be necessary. You can review our tested recommendations for the best AI coding tools to find alternative coding assistants that offer more transparent data retention policies.

Anthropic has not yet patched this default behavior or added a warning prompt to the startup sequence. Until an official update addresses the issue, developers using Claude Code for long-term projects should proactively back up their ~/.claude directory or modify their configuration files to prevent the silent loss of valuable development logs.

30 daysDefault lifespan of Claude Code local transcripts before silent deletion

Frequently asked questions

Why is Claude Code deleting my chat history?

By default, Claude Code has an undocumented setting called cleanupPeriodDays set to 30. On startup, the tool silently deletes local .jsonl transcript files older than 30 days.

Does Claude Code warn users before deleting transcripts?

No. There is no first-run disclosure, warning prompt, or notification before the tool purges files from the local directory.

How can I stop Claude Code from deleting old conversations?

You must manually override the cleanupPeriodDays setting in your local settings.json file, as the option is not currently surfaced in the command-line /config menu.

Our tested pick

Compare other development assistants in our guide to the best AI coding tools.

Best AI Coding Tools (2026): 7 Tested & Ranked →

Source: Hacker News. Published June 30, 2026.

AZ
Ali Zayed
Founder & Editor · AI Tools Worth

Ali has hands-on tested 50+ AI tools and tracks model releases daily. Every verdict here comes from real, paid usage — never vendor demos or sponsored placements.

AI Tools Worth is independent and unsponsored. Some linked guides contain affiliate links — they never change our verdicts.