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
baseChangesetwhen no HEAD commit is available for hook-based worktrees, and threads it along withsessionDirthrough 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.