$ recombobulate _
home / tips / control-transcript-retention-with-cleanupperioddays
0

Control Transcript Retention with cleanupPeriodDays

bagwaa @bagwaa · Mar 26, 2026 · Configuration
control-transcript-retention-with-cleanupperioddays

Claude Code keeps session transcripts for 30 days by default, deleting old ones at startup. The cleanupPeriodDays setting lets you shorten that window, or set it to 0 to disable session persistence entirely.

// ~/.claude/settings.json
{
  "cleanupPeriodDays": 7
}

A shorter period (7 or 14 days) keeps your ~/.claude/ directory from growing large over time, which matters on machines that run many sessions or in long-running CI environments.

Setting it to 0 is the most aggressive option: all existing transcripts are deleted at startup, no new .jsonl files are written, and /resume shows nothing. This is ideal for CI runners or shared machines where sessions should never be persisted at all:

{
  "cleanupPeriodDays": 0
}

For comparison, the --no-session-persistence CLI flag does the same thing for a single run, while cleanupPeriodDays: 0 applies permanently to every session on that machine.

Note: this setting is not accepted in shared project settings (.claude/settings.json) to prevent a repo from silently wiping a collaborator's history. Place it in user settings (~/.claude/settings.json) or your local settings file instead.

A short cleanup period keeps disk usage predictable without losing anything you actually need.


via Claude Code Settings

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Switch to the Stable Update Channel with autoUpdatesChannel

The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.

bagwaa @bagwaa · 1 hour ago
0
Set Claude's Response Language with the language Setting

The language setting makes Claude respond in your preferred language by default, across every session and project.

bagwaa @bagwaa · 1 hour ago
0
Customize or Remove Claude's Git Attribution with the attribution Setting

The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.

bagwaa @bagwaa · 1 hour ago