<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/p7unxtanh" -->

---
title: pre-commit hooks are fundamentally broken | daily.dev
description: Pre-commit hooks are fundamentally flawed because they run on the working tree instead of the index, fail during rebases and interactive operations, and break...
canonical: https://daily.dev/posts/p7unxtanh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: pre-commit hooks are fundamentally broken | daily.dev
og:description: Pre-commit hooks are fundamentally flawed because they run on the working tree instead of the index, fail during rebases and interactive operations, and break...
og:url: https://daily.dev/posts/p7unxtanh
og:image: https://api.daily.dev/og/posts/P7uNXtanH.png
og:image:alt: Post cover image
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# pre-commit hooks are fundamentally broken

**[Deleted user](https://daily.dev/sources/404)** · [@ghost](https://daily.dev/ghost) · 38 upvotes · 3 comments

## Summary

Pre-commit hooks are fundamentally flawed because they run on the working tree instead of the index, fail during rebases and interactive operations, and break workflows where commits are used for local state management. They can't handle commits without relevant files, run on branches being rebased, and create friction when dealing with code that predates the hook. Pre-push hooks are a better alternative as they avoid these issues while still providing automated checks before code is shared.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://jyn.dev/pre-commit-hooks-are-fundamentally-broken/>

## Community discussion

Top comments from developers on daily.dev.

**@idoshamun** · 3 upvotes

> Me who never uses hooks 🙈

**@anton72** · 2 upvotes

> That's like stabbing yourself with a screwdriver in the foot and saying screwdrivers are fundamentally broken

**@ghost** · 1 upvotes

> So true.

---

Tags: [#git](https://daily.dev/tags/git), [#rust](https://daily.dev/tags/rust)

[View this post on daily.dev](https://daily.dev/posts/p7unxtanh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/p7unxtanh","headline":"pre-commit hooks are fundamentally broken","text":"Shared: pre-commit hooks are fundamentally broken","url":"https://daily.dev/posts/p7unxtanh","datePublished":"2025-12-27T19:24:37.608Z","dateModified":"2026-03-30T02:17:01.470Z","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":38030}},"image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":38},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/0qJwLwWEB"},"comment":[{"@type":"Comment","text":"Me who never uses hooks 🙈","datePublished":"2026-01-03T11:24:42.556Z","url":"https://daily.dev/posts/P7uNXtanH#c-z170pb0xs","author":{"@type":"Person","name":"Ido Shamun","url":"https://daily.dev/idoshamun","image":"https://media.daily.dev/image/upload/s---xy_OAwk--/f_auto,q_auto/v1703781380/avatars/avatar_28849d86070e4c099c877ab6837c61f0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"That’s like stabbing yourself with a screwdriver in the foot and saying screwdrivers are fundamentally broken","datePublished":"2026-01-05T09:28:06.832Z","url":"https://daily.dev/posts/P7uNXtanH#c-aEgmsTw0Q","author":{"@type":"Person","name":"Anton Bendrikov","url":"https://daily.dev/anton72","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"So true.","datePublished":"2025-12-27T19:24:50.551Z","url":"https://daily.dev/posts/P7uNXtanH#c-pT6jLkaSi","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/404","name":"Deleted user"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Deleted user","item":"https://daily.dev/sources/404"},{"@type":"ListItem","position":3,"name":"pre-commit hooks are fundamentally broken"}]}
```

