From 4c49406d22c6e36acabf7f84d786294fdaf730bf Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Tue, 7 Apr 2026 10:48:24 -0700 Subject: [PATCH] fix: remove incorrect hooks symlink step from worktree skill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git worktrees inherit hooks from the main repo automatically via $GIT_COMMON_DIR — this has been the case since git 2.5 (2015). The symlink step was based on an incorrect premise from PR #965 and also fails in practice (.git is a file in worktrees, not a dir). Co-Authored-By: Claude Opus 4.6 (1M context) --- skills/using-git-worktrees/SKILL.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/skills/using-git-worktrees/SKILL.md b/skills/using-git-worktrees/SKILL.md index b0791391..df9a0b9a 100644 --- a/skills/using-git-worktrees/SKILL.md +++ b/skills/using-git-worktrees/SKILL.md @@ -109,19 +109,6 @@ git worktree add "$path" -b "$BRANCH_NAME" cd "$path" ``` -#### Hooks Awareness - -Git worktrees do not inherit the parent repo's hooks directory. After creating the worktree, symlink hooks from the main repo if they exist: - -```bash -MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel) -if [ -d "$MAIN_ROOT/.git/hooks" ]; then - ln -sf "$MAIN_ROOT/.git/hooks" "$path/.git/hooks" -fi -``` - -This prevents pre-commit checks, linters, and other hooks from silently stopping when work moves to a worktree. - **Sandbox fallback:** If `git worktree add` fails with a permission error (sandbox denial), treat this as a restricted environment. Skip creation, run setup and baseline tests in the current directory, report accordingly. ## Step 3: Project Setup @@ -226,7 +213,6 @@ Ready to implement - Verify directory is ignored for project-local - Auto-detect and run project setup - Verify clean test baseline -- Symlink hooks after creating worktree via 1b ## Integration