DEV Community

Alex Spinov
Alex Spinov

Posted on

Lefthook Has a Free Git Hooks Manager — Fast Pre-Commit Hooks Without Node.js

Lefthook is a fast, cross-platform Git hooks manager written in Go.

What You Get for Free

  • All Git hooks — pre-commit, pre-push, commit-msg, and more
  • Parallel execution — run linters simultaneously
  • Glob patterns — run hooks only on changed files matching patterns
  • Remote hooks — share hook configs across repos
  • No Node.js — single Go binary, works in any project
  • Fast — significantly faster than Husky + lint-staged
  • Interactive — skip hooks with --no-verify when needed
  • Multi-language — works with any project (not just JavaScript)

Quick Start

# Install
brew install lefthook  # or npm install lefthook

# lefthook.yml
pre-commit:
  parallel: true
  commands:
    lint:
      glob: "*.{js,ts,tsx}"
      run: eslint --fix {staged_files}
    format:
      glob: "*.{js,ts,tsx,css,md}"
      run: prettier --write {staged_files}
    types:
      glob: "*.{ts,tsx}"
      run: tsc --noEmit

# Install hooks
lefthook install
Enter fullscreen mode Exit fullscreen mode

Why Teams Switch from Husky

Husky needs Node.js. lint-staged is slow on large repos:

  • Go binary — works in Python, Go, Rust, Java projects too
  • Parallel — run all linters at once, not sequentially
  • Glob matching — only process changed files
  • Faster — Go startup vs Node.js startup

A monorepo team's pre-commit hooks took 45 seconds with Husky + lint-staged (sequential, all files). With Lefthook's parallel execution and glob filtering, same hooks run in 8 seconds — only on changed files, all linters simultaneously.


Need Custom Data Solutions?

I build production-grade scrapers and data pipelines for startups, agencies, and research teams.

Browse 88+ ready-made scrapers on Apify → — Reddit, HN, LinkedIn, Google, Amazon, and more.

Custom project? Email me: spinov001@gmail.com — fast turnaround, fair pricing.

Top comments (0)