← Reddit

Clean-up Period of JSON Convo Logs!!

Reddit · kotachisam · May 5, 2026
Claude Code automatically deletes session transcripts older than 30 days by default through a setting in ~/.claude/settings.json, which means users lose conversation history with minimal storage benefit. One user who had been using Claude Code for 1-2 years realized this setting had caused 90% of their transcripts to disappear, reclaiming less than 1GB of disk space. The user highlighted this setting as something many others may be unaware of and characterized the default cleanup period as indefensible.

Detailed Analysis

A Reddit post in the r/ClaudeCode community has surfaced a largely overlooked default behavior in Claude Code's configuration: the `cleanupPeriodDays` setting in `~/.claude/settings.json`, which automatically deletes session transcript files older than 30 days at each startup. The user discovered this setting only after an extended period of use spanning between one and two years, during which they estimate approximately 90% of their accumulated conversation logs were silently erased — all in exchange for less than one gigabyte of recovered disk space. The setting is documented in Anthropic's official Claude Code settings reference, but its existence and its potentially significant consequences have clearly not penetrated mainstream awareness among the user base.

The technical specifics of the setting reveal a design posture worth scrutinizing. The minimum allowed value is 1 day, and setting the value to 0 — which might intuitively suggest "never delete" — is actively rejected with a validation error. The only pathways to fully preserving session history are to modify `cleanupPeriodDays` to a sufficiently large number, or to understand that transcript writes can be disabled entirely via the `CLAUDE_CODE_SKIP_PROMPT_HISTORY` environment variable. Paradoxically, the latter option eliminates the data rather than preserving it. The setting additionally governs the cleanup of orphaned subagent worktrees, meaning it carries operational consequences beyond simple log hygiene.

The post's author frames the default as an act of quiet paternalism at best, and something more troubling at worst. The charitable interpretation — that Anthropic set the default to 30 days to prevent uninformed users from accumulating unexpectedly large storage footprints — reflects a real product design tension common across developer tooling: protecting novice users from disk bloat versus preserving potentially irreplaceable intellectual artifacts for power users. The less charitable reading, which the user's quoted "Claudius" perspective explicitly raises, is that short transcript retention windows reduce user awareness of the volume and depth of work being silently discarded. Neither interpretation flatters the current default, and the post's resonance suggests the community broadly agrees.

This episode fits into a wider pattern of consequential defaults embedded in AI coding tools that users discover only after meaningful data loss. Unlike traditional IDEs, where session history and project context are treated as durable assets worth preserving, AI-native tools like Claude Code are still converging on norms around persistence, ownership, and transparency of conversational data. The fact that a setting this significant sits quietly in a local JSON configuration file — rather than being surfaced during onboarding or at the point of first meaningful use — reflects an industry-wide immaturity in how agentic AI tools communicate their data lifecycle policies to end users. As Claude Code and its competitors mature, pressure from incidents like this one is likely to push toward more explicit, consent-driven defaults around transcript retention.

Read original article →