Desktop: archiving an SSH session does not remove its clean worktree

Status Open
Reported on v2.1.294
Maintainer reply None cached
Activity 0 comments · opened Oct 11, 2026

Per the desktop docs, "To remove a worktree when you're done, hover over the session in the sidebar and click the archive icon." For SSH sessions this doesn't happen on my setup: the worktree directory and its branch stay on disk after archiving, even when there is nothing to lose.

Environment

  • Claude Desktop (Code tab), SSH connection to a Linux host (Ubuntu, kernel 6.8)
  • Claude Code 2.1.294 on the remote host
  • Sessions started with the worktree option; default location <repo>/.claude/worktrees/

Steps

  1. Start an SSH session with the worktree option.
  2. Commit in the worktree, fast-forward main to the branch locally, push main.
  3. Archive the session from the sidebar.

Expected: the worktree and its branch are removed, since there are no uncommitted changes and no unpushed commits.

Actual: both remain. git worktree list still shows the worktree, the directory exists, the branch exists.

Data (2026-10-11): in one repo, 7 of 7 archived sessions still have their worktrees. Each one has an empty git status --porcelain, 0 commits outside main, and 0 commits outside origin/main. Two more worktrees in a second repo behaved the same way.

The app's storage tools (Settings › Storage cleanup, kept-worktree discard) are documented as local-only, so there is no in-app way to clean these up for SSH sessions. Auto-archive is also documented as local-only.

View original on GitHub ↗