Under the hoodTier: how much it should matter to you
1Useful: my rating, 1 to 5
0Signal: worth watching, 1 to 5
WorktreesArea: what it touches
Internal ChangesKind: in v2.1.321,
Internal ChangesSection of the release
What
--worktree starts Claude Code in a separate git worktree, a second working copy of a repository. It fails in two cases: when the folder is not a git repository, and when the top folder of the repository cannot be found. Both errors used to print a message and quit straight away. They now go through the shared routine Claude Code uses to exit, and each carries its own code: worktree_not_git and worktree_no_repo_root.
Why
Routing these errors through the shared routine likely means the failure is recorded before Claude Code quits.
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agreeImproved the agent view's row for a claude --bg --worktree session that couldn't set up its worktree: it now shows the error from its…