Skip to content

feat: add toggle to protect Claude Code conversation history from auto-deletion #1623

@daymade

Description

@daymade

Problem

Claude Code silently deletes conversation transcripts after 30 days by default (cleanupPeriodDays: 30). Most users are unaware of this setting until they lose data. Multiple issues have been filed on the Claude Code repo:

Proposal

Add a toggle in Settings → General → Window Behavior, positioned below the existing "Skip Claude Code first-run confirmation" toggle:

Title: "Keep conversation history"
Description: "Prevent Claude Code from auto-deleting conversation transcripts (default: 30 days)"

When enabled: set cleanupPeriodDays: 99999 in ~/.claude/settings.json
When disabled: remove the cleanupPeriodDays field (revert to Claude Code's default behavior)

Why CC Switch

CC Switch already manages Claude Code settings (e.g., skipClaudeOnboarding writes to ~/.claude.json). This is a natural extension — protecting users from a known data loss footgun during initial setup.

Implementation Notes

  • Target file: ~/.claude/settings.json (different from ~/.claude.json used by onboarding skip)
  • Follows the existing ToggleRow pattern in WindowSettings.tsx
  • Requires new Tauri commands for reading/writing cleanupPeriodDays
  • i18n: EN/ZH/JA translations needed

I'll submit a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions