In ~/.claude/settings.json, if you don't set cleanupPeriodDays (see docs) explicitly to a very large number of days, then it will default to 30, and Claude Code will automatically permanently delete all sessions older than that on each startup. (Note: Don't set it to 0, because then all your data will be deleted instantly and no new data will be recorded!)
We should show a big loud banner in the CLI if cleanupPeriodDays isn't explicitly set very high.