Skip to content

docs: check a worktree is on the latest origin/main before starting - #533

Merged
theCodeDrift merged 1 commit into
mainfrom
docs/worktree-latest-main
Oct 18, 2026
Merged

theCodeDrift merged 1 commit into
mainfrom
docs/worktree-latest-main

Conversation

@theCodeDrift

Copy link
Copy Markdown
Member

Adds a rule to CLAUDE.md's worktree section: before any work in a worktree, fetch and run git rev-list --count HEAD..origin/main, and rebase onto origin/main if it is behind, before reading code, editing, or running pnpm install.

The WorktreeCreate hook in worktrees-pnpm already branches from a freshly fetched origin/main, but a worktree made any other way (by hand, another tool, a session board) is cut from whatever the main checkout was last pulled to. One started 68 commits behind main this week, and nothing flagged it.

Docs only; no changeset.

The WorktreeCreate hook branches from a freshly fetched origin/main, but a
worktree made any other way is cut from whatever the main checkout was last
pulled to. One started 68 commits behind main with nothing flagging it.
Fetch and compare before reading code, and rebase before pnpm install.
@theCodeDrift
theCodeDrift merged commit 12aa284 into main Oct 18, 2026
8 checks passed
@theCodeDrift
theCodeDrift deleted the docs/worktree-latest-main branch October 18, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant