Skip to content

fix(framework): worktree-create installs deps so the first commit works#441

Merged
blafourcade merged 1 commit into
nextfrom
chore/learn-vcs-worktree-hook
Jul 15, 2026
Merged

fix(framework): worktree-create installs deps so the first commit works#441
blafourcade merged 1 commit into
nextfrom
chore/learn-vcs-worktree-hook

Conversation

@blafourcade

@blafourcade blafourcade commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🎯 What & why

A fresh worktree has no node_modules, so its first commit failed the commit-msg hook with commitlint not found. Hit repeatedly this session.

🛠️ How it works

.claude/hooks/worktree-create.js runs pnpm install --frozen-lockfile after 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, Makefile setup uses 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

  • I DO CERTIFY I READ EACH LINE OF THE PULL REQUEST BECAUSE I AM A SOFTWARE ENGINEER, NOT A AI PUPPY.

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>
@blafourcade blafourcade force-pushed the chore/learn-vcs-worktree-hook branch from d29eb19 to 44dc792 Compare July 15, 2026 18:02
@blafourcade blafourcade changed the title chore(framework): capture gh gotchas and fix the worktree hook fix(framework): worktree-create installs deps so the first commit works Jul 15, 2026
@blafourcade blafourcade merged commit 8babf0d into next Jul 15, 2026
7 checks passed
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>
@aidd-bot aidd-bot Bot mentioned this pull request Jul 16, 2026
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