claude-code - 💡(How to fix) Fix [DOCS] cleanupPeriodDays retention docs omit tasks, backups, and shell-snapshots [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51779Fetched 2026-04-22 07:53:04
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

Session files older than this period are deleted at startup (default: 30 days, minimum 1). Setting to 0 is rejected with a validation error. Also controls the age cutoff for automatic removal of orphaned subagent worktrees at startup. Users who rely on shared task lists can discover the on-disk path, but the docs do not warn that old task-list data is now swept by cleanupPeriodDays.

Root Cause

That now contradicts the changelog behavior because ~/.claude/backups/ is part of the cleanupPeriodDays retention sweep.

RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/claude-directory

Section/Topic

Application data → “Cleaned up automatically” and “Kept until you delete them”, plus the cleanupPeriodDays setting description

Current Documentation

The docs currently say:

Files in the paths below are deleted on startup once they're older than cleanupPeriodDays. The default is 30 days.

projects/<project>/<session>.jsonl projects/<project>/<session>/tool-results/ file-history/<session>/ plans/ debug/ paste-cache/, image-cache/ session-env/

They also say:

The following paths are not covered by automatic cleanup and persist indefinitely.

backups/ | Timestamped copies of ~/.claude.json taken before config migrations

And on the same page:

shell-snapshots/ holds runtime files removed when the session exits cleanly.

Other docs identify the task-list directory but do not mention retention cleanup:

To share a task list across sessions, set CLAUDE_CODE_TASK_LIST_ID to use a named directory in ~/.claude/tasks/

Task list: ~/.claude/tasks/{team-name}/

The cleanupPeriodDays row in settings currently says only:

Session files older than this period are deleted at startup (default: 30 days, minimum 1). Setting to 0 is rejected with a validation error. Also controls the age cutoff for automatic removal of orphaned subagent worktrees at startup.

What's Wrong or Missing?

Changelog v2.1.117 says: “The cleanupPeriodDays retention sweep now also covers ~/.claude/tasks/, ~/.claude/shell-snapshots/, and ~/.claude/backups/”.

The current docs do not reflect that expanded sweep:

A. backups/ is described as persisting indefinitely

That now contradicts the changelog behavior because ~/.claude/backups/ is part of the cleanupPeriodDays retention sweep.

B. shell-snapshots/ is described only as clean-exit cleanup

The docs imply shell-snapshots/ is removed only when a session exits cleanly, but v2.1.117 adds age-based startup cleanup through cleanupPeriodDays.

C. tasks/ is documented as a storage location, but not as retained data subject to cleanup

Users who rely on shared task lists can discover the on-disk path, but the docs do not warn that old task-list data is now swept by cleanupPeriodDays.

This is a data-retention behavior change, so users need accurate expectations about which ~/.claude directories persist and which are automatically deleted.

Suggested Improvement

Update the retention documentation to match v2.1.117:

  1. In claude-directory, add tasks/, shell-snapshots/, and backups/ to the age-based cleanup coverage described under cleanupPeriodDays.
  2. Remove or revise the statement that backups/ is “not covered by automatic cleanup and persist[s] indefinitely.”
  3. Revise the shell-snapshots/ note so it explains both cleanup paths: clean session exit and age-based startup cleanup.
  4. Expand the cleanupPeriodDays row in settings so it explicitly lists the additional directories now covered.
  5. Consider adding a short note in task-list docs that shared task-list directories under ~/.claude/tasks/ are also subject to cleanupPeriodDays retention.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/claude-directoryMain retention and application-data page; currently says backups/ persists indefinitely and only gives a clean-exit note for shell-snapshots/
https://code.claude.com/docs/en/settingscleanupPeriodDays setting description should mention the newly covered directories
https://code.claude.com/docs/en/interactive-modeDocuments shared task lists under ~/.claude/tasks/ but does not mention retention cleanup
https://code.claude.com/docs/en/agent-teamsDocuments team task lists under ~/.claude/tasks/{team-name}/ but does not mention retention cleanup

Total scope: 4 pages affected

Source: Changelog v2.1.117

Exact changelog entry: The cleanupPeriodDays retention sweep now also covers ~/.claude/tasks/, ~/.claude/shell-snapshots/, and ~/.claude/backups/

extent analysis

TL;DR

Update the documentation to reflect the changes in cleanupPeriodDays retention sweep to include ~/.claude/tasks/, ~/.claude/shell-snapshots/, and ~/.claude/backups/.

Guidance

  • Review the affected pages (claude-directory, settings, interactive-mode, and agent-teams) to ensure consistency in describing the cleanupPeriodDays retention sweep.
  • Update the cleanupPeriodDays setting description to explicitly list the additional directories now covered.
  • Revise the documentation for backups/ to remove the statement that it persists indefinitely.
  • Add a note to the task-list documentation to warn users that shared task-list directories under ~/.claude/tasks/ are subject to cleanupPeriodDays retention.

Example

No code snippet is necessary for this issue, as it is a documentation update.

Notes

The changes should be made to the following pages: https://code.claude.com/docs/en/claude-directory, https://code.claude.com/docs/en/settings, https://code.claude.com/docs/en/interactive-mode, and https://code.claude.com/docs/en/agent-teams.

Recommendation

Apply the suggested improvements to update the retention documentation to match the changes in v2.1.117, as this will ensure that users have accurate expectations about data retention behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [DOCS] cleanupPeriodDays retention docs omit tasks, backups, and shell-snapshots [1 participants]