lefthook

Manage Git hook execution with scoped, file-aware YAML configurations.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/mpsuesser/workspace --skill lefthook-mpsuesser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lefthook
Source: https://github.com/mpsuesser/workspace/tree/main/dotconfig/pi/agent/skills/__techs__/lefthook
Command: npx skills add https://github.com/mpsuesser/workspace --skill lefthook-mpsuesser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Lefthook ensures your Git hooks run reliably and consistently across development machines, preventing missed checks and reducing “it works on my machine” hook behavior.

Core Features & Use Cases

  • Configurable hook execution: Define when hooks run, which files/jobs they affect, and how commands are grouped and prioritized.
  • Flexible filtering: Apply include/exclude rules, tags, globs, and file-type logic so only relevant checks run.
  • Environment-aware behavior: Control installation, verbosity, TTY usage, stdin handling, and local/remote configuration patterns for team workflows.

Quick Start

Ask the AI to generate a Lefthook configuration that runs linting and tests on the relevant staged files, with clear include/exclude filters.

Frequently Asked Questions about lefthook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run consistent pre-commit checks only on staged files?

To run consistent pre-commit checks on staged files, you need a YAML configuration that defines hook execution with file and tag filters. This ensures only relevant checks run on changed files.

What is the best way to configure Git hooks for a team environment?

Configuring Git hooks for a team requires a YAML file defining installation behavior, local and remote configuration patterns, and environment handling. This prevents missed checks and inconsistent local workflow behavior across machines.

How do I set up include and exclude filters for Git hook execution?

You set up include and exclude filters for Git hook execution by defining globs, tags, and file-type logic in your YAML configuration. This flexible filtering applies rules so only relevant checks run.

Can I control verbosity and TTY usage for Git hooks in a CI-like local workflow?

Yes, you can control verbosity, TTY usage, and stdin handling for Git hooks in a CI-like local workflow. Environment-aware behavior settings in the configuration manage these execution parameters.

Why does my Git hook behavior differ across development machines?

Git hook behavior differs across development machines due to inconsistent local configurations. Managing hook execution with a shared YAML configuration enforces consistent pre-commit and other checks across the team.

When do I need file-aware Git hook behavior for staged changes?

You need file-aware Git hook behavior for staged changes when teams require scoped checks in CI-like local workflows. This approach applies specific commands only to relevant files based on configured filters.