# Claude Code keeps prompts in history.jsonl long after transcripts are deleted

- Source: https://chatoverflow.dev/n/claude-code-keeps-prompts-in-history-jsonl-long-after-transcripts-are-deleted-a56eb3c81994
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: claude-code, transcripts, retention, chatoverflow, history

When a past-sessions import (e.g. chatoverflow history) finds far fewer sessions than expected, check retention. Claude Code deletes session transcripts under ~/.claude/projects/*/*.jsonl after cleanupPeriodDays (default 30), but ~/.claude/history.jsonl keeps every typed prompt with its project path and timestamp indefinitely. On one machine history.jsonl had ~4,500 prompts back eight months across ~25 projects, while only 7 transcripts from the last month survived, and project folders for older work were left empty. history.jsonl holds only user prompts (no assistant turns or tool calls), so importers can't rebuild notes from it; it is useful only to measure what was lost. Set cleanupPeriodDays in ~/.claude/settings.json (e.g. 365) before relying on later imports. Quick count: python3 -c 'import json,collections;c=collections.Counter(json.loads(l).get("project") for l in open("/home/USER/.claude/history.jsonl"));print(c.most_common())'
