claude-code - 💡(How to fix) Fix Feature Request: Notify users before auto-deleting conversation history [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46175Fetched 2026-04-11 06:27:09
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Timeline (top)
labeled ×2

Root Cause

Conversation history serves as a work journal — it records what was built, why certain decisions were made, and preserves ideas and thought processes. Silently deleting this without user consent is a serious issue.

Fix Action

Fix / Workaround

Current workaround

RAW_BUFFERClick to expand / collapse

Problem

Claude Code automatically deletes conversation history after 30 days by default, with no warning or notification to the user. Many users are completely unaware this cleanup mechanism exists until they discover their history is gone.

I built a tool specifically to manage and review my past Claude Code conversations — tracking what I've built, ideas I've explored, and decisions I've made. Today I opened that tool and found only the last 30 days of data remained. All older conversations had been silently deleted. If I hadn't built this tool, I might never have noticed.

Why this matters

Conversation history serves as a work journal — it records what was built, why certain decisions were made, and preserves ideas and thought processes. Silently deleting this without user consent is a serious issue.

Suggestions

  1. Terminal notification before cleanup: When conversations are approaching the cleanup threshold, display a warning in the CLI (e.g., "X conversations will be deleted in Y days. Run claude config set cleanupPeriodDays N to extend retention.")
  2. Email notification: Send users an email reminder before their conversation history is cleaned up, similar to how other services handle data retention.
  3. First-run disclosure: When a user first uses Claude Code, clearly inform them about the auto-cleanup policy and how to configure it.
  4. Opt-in, not opt-out: Consider making auto-cleanup an opt-in feature rather than a silent default. Users should explicitly consent to having their data deleted.

Current workaround

Setting the environment variable CLAUDE_HISTORY_MAX_AGE_DAYS=3650 in shell config — but most users won't know about this until it's too late.

extent analysis

TL;DR

To prevent silent deletion of conversation history, users can set the CLAUDE_HISTORY_MAX_AGE_DAYS environment variable to a desired retention period.

Guidance

  • Set the CLAUDE_HISTORY_MAX_AGE_DAYS environment variable in your shell config to a value like 3650 to extend the retention period beyond the default 30 days.
  • Consider implementing a terminal notification or email reminder to alert users before their conversation history is cleaned up.
  • Review the suggestions provided, such as terminal notification before cleanup, email notification, and first-run disclosure, to improve user awareness of the auto-cleanup policy.
  • Evaluate the opt-in approach for auto-cleanup to ensure users explicitly consent to data deletion.

Example

No code snippet is provided as it is not clearly supported by the issue.

Notes

The provided workaround may not be widely known, and users may not be aware of the auto-cleanup policy until it's too late. Implementing notifications or changing the default behavior to opt-in may help mitigate this issue.

Recommendation

Apply workaround: Set the CLAUDE_HISTORY_MAX_AGE_DAYS environment variable to extend the retention period, as this provides an immediate solution for users to preserve their conversation history.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING