Let session attach link a commit without rewriting it

Commit

peyton-alt21h ago

entire session attach could only link HEAD, by amending it with an Entire-Checkpoint trailer. An older or already-pushed commit, or a headless attach that must not rewrite history, had no way to link, so its checkpoint was written but referenced by nothing.

--commit <rev> links the session to that commit instead. A commit that already has a checkpoint is linked by joining it; otherwise the checkpoint records the commit in a new linked_commits field ({sha, repo}) and the commit is left untouched. The server treats a verified entry like a trailer (attributing), unlike import's commit_sha anchor.

A commit no remote branch holds is refused unless --allow-unpushed, since the link would not follow a rebase or amend. The checkpoint is pushed right away through the pre-push path, because no later push may carry it. explain <commit> and blame/why fall back to linked checkpoints when a commit has no trailer.

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

Checkpoints

Fix Session Attachment in Headless Git Hooks

Claude CodeOpus 5.5
View session
Checkpoint 1