From d576fc217ba304b48dfb1c54b92bc1849397fd9b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 11 Jun 2026 11:32:40 -0500 Subject: fix(install): link default hooks in make install session-clear-resume.sh shipped 2026-06-02 with its settings.json entry, but make install didn't cover hooks and nothing re-ran install-hooks, so the symlink only existed on machines that had linked it by hand. Everywhere else the hook errored silently on every /clear. make install now links DEFAULT_HOOKS alongside skills, rules, config, and bin scripts, so the startup workflow's install step propagates new hooks machine-wide. Opt-in hooks stay manual. scripts/tests/install-hooks-link.bats covers the new section. The SessionStart-on-clear todo task closes with this: the hook feature already existed, and the gap was distribution. --- Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 33c582f..5ff155d 100644 --- a/Makefile +++ b/Makefile @@ -170,8 +170,8 @@ bootstrap: ## First-time machine setup: install + install-hooks + install-mcp ##@ Global install (symlinks into ~/.claude/) -install: ## Symlink skills and rules into ~/.claude/ - @mkdir -p $(SKILLS_DIR) $(RULES_DIR) +install: ## Symlink skills, rules, config, hooks, and bin scripts into place + @mkdir -p $(SKILLS_DIR) $(RULES_DIR) $(HOOKS_DIR) @echo "Skills:" @for skill in $(SKILLS); do \ if [ -L "$(SKILLS_DIR)/$$skill" ]; then \ @@ -220,6 +220,19 @@ install: ## Symlink skills and rules into ~/.claude/ fi \ fi @echo "" + @echo "Hooks (default):" + @for hook in $(DEFAULT_HOOKS); do \ + name=$$(basename $$hook); \ + if [ -L "$(HOOKS_DIR)/$$name" ]; then \ + echo " skip $$name (already linked)"; \ + elif [ -e "$(HOOKS_DIR)/$$name" ]; then \ + echo " WARN $$name exists and is not a symlink — skipping"; \ + else \ + ln -s "$(CURDIR)/$$hook" "$(HOOKS_DIR)/$$name"; \ + echo " link $$name → $(HOOKS_DIR)/$$name"; \ + fi \ + done + @echo "" @echo "bin scripts:" @mkdir -p "$(LOCAL_BIN)" @for src in $(CURDIR)/claude-templates/bin/*; do \ -- cgit v1.2.3