claude-code - 💡(How to fix) Fix [DOCS] Windows background-session worktree cleanup docs omit NTFS junction safety

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…
RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/agent-view

Section/Topic

Deleting background sessions and the related worktree-cleanup guidance

Current Documentation

The docs currently say:

Deleting removes the session from agent view. If Claude created a worktree for the session, deleting removes that worktree too, including any uncommitted changes in it, so push or commit work you want to keep first. A worktree you created yourself and started the session inside is left in place.

The worktree cleanup page also says:

Uncommitted changes, untracked files, or new commits exist: Claude prompts you to keep or remove the worktree. Keeping preserves the directory and branch so you can return later. Removing deletes the worktree directory and its branch, discarding any uncommitted changes, untracked files, and commits

What's Wrong or Missing?

Changelog v2.1.146 includes a Windows-specific safety fix:

Fixed on Windows, removing a background-job worktree no longer follows NTFS junctions into the main repo.

The current docs still describe background-session and worktree removal as straightforward deletion, but they do not explain the Windows-specific safeguard around NTFS junctions.

That leaves two gaps:

A. Windows junction traversal behavior is undocumented

The docs do not say that background-session worktree removal on Windows now avoids following NTFS junctions that point back into the main repository.

B. The cleanup risk model is incomplete for repos that use linked directories

Users who rely on Windows junctions or linked directories to share content between the main checkout and Claude-created worktrees have no documentation telling them that cleanup is now bounded to the worktree instead of traversing into the main repo.

Suggested Improvement

Add a short Windows-specific note anywhere the docs describe deleting a background session or removing a Claude-created worktree.

Suggested wording:

On Windows, Claude does not follow NTFS junctions when removing a background-session worktree. If a worktree contains a junction that points back into your main repository or another directory, cleanup removes the worktree entry itself without traversing into the junction target.

Add a cross-reference from the general worktree cleanup page so the same safety behavior is documented outside agent view.

Impact

High - Prevents users from using a feature

Additional Context

Affected Pages:

PageLine(s)Context
https://code.claude.com/docs/en/agent-view184-186, 333, 476, 484Explains deleting background sessions and removing Claude-created worktrees, but not the Windows NTFS junction safeguard
https://code.claude.com/docs/en/worktrees85-89Explains removing worktrees but does not mention Windows junction traversal limits during cleanup
https://code.claude.com/docs/en/settings282-284Documents worktree.symlinkDirectories and worktree.bgIsolation, which are relevant cross-references for users managing linked directories and background-session worktrees

Total scope: 3 pages affected

Version: v2.1.146

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] Windows background-session worktree cleanup docs omit NTFS junction safety