{"version":"2.1.300","anchor":"pr-worktree-fetch-verifies-the-fetched-ref-tengu-melodic-oc","canonical_anchor":"pr-worktree-fetch-verifies-the-fetched-ref-tengu-melodic-oc","heading":"Worktrees made from a PR number now check they got the right PR","tier":"notice","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.300\/e\/pr-worktree-fetch-verifies-the-fetched-ref-tengu-melodic-oc","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.300","markdown":"### Worktrees made from a PR number now check they got the right PR\n\nWhen `--worktree` uses a pull or merge request number, Claude Code fetches the full PR reference and refuses if it can't tell which commit is meant\n\n**What**\n\nA worktree is a second working copy of a git repository in its own folder. With `--worktree`, Claude Code can create one from a pull request (PR) or merge request (MR) number. It now handles this more strictly:\n\n- It fetches the full reference name, `refs\/pull\/N\/head` or `refs\/merge-requests\/N\/head`, instead of a short name\n\n- It checks that the fetched result came from that reference on the expected remote\n\n- It refuses if both kinds of reference exist and point at different commits\n\n- It refuses if it cannot check the other kind of reference\n\n- It uses the exact commit it fetched, not whatever git last recorded as fetched\n\nWhen it refuses, the error starts with `Cannot use PR\/MR #N:` followed by the reason. This is on by default in the code unless it is switched off remotely. When it is off, Claude Code uses the old short names.\n\n**Why**\n\nA branch or tag that happens to have a name like a PR reference can no longer be mistaken for the PR itself, so the worktree is based on the code you asked for.\n\n- Flag `tengu_melodic_octopus`: Not enough to say (read for one account on one subscription tier against v2.1.300; this account: no value returned, anonymous baseline: no value returned, compiled default: on) These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release.\n- Area: Worktrees\n- Names: `--worktree`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}