Skip to content

[FEATURE] Auto-delete conversation history after a configurable retention period #34694

Description

@ChrisOr-Dev

Problem

Claude Code stores conversation history locally, and over time this data accumulates significantly. There is currently no built-in mechanism to automatically clean up old history, which leads to ever-growing storage consumption on the user's machine. Users who rely on Claude Code daily can see this grow to hundreds of megabytes or more.

Proposed Solution

Add a configurable auto-delete setting for conversation history with preset retention periods:

  • 1 month — Keep only the last 30 days of history
  • 3 months — Keep only the last 90 days of history
  • 6 months — Keep only the last 180 days of history
  • Never (default) — Keep all history indefinitely (current behavior)

This could be exposed as a setting in the Claude Code configuration, for example:

{
  "historyRetention": "3months"
}

Expected Behavior

  • A background cleanup process periodically removes conversations older than the configured retention period.
  • The default remains "never delete" to preserve backward compatibility.
  • Users receive no surprise deletions — the feature is strictly opt-in.

Why This Matters

  • Prevents unbounded disk usage growth over time
  • Gives users control over their local data lifecycle
  • Aligns with privacy-conscious practices (less stale data sitting on disk)

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions