history.jsonl grows unbounded in plaintext and is exempt from cleanupPeriodDays
Summary
~/.claude/history.jsonl accumulates every prompt ever typed, in plaintext, and is explicitly exempt from cleanupPeriodDays. There is no documented setting to bound it.
Why this matters
The ~/.claude directory docs list history.jsonl under "Kept Until You Delete (No Auto Cleanup)", and separately note that transcripts and history are not encrypted at rest — OS file permissions are the only protection.
The same page recommends lowering cleanupPeriodDays to limit exposure of sensitive data. That advice doesn't cover history.jsonl, which is arguably the higher-value target: it is a single file containing the complete prompt history across every project on the machine, with timestamps and project paths.
Transcripts age out at 30 days by default. Prompt history never does.
Observed
On a machine in routine use:
$ wc -l ~/.claude/history.jsonl
333 /Users/home/.claude/history.jsonl
333 prompts spanning months, including prompts from projects since deleted. Setting cleanupPeriodDays: 30 had no effect on it, which matches the documented behavior.
Expected
One of:
- A
historyRetentionDayssetting (or foldhistory.jsonlintocleanupPeriodDays), or - A documented, supported way to prune it without breaking up-arrow recall /
Ctrl+Rsearch, or - An explicit note in the privacy guidance that
history.jsonlmust be managed manually, with a safe command to do so
Option 1 seems most consistent with how the rest of ~/.claude already works.
Workaround
Truncating the file works but silently discards all history-search state, and nothing in the docs confirms this is safe or supported.
Environment
- Claude Code 2.1.273, macOS 15 (Darwin 25.6.0)
cleanupPeriodDays: 30set in~/.claude/settings.json