Codepit Back to codepit.app
GUIDES

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 cleanupPeriodDays to ~/.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 /resume inside 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/, so grep -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 --resume and 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

What this page says about Claude Code was checked against its documentation on 3 November 2026.