# .githooks/ These scripts contain the actual logic for Crewli's `post-commit` and `pre-push` hooks (Claude project-knowledge sync gate, non-blocking sync-staleness warning). ## How they're dispatched Until WS-3 session 1a (2026-04-29) git invoked these scripts directly via `git config core.hooksPath .githooks`. From that session onward they are dispatched by **lefthook**, configured in `lefthook.yml` at the repo root. Lefthook installs its own wrapper scripts into `.git/hooks/` and reads `lefthook.yml` to decide what to run; for this repo the wrapper invokes the same `bash .githooks/` calls that git used to make. The migration is 1:1 by design — the hook implementations live here because the bash logic (merge-commit handling, conf parsing, non-blocking warning) is intricate enough that re-translating it into a YAML `run: |` block would be lossy. ## Re-installing lefthook ```bash pnpm install # postinstall script runs `lefthook install` ``` ## Emergency rollback If lefthook is broken and you need git to invoke these scripts directly again: ```bash git config core.hooksPath .githooks ``` To return to lefthook: ```bash git config --unset --local core.hooksPath pnpm exec lefthook install ```