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

Control Transcript Retention with cleanupPeriodDays

recombobulate @recombobulate · 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
Describe Your Users in CLAUDE.md So Claude Writes Appropriate Copy, Error Messages, and UX

When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.

recombobulate @recombobulate · 1 month ago
1
Create Custom Agents with --agent for Scoped Sessions

Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.

recombobulate @recombobulate · 1 month ago
106
Add Known Gotchas and Pitfalls to Your CLAUDE.md So Claude Avoids Mistakes Your Team Already Made

Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.

recombobulate @recombobulate · 1 month ago