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.

Evaluated Mar 06, 2026 (0d ago) v1.x
Homepage ↗ Repo ↗ Developer Tools git-hooks pre-commit commit-msg parallel fast go open-source evil-martians
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
84
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
82
Error Messages
80
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
92
Secret Handling
95

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

Uptime/SLA
82
Version Stability
85
Breaking Changes
82
Error Recovery
85
AF Security 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

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
No
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

CLI tool — no auth required. Runs locally as git hooks. No network calls.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT open source from Evil Martians. Free forever.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

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.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered