Sunday, July 5, 2026

News

Claude Code Deletes Chat History After 30 Days by Default, Without Warning

CodingPatryk RabaJuly 4, 2026

Claude Code users have discovered that the tool automatically and irreversibly deletes transcripts of older conversations, and Anthropic is defending the behavior as a deliberate security feature.

Contents
  1. What actually gets deleted
  2. Anthropic's reasoning
  3. Why it hurts developers
  4. What it means for Polish teams

Developers using Claude Code, Anthropic's command-line tool for agentic coding, have started reporting that the tool deletes their conversation history with the model on its own. The culprit is a default cleanup mechanism that the app never mentions, not during installation and not on first launch.

What actually gets deleted

The deletions are governed by a setting called cleanupPeriodDays, which defaults to thirty days. Every time Claude Code starts, it checks local transcript files and permanently deletes any older than that period. There is no dialog box, no confirmation, and no log recording what was removed.

Files go straight to a system-level unlink call, bypassing any trash bin or temporary folder. There is no restore command and no way to recover the data afterward. All that's left in the app's sidebar are ghost entries that return an error when clicked, since the file they point to no longer exists.

The Register was first to report the issue, citing user complaints, and the topic quickly spread across Hacker News and in issues filed on the Claude Code GitHub project. Several independent threads on the anthropics/claude-code GitHub repository describe the same mechanism from different angles: silent deletion after syncing, a cleanupPeriodDays: 0 setting that malfunctions, and cases where cleanup runs even after the limit has been manually raised.

Anthropic's reasoning

Anthropic defends the default setting, saying the thirty-day retention period was chosen deliberately for security and privacy reasons. Conversation transcripts can contain snippets of source code, passwords, API keys, and other sensitive data, so automatic deletion is meant to prevent them from sitting on local disk indefinitely.

The company also points out that the feature has existed since Claude Code launched and is documented. Users counter that documentation isn't enough when nobody sees the setting in the interface or gets any notification on first launch. Neither the CLI nor the editor extension offers a place to check the current retention period, see when the next cleanup is due, or cancel it.

Why it hurts developers

Code and version control history remain untouched, but it's precisely the agent's trail of reasoning, design discussions, bug analyses, and rationale for decisions, that disappears for good. For teams that treat Claude Code as a record of the thought process behind harder changes, losing these logs means losing context they can never get back.

Some of the GitHub reports describe files disappearing even after users manually raised the limit, which suggests the problem isn't just users being unaware of the default configuration, but in some cases a straightforward bug in the cleanup implementation.

What it means for Polish teams

For companies and freelancers in Poland using Claude Code on production code, the takeaway is practical: check and raise the cleanupPeriodDays value in the configuration now if conversation history matters for documenting technical decisions or billing client hours. Teams using Claude Code in regulated industries should also verify that automatic transcript deletion doesn't conflict with internal project documentation retention requirements.

The episode also feeds into a broader question of trust in agentic tools, where users hand over file system and terminal access to an agent while having less and less visibility into what happens to the data generated along the way. Anthropic has not yet announced any plan to change the default behavior or add a warning on first launch.

Sources: Claude Code users complain their chat records are being mysteriously wiped out (theregister.com), Claude Code deletes conversation history after 30 days by default (itdaily.com), Beware, Claude Code deletes more than 30 day old transcripts (news.ycombinator.com)

Share: