settings.json

desktopSessionCleanupPeriodDays

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

Claude Desktop または Cowork で開始または再開したセッションのトランスクリプトに対して、日単位の年齢制限を設定します。

既定値: 0, which sets no age limit

記述例

{
  "desktopSessionCleanupPeriodDays": 90
}

使い方・用途

  • デフォルト値は 0(制限なし)
  • cleanupPeriodDays が 30 の場合、この設定を 7 にしても 30 日間保持されます
  • 管理設定で cleanupPeriodDays が設定されている場合は、この設定は無視されます
  • v2.1.248 以降で利用可能
英語原文(公式ドキュメントより)

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](/docs/en/claude-directory#cleaned-up-automatically). 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. When managed settings set cleanupPeriodDays, that period applies instead and this key is ignored. Requires Claude Code v2.1.248 or later.

関連する変更履歴

v2.1.248(1件)

Fixed
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

変更前

Claude Desktop と Cowork のセッションが30日後に削除されていました。

変更後

アプリ内にある間はセッションが保持されるようになり、設定で期間を制限できます。

ユーザーへの恩恵

重要なセッションデータが誤って削除されるのを防げます。