[DOCS] Claude directory swept-paths table omits `.claude/worktrees/` for background agent worktrees
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/claude-directory
Section/Topic
"Application data" > "Cleaned up automatically" table (lists paths under ~/.claude/ that the cleanupPeriodDays sweep removes on startup).
Current Documentation
The swept-paths table currently lists these directories under ~/.claude/:
| `projects/<project>/<session>.jsonl` | Full conversation transcript |
| `projects/<project>/<session>/subagents/` | Subagent conversation transcripts |
| `projects/<project>/<session>/tool-results/` | Large tool outputs |
| `file-history/<session>/` | Pre-edit snapshots |
| `plans/` | Plan files |
| `debug/` | Debug logs |
| `paste-cache/`, `image-cache/` | Large paste/image caches |
| `session-env/` | Session environment metadata |
| `tasks/` | Task lists |
| `shell-snapshots/` | Captured shell environment |
| `backups/` | Config backups |
| `feedback-bundles/` | Redacted transcript archives |
| `todos/`, `statsig/`, `logs/` | Legacy directories |
What's Wrong or Missing?
The .claude/worktrees/ directory — where background agent worktrees are stored — is not listed in the swept-paths table. Background agents create worktrees under this path, and the cleanupPeriodDays sweep (default 30 days) is expected to clean them up at startup when they are older than the configured retention period.
The Worktrees page documents the general sweep behavior for subagent worktrees at line 93:
Subagent worktrees orphaned by a crash or interrupted run are removed at startup once they are older than your cleanupPeriodDays setting
But the swept-paths table in the Claude directory reference — the canonical list of all ~/.claude/ paths covered by automatic cleanup — omits the worktrees/ entry.
As of v2.1.157, background agent worktrees under .claude/worktrees/ that were orphaned after the sweep are now properly cleaned up. The swept-paths table should reflect that this path is covered.
Suggested Improvement
Add a row to the "Cleaned up automatically" table:
| `worktrees/` | Worktree directories created by background agents, cleaned up once older than `cleanupPeriodDays` |
Insert it alphabetically after the tasks/ row and before shell-snapshots/, or at the end of the list.
Impact
Low - Minor confusion or inconvenience
Additional Context
Affected Pages:
| Page | Section | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/claude-directory | "Cleaned up automatically" table | Missing worktrees/ row |
Total scope: 1 page affected
The cleanupPeriodDays setting defaults to 30 days. The Worktrees page (https://code.claude.com/docs/en/worktrees) references this sweep but the Claude directory page (the authoritative catalog of swept paths) is missing the entry.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗