[Bug] Project files deleted despite cleanupPeriodDays set to 1825

Status Closed — not planned
Maintainer reply None cached
Activity 14 comments · opened Dec 31, 2025 · closed Mar 15, 2026

Bug Description
"cleanupPeriodDays": 1825,

but

find ~/.claude/projects/ -mtime +30 |wc 
      0

we have 4-year retention requirements. What deleted these? It wasn't us...

Environment Info

  • Platform: linux
  • Terminal: vte-based
  • Version: 2.0.69
  • Feedback ID: 1e47d300-5c94-4f99-ae46-b69c08ce509f

Errors

[]

View original on GitHub ↗

14 Comments

github-actions[bot] · 8 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/4172

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

KJ7LNW · 8 months ago

That's related, but it's a different issue. We have the setting to have a maximum cleanup period much larger than the default, but it's still deleting them:

// .claude/settings.json
{
  "cleanupPeriodDays": 1825,
KJ7LNW · 8 months ago

@JGKle, Is Claude still respecting this setting?

JGKle · 8 months ago

Yes, I've not had it delete any data since adjusting the setting.

KJ7LNW · 8 months ago

is this where you have it?

// .claude/settings.json
{
  "cleanupPeriodDays": 1825,
JGKle · 8 months ago

Yes...set to 99999

KJ7LNW · 8 months ago

Okay, well I set mine to 99999 as well. I wonder why 1825 is not working. Mine is clearly resetting to 30 days. Okay, well I set mine to 99999 as well. For now, I have an RSync cron script so that we can meet our internal policy requirements, but I think there's a bug somewhere, at least in the version I'm using above.

VibeCodingWW · 7 months ago

Confirming this bug on Linux, currently running Claude Code 2.1.1.

Our experience:

  • Had cleanupPeriodDays: 99999 set
  • Recently noticed all conversation files older than 30 days were gone
  • Changed setting to 365 to test if a more "reasonable" value would work
  • Restored 2 conversation files from backup with timestamps 48 days old
  • Verified files existed on disk
  • Restarted Claude Code
  • Both files immediately deleted despite cleanupPeriodDays: 365

Current state:

  • Oldest file on disk is exactly 30 days old
  • Setting appears completely ignored regardless of value (tested 99999 and 365)

Unknown: We can't confirm whether this setting ever worked and recently broke, or if it never worked. We only noticed the missing files recently.

Using external backup scripts as a workaround for now.

knksmith57 · 7 months ago
Confirming this bug on Linux, currently running Claude Code 2.1.1. Our experience: Had cleanupPeriodDays: 99999 set Recently noticed all conversation files older than 30 days were gone Changed setting to 365 to test if a more "reasonable" value would work Restored 2 conversation files from backup with timestamps 48 days old Verified files existed on disk Restarted Claude Code Both files immediately deleted despite cleanupPeriodDays: 365 Current state: Oldest file on disk is exactly 30 days old * Setting appears completely ignored regardless of value (tested 99999 and 365) Unknown: We can't confirm whether this setting ever worked and recently broke, or if it never worked. We only noticed the missing files recently. Using external backup scripts as a workaround for now.

I believe this has regressed _again_.

This time, I'm concerned that the behavior may have been intentional unauthorized removal: #16978

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

KJ7LNW · 6 months ago

Unless someone sp has specifically verified this, we can only assume that it is still happening.

kyzzen · 6 months ago

It is still happening for me as well.

github-actions[bot] · 5 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.