Follow Discord
Sweep 22 Sep 2026 · 17:19Z Build v2.1.280 501 read Stable v2.1.267 Latest v2.1.280 Next v2.1.280 Feeds RSS JSON llms.txt Unofficial
Claude Code v2.1.271 ·

Hook-based worktree sessions get better changeset tracking and safer cleanup

Hook-based subagent worktrees now track their real path and changeset more reliably and skip unneeded git work

TierYou'll noticehow much it should matter to you
Useful2my rating, 1 to 5
Signal1worth watching, 1 to 5
AreaWorktreeswhat it touches
KindImprovementsin v2.1.271,
Group of 4 You'll notice

Hook-based subagent worktrees now track their real path and changeset more reliably and skip unneeded git work

What

  • When spawning a subagent with isolation: 'worktree' on a hook-based worktree, Claude Code now resolves and stores the worktree's real path (vettedRealPath) after creation, logging a warning and keeping the worktree around at cleanup time if that resolution fails.
  • Worktree creation now computes a baseChangeset when no HEAD commit is available for hook-based worktrees, and threads it along with sessionDir through the worktree's metadata for later dirty-check comparisons.
  • The confirmation message shown before discarding a worktree with uncommitted work can now note that commits made in the worktree are already stored server-side (with a changeset id) and won't be lost by removing it.
  • When exiting a worktree with the "keep" action, if the session is hook-based and already has a recorded originalChangeset, Claude Code now skips re-running the git status/diff commands used to compute changed files and commits.

Why

These changes make hook-based worktree sessions (used in managed/cloud setups without a normal git HEAD) track their state more reliably and avoid unnecessary git work or misleading warnings about losing uncommitted changes.

See this entry in the whole of v2.1.271 →

Feedback