Hacker ApprovedDepartments

pre-commit

The most recommended of 5 Git hooks managers

Runs linters and checks on changed files before each commit, and the same definitions can run in CI. Critics say hooks break with history edits and cross-platform builds.

Runs linters and checks on changed files before each commit, and the same definitions can run in CI. Critics say hooks break with history edits and cross-platform builds.

44 people gave an opinion

recommend it
24
criticize it
20
approval share
55%
Each figure is one person. RecommendsCriticizes

Recommended in 7 of 13 months

  1. November 2025: recommended
  2. December 2025: recommended
  3. January 2026: not recommended
  4. February 2026: recommended
  5. March 2026: not recommended
  6. April 2026: recommended
  7. May 2026: recommended
  8. June 2026: not recommended
  9. July 2026: recommended
  10. August 2026: recommended
  11. September 2026: not recommended
  12. October 2026: not recommended
  13. November 2026: not recommended (month in progress)

Why it doesn’t carry the badge

  • 24 people recommend itNeeds 10 or more, met.
  • 1.2 recommenders for every criticNeeds 2 to 1 or better, not met.
  • Recommended in 7 of 13 monthsNeeds 4 or more, met.

The same three rules apply to every product, and the badge can’t be bought. How the badge works

What people say about it

The reasons people give, with the number of comments that give each one. Open a reason to read what they said.

Why people recommend it

Each mark is one comment

  • Shared checks for local and CI

    “It's a really good way to share check definitions between local development and CI”

    Comment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

    “Just add `pre-commit run -a` to your CI. Job done.”

    Comment from 23 Apr 2026 in “Highlights from Git 2.54”
  • Ready-made checks and a check runner

    “has a large ecosystem of off the shelf checks for various language linters and other checks”

    Comment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

    “It's just handy as a check runner.”

    Comment from 4 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”
  • Catches failures before CI

    “I've also found pre-commit useful to prevent CI failure.”

    Comment from 28 Dec 2025 in “Pre-commit hooks are useful”

    “it saves them time as CI would fail anyway”

    Comment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”
  • Fast enough in everyday use

    “It adds negligible time to each commit and I have several hooks in use.”

    Comment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

    “I never have had an issue with performance with pre-commit?”

    Comment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

What people warn about

Each mark is one comment

  • Hooks are fragile or the wrong approach

    “Pre-commit hooks are the wrong way to go about this stuff.”

    Comment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

    “Imho pre-commit is an antipattern. It tends to break”

    Comment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

    “pre-commit is just a bad way to do this”

    Comment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”
  • Maintainer resists changes and feedback

    “I did some digging in the issues and PR's of pre-commit, the guy seems to be a major douche.”

    Comment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

    “the resistance to implement/merge useful things that basically everyone wants”

    Comment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

    “The pre-commit author was straight up hostile to discussions of uv support”

    Comment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”
  • Breaks with history edits and rebases

    “trying to make them automatic just leads to pain when they interact with any non-trivial git feature”

    Comment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

    “i regularly edit history of PRs for a variety of reasons and avoid pre-commit when possible.”

    Comment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”
  • Fails when building on other platforms

    “That works fine for some things, but it doesn't work for building and testing on other platforms.”

    Comment from 1 May 2026 in “If I Could Make My Own GitHub”

    “you still have hooks building Python wheels and whatnot, which fails annoyingly often.”

    Comment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

Other Git hooks managers people recommend

The four most recommended other Git hooks managers, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.

pre-commit compared with 4 alternatives
ProductRecommendCriticizeApprovalMonthsOwnedBadge
pre-commitThis page242055%7——
prek13668%5—Approved
Lefthook7278%6——
Husky6275%3——
hk5183%2——
See all 5 Git hooks managers, ranked

What people said

40 of the 51 comments that mention it, newest first. Each links to the original comment.

“A /precommit tool can be very powerful”

RecommendsComment from 9 Aug 2026 in “Human vs. AI – Diff-based line-level provenance for text under agentic editing”

“imposed with pre-commit so the agent can fix things automatically”

RecommendsComment from 11 Jul 2026 in “Scarf has moved away from Haskell”

“Hook them to git pre-commit, either yourself or with husky or python pre-commit.”

RecommendsComment from 26 May 2026 in “The User Is Visibly Frustrated”

“That works fine for some things, but it doesn't work for building and testing on other platforms.”

MixedComment from 1 May 2026 in “If I Could Make My Own GitHub”

“My approach is to utilize https://pre-commit.com/ to have all checks available to run locally during commit”

RecommendsComment from 1 May 2026 in “If I Could Make My Own GitHub”

“The pre-commit tool does way more than that.”

RecommendsComment from 23 Apr 2026 in “Highlights from Git 2.54”

“I hate it so, so much, and frankly don’t get the appeal.”

CriticizesComment from 23 Apr 2026 in “Highlights from Git 2.54”

“Just add `pre-commit run -a` to your CI. Job done.”

RecommendsComment from 23 Apr 2026 in “Highlights from Git 2.54”

“Scripts are deterministic, run in milliseconds, and use zero tokens.”

RecommendsComment from 22 Feb 2026 in “How I use Claude Code: Separation of planning and execution”

“It's just handy as a check runner.”

RecommendsComment from 4 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“They expect hooks to be managed in isolated repos with exclusive use of tags.”

CriticizesComment from 4 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“using it on a big monorepo can take a while”

MixedComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“has a large ecosystem of off the shelf checks for various language linters and other checks”

RecommendsComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“it doesn't have any way for you to have your own commit hoos that run in addition to the hooks”

CriticizesComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“provides a convenient way to organize running a collection of shell scripts”

RecommendsComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“It adds negligible time to each commit and I have several hooks in use.”

RecommendsComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“i regularly edit history of PRs for a variety of reasons and avoid pre-commit when possible.”

CriticizesComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“you pretty much give some guy you don't know full access to your machine”

CriticizesComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“Pre-commit hooks are the wrong way to go about this stuff.”

CriticizesComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“you still have hooks building Python wheels and whatnot, which fails annoyingly often.”

CriticizesComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“Besides during commit, pre-commit/prek can run all hooks with `run`.”

RecommendsComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“it saves them time as CI would fail anyway”

RecommendsComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“I never have had an issue with performance with pre-commit?”

RecommendsComment from 3 Feb 2026 in “Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust”

“I find this much easier than juggling two pull requests.”

RecommendsComment from 29 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“I've also found pre-commit useful to prevent CI failure.”

RecommendsComment from 28 Dec 2025 in “Pre-commit hooks are useful”

“never had these issues even using rebase flows exclusively”

RecommendsComment from 28 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“pre-commit is just a bad way to do this”

CriticizesComment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“trying to make them automatic just leads to pain when they interact with any non-trivial git feature”

CriticizesComment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“It's a really good way to share check definitions between local development and CI”

RecommendsComment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“does its best to make hooks faster (by running them in parallel if possible)”

RecommendsComment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“abstracts all these issues away and offers a bunch of other advantages as well”

RecommendsComment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“running locally automatically on changed files just gives me an early warning”

RecommendsComment from 27 Dec 2025 in “Pre-commit hooks are fundamentally broken”

“You can use git hooks. Pre-commit specifically.”

RecommendsComment from 11 Dec 2025 in “Show HN: Local Privacy Firewall-blocks PII and secrets before ChatGPT sees them”

“the resistance to implement/merge useful things that basically everyone wants”

CriticizesComment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

“I did some digging in the issues and PR's of pre-commit, the guy seems to be a major douche.”

CriticizesComment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

“pre-commit is supported by everyone”

RecommendsComment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

“The pre-commit author was straight up hostile to discussions of uv support”

CriticizesComment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

“We use that pattern for almost all our projects.”

RecommendsComment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

“Imho pre-commit is an antipattern. It tends to break”

CriticizesComment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

“The “and” here are the main annoyances with pre-commit.”

MixedComment from 19 Nov 2025 in “Better pre-commit, re-engineered in Rust”

Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.