Recently, I migrated our project from Husky to Lefthook β and the difference was immediately noticeable.
π€ Why Lefthook?
A few key reasons:
β‘ Written in Go β extremely fast execution
π Parallel execution β run tasks concurrently instead of sequentially
π§© Simple & powerful config β less boilerplate, easier to maintain
π§ Smarter workflow control β flexible hook-level optimization
βΈ»
β±οΈ Real impact (our case)
Before (Husky)
Pre-commit runs everything:
lint
type-check
unit tests
β³ ~17 seconds per commit
After (Lefthook)
pre-commit:
only lint + prettier on staged files
pre-push:
type-check + unit tests
π Result:
β±οΈ ~2s faster per commit (~10% improvement)
π‘ Much smoother dev experience (less waiting, more flow)
βΈ»
π§ Key takeaway
Donβt overload your pre-commit hook.
Split responsibilities:
β
Fast checks β pre-commit
π Heavy validation β pre-push / CI
π¦ Example Lefthook config (simplified)
--- # https://lefthook.dev/configuration/glob_matcher/ glob_matcher : doublestar #β¦