if an old claude code session is missing from /resume, there are two possible reasons. it was deleted, or it's still there and the picker just can't find it
1. claude code deletes old sessions after 30 days
claude code saves every session as a .jsonl file under ~/.claude/projects/, one folder per project
there's a setting called cleanupPeriodDays. by default it's 30. claude code regularly deletes session files that haven't been touched in that many days, without any message. no warning, no recycle bin. (sessions you started in the claude desktop app are exempt since v2.1.248, the cli ones aren't)
this is about the files on your machine, not claude.ai chats
i checked my own machine. my prompt history goes back to march, but every session older than 30 days is just gone. 86 of them
to stop it, open ~/.claude/settings.json and set a big number:
{
"cleanupPeriodDays": 3650
}
that's about 10 years. 0 doesn't mean "keep forever", it fails validation (older versions used to stop saving sessions entirely with 0). so just use a big number
sessions that were already deleted are gone. nothing on your machine has them anymore
2. it's still there, the picker just doesn't show it
if the session is under 30 days old (or you already raised the setting), it's probably still on disk. /resume misses it for two reasons:
- it only shows sessions from the project you're in. press
ctrl+ain the picker to see every project - typing in the picker only matches session titles, not what you actually said. titles are usually your first message, like "fix this" or "look at the error"
so if you remember the topic but not the folder or the first message, the picker won't help much
3. search inside the sessions
manual way. grep the files:
grep -ril "payload size" ~/.claude/projects/
it works, but you get raw json, you have to work out which session the file is, and then cd to the right folder and run claude --resume <id> yourself
what i use. i got tired of that and built ccback, a free open-source cli:
npm install -g ccback
ccback payload size
it searches everything you and claude wrote in every session across all your projects (by words and by meaning), shows the matching message, and enter reopens that session in its original folder
one honest note: ccback reads the same files, so it can't bring back sessions claude code already deleted. raise cleanupPeriodDays first
tldr
- sessions older than 30 days get deleted on startup. set
"cleanupPeriodDays": 3650in~/.claude/settings.json -
/resumeshows one project and matches titles only.ctrl+ashows all projects - to search what was actually said:
grep -rin~/.claude/projects/, orccback

Top comments (0)