Add configurable session retention period

Resolved 💬 2 comments Opened Mar 24, 2026 by garshythoel Closed Apr 23, 2026

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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗