Accept <repo>/<number> selectors for project trail branch work

Commit

Soph6h ago

In project mode, a positional or --trail selector of the form <repo>/<number> (cli/1503, the tail of a change's web URL) names one repository's branch work. It is looked up by its repository-local number in --project, or origin's owner, and its parent names the trail, so no collection lookup is needed. Branch-level commands act on that work; show, update, and comment act on its trail. It cannot be combined with --branch, and an explicit --repo must name the same repository. Legacy mode is unchanged: there a slash is a branch name and a bare number is already repository-local work.

The containment check now compares a merged change's original_branch, since its change read returns branch null. Without that, every branch-level command failed for merged work.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M491QESHN7RFPQWK1ASBV46T

Checkpoints

Refactor Trail Models for Project Migration

Claude CodeOpus 5.5
View session
Checkpoint 1