{"name":"cleanupPeriodDays","slug":"cleanupperioddays","family":"setting","title":"Settings keys","noun":"settings key","description":"Choose how many days Claude Code keeps [transcripts](\/docs\/en\/data-usage#data-retention) before deleting them","description_source":"docs","described_by":{"doc":"claude-code\/settings-reference","title":"All settings"},"presence":{"first_seen":"2.1.138","removed_in":"2.1.284","in_current_build":false,"newest_mined":"2.1.308","builds":126,"mined_builds":149,"first_cited":{"version":"2.1.8","released_at":"2026-01-15 00:41:01","spans":5}},"aliases":[],"entries":[{"version":"2.1.304","anchor":"remote-settings-unknowable-pause-for-retention-cleanup-disk","heading":"Old transcript cleanup pauses when server-managed settings cannot be read","line":"Automatic deletion of old transcripts now skips when server-managed settings are unknown, and sessions without a disk skip disk writes","released_at":"2026-10-19 19:47:15","reason":"found in this entry's text, named in this entry"},{"version":"2.1.287","anchor":"session-cleanup-helper-generalized-served-calls-files-now-c","heading":"cleanupPeriodDays now also clears old files in .claude\/state\/served-calls","line":"Claude Code now deletes old files under .claude\/state\/served-calls after the number of days set by `cleanupPeriodDays`","released_at":"2026-10-01 16:59:25","reason":"found in this entry's text, named in this entry"},{"version":"2.1.283","anchor":"dir-sync-notice-now-says-how-long-trashed-files-are-kept","heading":"Cloud file deletion notice now says how long your local copy is kept","line":"When a cloud session deletes or replaces a synced file, the notice now says your copy is kept for at least the `cleanupPeriodDays` period","released_at":"2026-09-25 18:46:11","reason":"found in this entry's text, named in this entry"},{"version":"2.1.282","anchor":"remote-managed-settings-keep-raw-values-for-keys-whose-only","heading":"More remotely managed settings keep their original values when partly invalid","line":"When remotely managed settings fail validation, Claude Code now keeps the original values for more keys instead of only the two cleanup settings","released_at":"2026-09-24 15:56:22","reason":"found in this entry's text"},{"version":"2.1.248","anchor":"transcripts-owned-by-the-claude-desktop-app-are-exempt-from-","heading":"Transcripts owned by the Claude desktop app are exempt from the retention sweep","line":"Desktop-owned transcripts survive the retention sweep, capped by a new desktopSessionCleanupPeriodDays setting.","released_at":"2026-08-27 20:35:36","reason":"named in this entry, found in this entry's text"},{"version":"2.1.248","anchor":"cleanup-skip-message-names-the-setting-at-fault","heading":"Cleanup skip message names the setting at fault","line":"When transcript cleanup skips, it now names the retention setting that failed validation.","released_at":"2026-08-27 20:35:36","reason":"named in this entry, found in this entry's text"},{"version":"2.1.238","anchor":"new-keybindingflavor-setting-for-readline-style-prompt-editi","heading":"New keybindingFlavor setting for readline-style prompt editing","line":"Set keybindingFlavor to readline and Ctrl+W deletes back to whitespace like Bash does.","released_at":"2026-08-20 18:01:54","reason":"found in this entry's text"},{"version":"2.1.234","anchor":"auto-mode-classifier-failures-write-a-debug-dump-that-ages-o","heading":"Auto-mode classifier failures write a debug dump that ages out with the session","line":"When auto mode's classifier errors, a debug dump lands beside your transcript and gets cleaned up later.","released_at":"2026-08-17 18:19:13","reason":"found in this entry's text"},{"version":"2.1.224","anchor":"settings-presence-checks-can-read-through-the-newer-settings","heading":"Settings presence checks can read through the newer settings store","line":"Checks for explicitly set settings keys can now read from the newer settings store.","released_at":"2026-08-07 01:36:32","reason":"named in this entry, found in this entry's text"},{"version":"2.1.203","anchor":"bug-fixes","heading":"","line":null,"released_at":"2026-07-07 17:40:17","reason":"found in this entry's text"}],"entries_total":15,"docs":[{"source":"claude-code","path":"settings-reference","title":"All settings","documented":true},{"source":"claude-code","path":"settings","title":"Claude Code settings","documented":true},{"source":"claude-code","path":"agent-sdk\/session-storage","title":"Persist sessions to external storage","documented":false},{"source":"claude-code","path":"agent-sdk\/subagents","title":"Subagents in the SDK","documented":false},{"source":"claude-code","path":"agent-sdk\/typescript","title":"Agent SDK reference - TypeScript","documented":false},{"source":"claude-code","path":"agent-teams","title":"Orchestrate teams of Claude Code sessions","documented":false},{"source":"claude-code","path":"agent-view","title":"Manage multiple agents with agent view","documented":false},{"source":"claude-code","path":"changelog","title":"Claude Code changelog","documented":false},{"source":"claude-code","path":"checkpointing","title":"Checkpointing","documented":false},{"source":"claude-code","path":"claude-directory","title":"Explore the .claude directory","documented":false}],"docs_total":14,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/setting\/cleanupperioddays","family_url":"https:\/\/changelogs.core-directive.com\/reference\/setting.json"}