Rootz ArchiveInstall, free for individual users

Claude Code · conversation history

Claude Code deletes your conversations after 30 days. Here's why, and how to keep them.

Short answer: by default, Claude Code deletes a session's transcript once it is older than 30 days, under the cleanupPeriodDays setting. It does this without a message. You can raise the setting; to keep an exact, searchable copy whatever the setting, use an archive.

What the setting does

Anthropic's documentation: Claude Code "deletes the files in the paths below once they're older than cleanupPeriodDays… The default is 30 days and the minimum is 1; setting 0 fails with a validation error." (Explore the .claude directory)

Exactly what gets deleted

Under ~/.claude/What it is
projects/<project>/<session>.jsonlThe full conversation: every message, tool call and tool result
projects/<project>/<session>/subagents/Sub-agent conversations, removed with their parent session
projects/<project>/<session>/tool-results/Large tool outputs saved to separate files
file-history/<session>/Snapshots of files Claude changed, for checkpoint restore. Even before the sweep, only the 100 most recent checkpoints are kept
plans/, paste-cache/, debug/ and othersPlan files, large pastes, debug logs

Not swept by age: your auto memory files, and (since Claude Code v2.1.248) sessions you started or last continued in Claude Desktop or Cowork, unless managed settings set cleanupPeriodDays. Sessions from the terminal and IDE are the ones that go.

Can I get them back?

Only from a backup of your own, such as Time Machine. Claude Code keeps no second copy. The GitHub issue #59248 collects reports from people who lost months of sessions this way, and a small community tool (restore-claude-history) helps restore from a Time Machine backup on macOS.

Stop it now

Raise the retention period in your user settings file, ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json):

{
  "cleanupPeriodDays": 36500
}

If your organisation deploys managed settings that set cleanupPeriodDays, those apply instead. If a settings file can't be read, Claude Code pauses the sweep and shows a warning in /status.

Why a setting isn't a record

Keep an exact copy with Rootz Archive

Rootz Archive is a Claude Code plugin, free for individual users. It keeps an exact, byte-for-byte copy of every Claude Code conversation (including everything before each compaction, sub-agent conversations and every file Claude edits) on your own computer, fingerprinted with SHA-256, and lets your AI search it. It sends nothing to Rootz.

claude plugin marketplace add rootz-global/rootz-archive
claude plugin install rootz-archive@rootz

Then start a new Claude Code session and type /rootz-archive:accept. Nothing is captured before you do. It needs Node.js 22.13 or newer.

Questions

Does /clear delete my history?

No. Claude Code saves the previous conversation when you run /clear, and you can return to it with /resume. It is still deleted by the 30-day sweep later.

Are Claude Desktop sessions deleted too?

Since Claude Code v2.1.248, sessions you started or last continued in Claude Desktop or Cowork are kept at any age by default. You can give them a limit with desktopSessionCleanupPeriodDays. Managed settings that set cleanupPeriodDays make them follow that limit instead.

Does Rootz Archive upload my conversations?

No. Rootz Archive keeps its copy under ~/.rootz-archive/vault on your computer and sends nothing to Rootz. When your AI reads an answer from the archive, that text goes to your AI's provider, as anything you show it does.

Your AI will forget. Your archive won't. See what Rootz Archive keeps and which AI tools work with it.

Facts from Anthropic's documentation as of October 2026. Written with Claude, reviewed by Rootz.