Skip to content
BENIBIX Learn

cleanupPeriodDays

AI⌨️ Claude CodeConfiguration

Also known as cleanupPeriodDays setting, transcript retention

The key that sets how many days old chat logs are kept.

Think of it like

It is like a rule that old notes go in the bin each month.

Example

Lucy wanted to resume a chat from six weeks ago, but it was gone. She sets cleanupPeriodDays to 90.

Why it matters

It decides how far back /resume can reach, and how long your logs sit on disk.

Definition

cleanupPeriodDays is a settings key that sets how many days Claude Code keeps old chat logs. That covers session transcripts and other saved data, which it then deletes. The default is 30 days and the smallest value is 1. Setting 0 fails, so pick a large number, such as 3650, to keep them a long time. The clean-up runs in the background after a session starts.

Example code

json
{
  "cleanupPeriodDays": 90
}
Keep transcripts for 90 days.

Common mistake

Setting it to 0 to keep logs forever. 0 fails, so use a large number instead.

Key takeaways

  1. 1
    Days to keep. Default 30.
  2. 2
    At least 1. 0 fails.
  3. 3
    Runs in the background. After start.