Skip to content
Lefthook logo

Automate Git hooks to enforce code quality and development workflows.

Free, no paid tierVisit Website
Tracked since 2026

The Bottom Line

Price
Free, no paid tier. Compare plans

Key facts

  • Automates Git hooks for pre-commit, pre-push, and other actions.
  • Enforces code quality and project standards automatically.
  • Configurable with parallel jobs and file globbing for flexible workflows.

Pros

  • Ensures consistent code quality across a team.
  • Automates repetitive tasks like linting and formatting.
  • Prevents faulty code from being committed or pushed.
  • Flexible configuration options for various workflows.

Cons

  • Requires initial setup and configuration.
  • Can slow down commit times if many heavy tasks are configured.

What is Lefthook?

Lefthook is a Git hooks manager designed to streamline development workflows by automating tasks before commits, pushes, or other Git actions. It allows developers to configure custom scripts and commands that run automatically, ensuring code quality, consistency, and adherence to project standards. By integrating tools like linters and formatters directly into the Git workflow, Lefthook helps prevent common errors from being committed to the repository. This tool is ideal for development teams and individual developers who want to enforce coding standards, run tests, or perform other automated checks at various stages of their Git workflow. It simplifies the management of Git hooks, making it easy to define parallel jobs, specify file glob patterns, and automatically stage fixed files, ultimately leading to a more robust and efficient development process.

Available on: Web, Windows, macOS, Linux

Preview

Key Features

  • Git hooks management
  • Parallel job execution
  • Configurable with YAML
  • File glob pattern matching
  • Automatic staging of fixed files
  • Supports multiple hooks (e.g., pre-commit)

Pricing

Free

Lefthook is completely free to use with no hidden costs.

View pricing

Reviews

Improve Your Thinking Patterns Using ChatGPT cover
$99 Free with your review

Review Lefthook, get a free AI guide

Share your experience and we will send you Improve Your Thinking Patterns Using ChatGPT, free.

Write a review

Best Lefthook Alternatives

Top alternatives based on features, pricing, and user needs.

View full list →

Most buyers shortlist 2 or 3 tools before committing. Pull a side-by-side comparison or browse the full alternatives shortlist below.

Explore More

Lefthook FAQ

How does Lefthook handle situations where a linter fixes issues automatically during a pre-commit hook?

Lefthook includes a stage_fixed: true option within job configurations. When enabled, if a tool like a linter or formatter modifies staged files, Lefthook automatically re-stages those changes before the commit proceeds, ensuring that all fixes are included in the current commit.

Can Lefthook run different linters or scripts on different types of files within the same pre-commit hook?

Yes, Lefthook supports defining multiple jobs within a single hook, each with its own glob pattern. This allows you to specify that yarn run stylelint should only run on *.css files, while yarn run eslint runs on *.ts, *.js, *.tsx, and *.jsx files, all within the same pre-commit hook.

Is it possible to run pre-commit tasks in parallel to speed up the commit process?

Yes, Lefthook offers a parallel: true option at the hook level. When set, all jobs defined under that hook will execute concurrently, which can significantly reduce the total time required for the hook to complete, especially when dealing with multiple independent tasks.

How do I install Lefthook for a specific project versus making it available globally on my system?

Lefthook can be installed either as a project dependency, typically via a package manager like npm or Yarn, or globally on your system. The documentation provides instructions for both methods, allowing you to choose the installation scope that best fits your development environment and project requirements.

Guides & Articles