Claude Code Deletes Your Local Context History After 30 Days
Get the Tech newsletter
Daily tech — startups, AI labs, chips, the launches that shape the next decade. Free.
- Claude Code stores session transcripts locally in plaintext under ~/.claude/projects/ for 30 days by default, with the period adjustable via the cleanupPeriodDays setting.
- Consumer users (Free, Pro, Max) who allow data use for model improvement get 5-year retention, while those who opt out face the 30-day standard.
- Enterprise customers default to 30-day retention; zero data retention (ZDR) is available only to qualified accounts on a per-organization basis and is not included in the standard plan.
- Anthropic does not train models on data from commercial users (Team, Enterprise, API, 3rd-party platforms) unless they explicitly opt into the Development Partner Program.
- Claude Code's /feedback command retains conversation transcripts for 5 years, with source code and file contents uploaded as-is beyond known API key and token redactions.
- Third-party platform users on Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry have error reporting, telemetry, and bug reporting disabled by default.
Why it matters: The 30-day local cache default is the most user-visible practice, but the more consequential split is commercial vs. consumer: enterprises can pursue ZDR while Free/Pro/Max users who allowed training are locked into 5-year retention with no documented fast-out. Source code uploaded via /feedback bypasses redaction beyond API keys and tokens, making that command a higher-exposure channel than the cache itself.




