desktopSessionCleanupPeriodDays

settings.json型number記述場所ユーザー設定または管理者設定

Claude Desktop または Cowork で開始、あるいは最後に継続したセッションのトランスクリプトに、日数単位の期限を設定する。このキーがない場合、Claude Code はこれらのトランスクリプトを期限なく保持する。Claude Code は、この上限と cleanupPeriodDays の両方を超過したものを削除するため、cleanupPeriodDays の既定値が 30 である場合、値が 7 でもトランスクリプトは 30 日間保持される。cleanupPeriodDays が代わりに適用されこのキーが無視されるケースは参照先に列挙されている。Claude Code v2.1.248 以降が必要。

既定値0 であり、期限を設けない。

記述例

{
  "desktopSessionCleanupPeriodDays": 90
}

使い方・用途

  • Claude Desktop や Cowork で開始したセッションのトランスクリプトが既定では期限なしで保存されるため、保存期間に上限を設けたい場合に使う。
  • トランスクリプトや履歴が暗号化されずに保存されることによる情報露出を減らすため、Claude Desktop および Cowork のトランスクリプトにも保存期間の上限を設定したい場合に使う。
  • cleanupPeriodDays とは独立に Claude Desktop と Cowork のトランスクリプトだけ保持期間を管理したい場合に使う。
英語原文

Set an age limit in days for the transcripts of sessions you started or most recently continued in Claude Desktop or Cowork. Without this key, Claude Code keeps those transcripts at any age. Claude Code deletes each one once it's older than both this limit and [cleanupPeriodDays](#cleanupperioddays), so with cleanupPeriodDays at its default of 30, a value of 7 still keeps them 30 days. Cleaned up automatically lists the cases where cleanupPeriodDays applies instead and Claude Code ignores this key. Requires Claude Code v2.1.248 or later.

関連する変更履歴

v2.1.248(1件)

Claude Desktop と Cowork のセッションが30日後に消える問題を修正した。トランスクリプトのクリーンアップは、アプリ内にある間はデスクトップから書き込まれたセッションを保持するようになった(組織ポリシーが保持期間を管理している場合を除く)。新たな desktopSessionCleanupPeriodDays 設定でこの例外の上限を指定できる
英語原文を表示
Fixed Claude Desktop and Cowork sessions disappearing after 30 days: the transcript cleanup now keeps desktop-written sessions while they are in the app (unless org policy manages retention); the new desktopSessionCleanupPeriodDays setting caps the exemption