How to find and keep old Claude Code chats
Claude Code keeps your chats as files on your computer for 30 days by default. After that it deletes them without a message, and they simply stop showing up in the list.
With Claude Code alone
- Keep them longer. Add
cleanupPeriodDaysto~/.claude/settings.json, next to whatever is already in that file. It takes whole days, so this is about ten years. Do it soon: it cannot bring back what is already gone.
{
"cleanupPeriodDays": 3650
}
- Find one by its name.
claude --resume, or/resumeinside a session, opens a list you can type in to search. It starts with the current project, and Ctrl A widens it to every project on this computer. - Search the words. Chats are plain text files under
~/.claude/projects/, sogrep -rl "the words" ~/.claude/projects/lists the ones that contain them.
In Codepit
- Search every chat. The search box in the chat's history looks through the words of all your chats, in every project.
- Keep chats forever. One switch in Settings. It sets that same key in your own Claude Code settings and changes nothing else in the file, so it holds in the terminal too.
- One history. Codepit uses the chats Claude Code keeps, so
claude --resumeand Codepit see the same conversations. - Delete with a way back. Every chat has a bin. A deleted chat waits under Deleted on every computer for 48 hours, in case you want it back.
More guides
How to review Claude Code's changes, line by lineIts own prompts, git and /rewind, or Keep and Undo on each change.
The same Claude Code chat on two computersReach a chat from your other computer, or move it there with your code.
How to use Claude Code from your iPhoneFollow a job, answer a question or allow a command away from your desk.
How to stop a runaway Claude Code chatA long chat can use up your 5-hour limit while you are away.
What this page says about Claude Code was checked against its documentation on 3 November 2026.