Description
With increasing adoption of multi-agent AI Workflows (particularly Conductor), Git Worktrees are seeing a rapid increase in utilization.
Nobody on my team could agree which hooks belonged where (ci, prepush, precommit) so we have a base lefthook.yml with all our hooks defined + skipped, and then individual Engineers can opt-in with their lefthook-local.yml to enable the hooks where they want.
As a .gitignored file this doesn't get copied into "clean" worktrees so something during the lefthook install phase (which we run as a npm postinstall script) that could check for a worktree, check the main worktree for a lefthook-local.yml, and symlink or copy it over would be amazing.
Claude itself has a .worktreeinclude file (inverse of a .gitignore) file but that's a Claude-ism and without first-class Git support, a targeted solution from Lefthook seems poignant.
Could even make it an opt-in feature:
"postinstall": "npx lefthook install --worktree"
What problem it is solving?
Devs' personal settings defined in lefthook-local.yml are missing on Worktrees.
Description
With increasing adoption of multi-agent AI Workflows (particularly Conductor), Git Worktrees are seeing a rapid increase in utilization.
Nobody on my team could agree which hooks belonged where (ci, prepush, precommit) so we have a base
lefthook.ymlwith all our hooks defined + skipped, and then individual Engineers can opt-in with theirlefthook-local.ymlto enable the hooks where they want.As a
.gitignored file this doesn't get copied into "clean" worktrees so something during thelefthook installphase (which we run as a npm postinstall script) that could check for a worktree, check the main worktree for alefthook-local.yml, and symlink or copy it over would be amazing.Claude itself has a
.worktreeincludefile (inverse of a.gitignore) file but that's a Claude-ism and without first-class Git support, a targeted solution from Lefthook seems poignant.Could even make it an opt-in feature:
What problem it is solving?
Devs' personal settings defined in
lefthook-local.ymlare missing on Worktrees.