Skip to content

Git Worktree support for lefthook-local.yml #1384

@TylerR909

Description

@TylerR909

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA new lefthook feature description

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions