cd /news/ai-tools/beware-claude-code-deletes-30-day-ol… · home topics ai-tools article
[ARTICLE · art-45016] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=↓ negative

Beware, Claude Code deletes >30 day old transcripts. Anthropic won't fix it

A bug in Anthropic's Claude Code tool silently deletes conversation transcripts older than 30 days by default, causing users to lose months of reasoning history without warning. The issue, filed on GitHub, shows the cleanupPeriodDays default is set to 30 with no disclosure or opt-in, and Anthropic has declined to fix it. Users must manually override the setting to prevent data loss.

read2 min views1 publishedJun 30, 2026
Beware, Claude Code deletes >30 day old transcripts. Anthropic won't fix it
Image: source
[Notifications](/login?return_to=%2Fanthropics%2Fclaude-code)You must be signed in to change notification settings -
[Fork 21.8k](/login?return_to=%2Fanthropics%2Fclaude-code)


[bugSomething isn't working](https://github.com/anthropics/claude-code/issues?q=state%3Aopen%20label%3A%22bug%22)Something isn't working

Description #

Preflight Checklist

  • I have searched existing issuesand this hasn't been reported yet - This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

cleanupPeriodDays defaults to 30, causing Claude Code to silently delete

~/.claude/projects//.jsonl files older than 30 days on

startup. There is no first-run disclosure, no warning before deletion, and the

setting is not surfaced in /config. I lost months of conversation history

before realizing this was happening.

Repro: Use Claude Code for >30 days without setting cleanupPeriodDays. Old

transcripts disappear.

Evidence on my machine: ~/.claude/history.jsonl shows 14 sessions / 1,315

prompts for one project from March–April. Only the current session's .jsonl

survives in ~/.claude/projects/. The cutoff matches the 30-day default

exactly. My settings.json does not override the default.

Impact: The code and git history remain, but the reasoning trail — design

discussions, debugging context, analysis — is gone. For research work that

context is the artifact.

What Should Happen?

Requested:

- Change the default to non-destructive (disabled, or very long retention).
- Disclose at first run; require opt-in for auto-deletion.
- Soft-delete to a trash folder instead of unlink().
  • Surface the setting in /config.

Workaround for others: add "cleanupPeriodDays": 3650 to

~/.claude/settings.json immediately.

Error Messages/Logs

Steps to Reproduce

Use Claude Code for >30 days without setting cleanupPeriodDays. Old transcripts disappear.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.150

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

No response

Metadata #

Metadata #

Assignees

Labels

bugSomething isn't workingSomething isn't working

Type

Fields

Give feedback

── more in #ai-tools 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/beware-claude-code-d…] indexed:0 read:2min 2026-06-30 ·