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 #…