skillfed

lefthook

Git hooks manager. Fast, powerful, simple.

lefthook v2.1.10 399.8K downloads/30d#6,944 on PyPI8,650
Permissive license MIT Active released

What it is and what it does

Lefthook is a Git hooks manager written in Go that runs as a single binary, installed via pip as a platform-specific wheel. It lets you define custom commands to run before or after Git operations (commit, push, etc.) in a YAML configuration file, then installs those hooks into your repository's `.git/hooks` directory. The manager supports parallel execution of commands and works across polyglot projects—Node.js, Ruby, and others—without requiring language-specific hook frameworks.

You configure hooks once in `lefthook.yml`, run `lefthook install`, and the hooks execute automatically on each Git operation. The package has no Python runtime dependencies; it's a thin wrapper around the Go binary, which handles all the hook management and execution logic. This makes it lightweight and portable across teams and CI environments.

Use it for:

  • Run linters and formatters automatically before commit to enforce code style across a team.
  • Execute tests before push to prevent broken code from reaching the repository.
  • Validate commit messages against a standard format before allowing commits.
  • Run security checks or dependency audits as part of the pre-commit workflow.
  • Coordinate multiple checks (lint, test, type-check) in parallel to speed up the commit process.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Lefthook is a Git hooks manager that installs and runs custom commands automatically before or after Git operations, supporting parallel execution across Node.js, Ruby, and other project types.

Yes, if you need a lightweight, language-agnostic Git hooks manager. Active maintenance, no runtime dependencies, permissive MIT license, and no known vulnerabilities make it low-risk. Medium install friction from platform-specific wheels is a minor trade-off for a single self-contained binary. Best suited for teams wanting to standardize pre-commit checks across polyglot codebases without heavyweight frameworks.

Install

lefthook on PyPI

pip

pip install lefthook

uv

uv add lefthook

poetry

poetry add lefthook

Installing lefthook

Before you install

Medium install friction due to platform-specific binary wheels (macOS x86_64/arm64, Linux x86_64/aarch64, Windows amd64/arm64), but the package itself has no runtime dependencies and maintenance is active with a recent release.

License in practice

MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—you need only retain the license notice.

Quickstart

pip install lefthook

# Create lefthook.yml in your repo with hook configuration
lefthook install

# Hooks now run automatically on git operations

Requires Python 3.6 or later; the binary is platform-specific so installation must match your OS and architecture.

Verify before relying

  • Whether the package can run hooks for languages other than Node.js and Ruby without additional setup.
  • Performance characteristics and actual parallelization behavior compared to other Git hook managers.
  • Whether configuration can be shared across team members without environment-specific tweaks.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 37 days since the last release
Last repo commit
First released
Downloads 399,753/month — #6,944 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: lefthook-2.1.10-py3-none-macosx_10_15_x86_64.whl; lefthook-2.1.10-py3-none-macosx_11_0_arm64.whl; lefthook-2.1.10-py3-none-manylinux_2_17_aarch64.whl; lefthook-2.1.10-py3-none-manylinux_2_17_x86_64.whl; lefthook-2.1.10-py3-none-win_amd64.whl; lefthook-2.1.10-py3-none-win_arm64.whl

Operating System :: OS IndependentTopic :: Software Development :: Version Control :: Git

Tags

git hooks managerpre-commit hook automationgit workflow automationparallel git hooksgit commit hookspolyglot git hooksgit hook configuration
git-automationpre-commitpolyglot

More Git packages