chore(worktree): auto-run yarn install on new worktrees

Add a Claude Code SessionStart hook (matcher: startup) that runs
`corepack yarn install` when node_modules is missing, so worktrees Claude
creates internally are immediately usable. Also extend create-task-worktree.sh
to install deps after the worktree is created, covering Codex/Cursor/manual
flows that share that script.
This commit is contained in:
Tommaso Casaburi
2026-04-17 14:30:41 +07:00
parent 2b79432f16
commit d07f5b3962
3 changed files with 44 additions and 0 deletions
+6
View File
@@ -60,6 +60,12 @@ echo "Creating branch $branch_name from $base_ref"
echo "Creating worktree at $worktree_path"
git worktree add "$worktree_path" -b "$branch_name" "$base_ref"
if [ -f "$worktree_path/yarn.lock" ]; then
echo ""
echo "Installing dependencies in new worktree (corepack yarn install)..."
(cd "$worktree_path" && corepack yarn install)
fi
echo ""
echo "Worktree ready."
echo "Branch: $branch_name"