Skip to content

Add configurable session retention period #38440

Description

@garshythoel

Feature Request

Problem:
Claude Code automatically cleans up older sessions after ~30 days. There is currently no way to configure this retention window. For users working on long-running projects or who want to reference older session context, the default window is too short.

Proposed Solution:
Add a sessionRetentionDays (or similar) setting to settings.json that allows users to configure how long sessions are retained before automatic cleanup. For example:

{
  "sessionRetentionDays": 90
}

Use Case:

  • Long-running projects where historical session context is valuable
  • Users who periodically revisit past sessions for reference
  • Teams that want consistent retention policies across members

Current Workaround:
Using the memory system (~/.claude/projects/.../memory/) to persist important context, but this doesn't preserve the full session transcript and interaction history.

Environment:

  • macOS (Darwin 25.3.0)
  • Claude Code CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions