I counted my Claude Code sessions since January: 920 of them, almost 800 hours of hands-on work. Then I looked for the conversations behind them, and 820 were gone. That's wild!
For those 820, Claude Code kept only the prompts I typed. Claude's replies, the files it read, the commands it ran and the dead ends are gone, and claude --resume can't open them unless you kept a copy of the transcript somewhere else.
Claude Code's 30-day cleanup
Claude Code deletes a session's transcript once it's older than cleanupPeriodDays, and the default is 30. Sessions started or last continued in Claude Desktop or Cowork are the exception: since v2.1.248 they're kept at any age. The transcript is the file ~/.claude/projects/<project>/<session>.jsonl, with every message, tool call and result in it. The cleanup runs in the background after a session starts (settings reference, Claude Code docs).
So my own new sessions quietly deleted every transcript older than 30 days. On September 27, only 100 of my 920 sessions still had a transcript, and 98 of those were from the last month.
The 30-day cleanup never touches ~/.claude/history.jsonl. It keeps every prompt you've typed in the terminal, with the time, the project folder and the session. That's why I could still count all 920 sessions and time them, but it only has my side of each conversation.
Keep transcripts for ten years with cleanupPeriodDays
The lazy developer edition is one line of settings. Do it before your next session, because that's when the next cleanup runs.
Paste this into Terminal. It adds
"cleanupPeriodDays": 3650to~/.claude/settings.json, keeps any settings already there, and creates the file if it's missing:f=~/.claude/settings.json; [ -f "$f" ] || echo '{}' > "$f"; jq '.cleanupPeriodDays = 3650' "$f" > "$f.tmp" && mv "$f.tmp" "$f"It uses
jq, which recent versions of macOS include at/usr/bin/jq. Ifjq --versionsays command not found, runbrew install jq, or edit the file by hand. The line goes inside the outer braces:Start Claude Code and check the setting took:
/statusIf Claude Code can't read your settings file or finds an error in it, a warning shows here. The cleanup pauses until you fix it (docs).
3650 days is ten years. You can't set 0 to mean "never": the minimum is 1, and 0 fails validation (settings reference).
Deleted transcripts stay deleted
The setting only stops future deletes. It can't bring back anything the cleanup already took, which for me was more than 800 sessions. Other things it doesn't cover:
- If your company sets
cleanupPeriodDaysin managed settings, their number wins over yours, and the cleanup runs at their number even when your settings file has an error. - Transcripts are plain text, and anything a tool touched is in them: file contents, command output, whatever you pasted. A key that passed through a session stays on disk for as long as you keep the transcript (plaintext storage).
- They take space. My biggest transcript is about 150 MB.
- It isn't a backup. The files stay in
~/.claude, andclaude project purgestill deletes a project's transcripts (clear local data).
Shabash keeps a copy of each transcript
Shabash, the Mac app I'm building, saves a compressed copy of each Claude Code transcript in ~/.shabash/archive before the cleanup can take it. When you resume a session from Shabash and its transcript is gone, Shabash puts the copy back first, so claude --resume opens it again.
It only started keeping copies on September 25, two days before I counted, so it saved 11 of my 820. The other 809 are gone for good.
785 hours in 920 sessions
I counted from history.jsonl, since it's the one file that goes back to my first prompt. It covers January 10 to September 25, in more than 20 project folders. I counted a session if I typed at least one real prompt in it, so I left out 36 where I only ran a command like /clear.
Hours are hands-on time. After each prompt, I counted the minutes until my next prompt in any session, so five sessions open at once don't count five times. If my next prompt came more than 15 minutes later, I counted that as a break. I can't tell how long I really spent on the prompt before a break, so it gets a flat 4 minutes.
| Sessions | 920 |
| Hands-on hours | 785 |
| Median session | 18 minutes, 7 prompts |
| Sessions over two hours | 102 |
| Longest session | about 14½ hours |
| Most sessions I typed into within 15 minutes | 11 |
| Sessions with a transcript left on September 27 | 100 |
785 hours is almost 20 full work weeks! You can count your hours the same way: drop your history.jsonl into this free page. It reads the file in your browser and uploads nothing.
The page counts up to the moment you load it, and it includes the sessions where you only typed a command. When I loaded it late on September 27, it showed 801 hours in 980 sessions: the same method, plus September 26 and 27.

