fix(framework): worktree-create installs deps so the first commit works#441
Merged
Conversation
A fresh worktree has no node_modules, so its first commit failed the commit-msg hook with "commitlint not found". Install deps best-effort after creating the worktree; a failed install logs and is skipped, never blocking the worktree. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
d29eb19 to
44dc792
Compare
blafourcade
added a commit
that referenced
this pull request
Jul 16, 2026
…ks (#441) A fresh worktree has no node_modules, so its first commit failed the commit-msg hook with "commitlint not found". Install deps best-effort after creating the worktree; a failed install logs and is skipped, never blocking the worktree. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
A fresh worktree has no
node_modules, so its first commit failed thecommit-msghook withcommitlint not found. Hit repeatedly this session.🛠️ How it works
.claude/hooks/worktree-create.jsrunspnpm install --frozen-lockfileafter creating the worktree, best-effort: a failed install logs to stderr and is skipped, never blocking the worktree the user asked for.The hook is internal (
.claude/only, not shipped in a plugin) and this repo is pnpm-only (single lockfile, Makefilesetupuses pnpm), so no package-manager detection is needed.🧪 How to verify
node --check .claude/hooks/worktree-create.js # then, in a Claude worktree: the first commit runs without "commitlint not found"✅ I certify