Lefthook
Fast, parallel git hooks manager by Evil Martians. Lefthook runs git hooks (pre-commit, commit-msg, pre-push) defined in YAML with parallel execution support. Significantly faster than Husky + lint-staged for large codebases because it runs commands in parallel and supports glob-based file filtering. Single binary (Go), works for any language/framework, no Node.js runtime required. Used by GitLab itself.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
MIT open source. Single Go binary — no npm supply chain risk. Local-only, no network calls. Excellent security profile for a git hooks tool.
⚡ Reliability
Best When
You want fast, parallel git hooks for large codebases with minimal configuration, especially in polyglot projects where Node.js isn't the primary language.
Avoid When
You're already happy with Husky + lint-staged and the ecosystem compatibility matters — migration cost may not justify the performance improvement for small projects.
Use Cases
- • Run linting, formatting, and tests on commit with parallel execution — faster than Husky for large codebases
- • Enforce commit message formats (Conventional Commits) using commit-msg hooks defined in lefthook.yml
- • Run pre-push checks (full test suite, type checking) before pushing to remote without CI blocking developer flow
- • Use Lefthook in polyglot projects (Python + JavaScript) without Node.js runtime requirement for hook management
- • Configure staged-file-only linting with Lefthook's built-in glob + staged file filtering without lint-staged dependency
Not For
- • Teams needing Husky's ecosystem compatibility — some tools have native Husky integration; Lefthook requires manual configuration
- • Projects with extremely complex hook logic — very complex hooks may be clearer as shell scripts than YAML config
- • CI pipeline orchestration — Lefthook is for local git hooks, not CI automation
Interface
Authentication
CLI tool — no auth required. Runs locally as git hooks. No network calls.
Pricing
MIT open source from Evil Martians. Free forever.
Agent Metadata
Known Gotchas
- ⚠ Lefthook requires lefthook install to register hooks after setup — forgetting this step means hooks won't run even if lefthook.yml is correctly configured
- ⚠ Parallel commands share stdout/stderr output which appears interleaved — use piped: true for commands that must run sequentially when output ordering matters
- ⚠ Staged files filtering (stage_fixed option) is Lefthook-native but differs from lint-staged — test staging behavior explicitly when migrating from lint-staged
- ⚠ Lefthook skips hooks in CI by default if LEFTHOOK env var is set to 0 — ensure CI environments that should run hooks have the correct LEFTHOOK environment variable
- ⚠ File glob patterns in Lefthook use Go's filepath.Match — patterns differ subtly from shell globs or minimatch patterns used by Node.js tools
- ⚠ Lefthook's remote configuration (importing config from a URL or package) requires explicit setup — team-shared configs need proper remote config installation in each developer's repo
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Lefthook.
Scores are editorial opinions as of 2026-03-06.