Agent worktrees can now be force-removed, deleting all their files after verifying they're linked worktrees, not standalone repos
Cleaning up a git worktree used for an agent (a separate working copy of a repository, stored under .claude/worktrees) now supports a forced, destructive removal path. It deletes all files in the worktree directory except a verified .git file, then removes the directory itself. Before doing this, it checks that the target is actually a linked worktree, meaning it has a .git file pointing elsewhere rather than being a standalone repository with its own full history. If the deletion only partially succeeds, the .git gitlink pointer is restored.
This lets Claude Code fully clean up an agent's worktree when needed, while the standalone-repo check guards against accidentally deleting the only copy of a repository's history, and the pointer restoration protects against leaving things in a broken half-deleted state if something goes wrong partway through.