{"version":"2.1.321","anchor":"worktree-startup-errors-routed-through-a-common-exit-helper","canonical_anchor":"worktree-startup-errors-routed-through-a-common-exit-helper","heading":"--worktree startup errors now go through Claude Code's shared exit routine","tier":"internal","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.321\/e\/worktree-startup-errors-routed-through-a-common-exit-helper","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.321","markdown":"### `--worktree` startup errors now go through Claude Code's shared exit routine\n\nWhen `--worktree` fails outside a git repository, or cannot find the repository root, Claude Code now exits through its shared exit routine\n\n**What**\n\n`--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`.\n\n**Why**\n\nRouting these errors through the shared routine likely means the failure is recorded before Claude Code quits.\n\n- Area: Worktrees\n- Names: `--worktree`\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 0\/5\n- Scope: individual\n- Heads-up: no"}