integrationSupercharge your Lefthook-managed git hooks with git-agent's commit intelligence
Lefthook is a fast, Go-based git hooks manager that supports parallel hook execution and per-branch configuration. When paired with git-agent, Lefthook can run commit message validation, atomic commit splitting, and conventional commit formatting as part of your existing hook pipeline. Lefthook's parallel execution model means git-agent validation runs alongside linters and formatters without blocking them, while git-agent's retry loop handles any hook rejections automatically.
Benefits
- Lefthook's single-binary Go runtime matches git-agent's deployment model with no extra dependencies
- Parallel hook execution: commit validation runs alongside linters without blocking
- Per-branch hook configuration enables different validation rules for release vs feature branches
- Compatible with git-agent's full retry and re-plan loop for validation failures
Setup steps
- Install Lefthook: pnpm add -D lefthook or brew install lefthook
- Create a lefthook.yml with a commit-msg hook that runs git-agent validate
- Configure git-agent's hook dispatch mode in .git-agent/config.yml
- Run lefthook install to register hooks and verify with a test commit
FAQ
How does Lefthook compare to Husky for git-agent integration?Lefthook is written in Go (same as git-agent), supports parallel execution, and doesn't require Node.js. Husky is Node.js-based and simpler for JavaScript monorepos. Both work equally well with git-agent's hook system.
Can Lefthook run git-agent's atomic splitting feature as a hook?Atomic splitting is a pre-commit operation that git-agent handles during the commit flow. Lefthook can trigger git-agent's commit pipeline, which includes diff analysis and atomic splitting before the commit-msg hook fires.
Does Lefthook's parallel mode cause issues with git-agent's sequential commit flow?No. git-agent runs its own commit pipeline (split, stage, message, validate) as a single Lefthook hook. Parallel execution applies to separate hooks, not to the stages within a single hook.