Husky
Modern Git hooks manager for running tasks on git events.
3. Used by agents' projects
Dependency in 639 public GitHub projects set up for AI coding agents that we scanned (10.2%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Husky does
Husky's website pitches it as "native" Git hooks: it uses Git's own <code>core.hooksPath</code> setting and "adheres to Git's native hook organization", in a package the maintainers put at 2 kB gzipped with no dependencies.
Husky popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Husky is used
- Husky is a dependency in 639 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (13.1% of the 4,867 JavaScript/TypeScript ones), #2 of 299 in dev workflow and config.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,397; those are left out of every share on this page.
- The most used alternative in our scan is Lefthook (127 projects).
- Projects that use it most often also use lint-staged (68.1%), Prettier (66.0%), ESLint (67.0%).
- It is more common in projects set up for OpenAI Codex (19.4%) than for GitHub Copilot (10.8%).
By coding agent
Often used with
Husky in practice
Strengths
The maintainers write that Husky is "just 2 kB (gzipped) with no dependencies". They say it is "fastest due to being lightweight".
The site says Husky uses Git's <code>core.hooksPath</code> feature. The same section lists support for a custom hooks directory, nested projects and monorepos.
The feature list covers every client-side Git hook. It also lists branch-specific hooks. The site says to use POSIX shell for advanced cases.
The maintainers say Husky "aligns with npm best practices using prepare script". They also say it "adheres to Git's native hook organization".
Watch out for
The "runs in ~1ms" and "fastest" claims come from the project's own website. None of the sources includes an independent measurement.
The site links two articles. One is titled "Why husky has dropped conventional JS config". The other is titled "Why husky doesn't autoinstall anymore". The sources here include only the titles, not what replaced either feature, so anyone used to older setups should read both articles.
The latest release, v9.1.7 (2024-11-18), lists one change: <code>fix: add husky label to deprecated warning</code>. The release notes do not say what is deprecated.
More about Husky
Funding
- GitHub Sponsors: https://github.com/typicode
- Open Collective: https://opencollective.com/husky
- 12 GitHub sponsors
Head to head
- Husky vs Lefthook used together in 4 projects
Packages around it
- lint-staged: Run tasks on staged files
- prettier: Code formatter
- eslint: JavaScript linter
- vitest: Test runner
- @playwright/test: End-to-end browser tests
- @testing-library: Component testing helpers
More in Dev workflow and config
Alternatives
Husky This page
Fast git hooks manager for running checks and tasks on commits.
Get started
Install it.
npm install huskyRules for your agent
## Husky
- Set Husky up through the npm `prepare` script. The site says it "aligns with npm best practices using prepare script."
- Script advanced hook logic in POSIX shell, as the site recommends.
- Any of the 13 client-side Git hooks can be used. The site lists all 13 as supported.
- When a check should apply only to some branches, use branch-specific hooks. They are a listed feature.
- Read the maintainers' articles "Why husky has dropped conventional JS config" and "Why husky doesn't autoinstall anymore" before writing a JS config or expecting hooks to install themselves.