{"slug": "prek", "name": "prek", "category": "git", "category_name": "Git and code hosting", "description": "", "recommenders": 3, "commenters": 9, "warners": 1, "score": 2.228, "rising": -0.98, "first": "2026-02-03", "latest": "2026-07-16", "why": "So in CI/CD you can replace all discrete lint/format tool calls with one to pre-commit/prek", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 3, "neutral": 3, "compare": 2, "warn": 1}, "spark": [0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "So in CI/CD you can replace all discrete lint/format tool calls with one to pre-commit/prek", "kind": "", "icon": false, "domain": null, "github_repo": "github.com/j178/prek", "official_url": "https://github.com/j178/prek", "pricing": "", "aliases": ["prek", "Prek"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 750009282, "item_id": 46875580, "url": "https://news.ycombinator.com/item?id=46875580", "by": "aniforprez", "date": "2026-02-03", "stance": "recommend", "quote": "pre-commit, and prek by extension, have a process to stash the unstaged changes", "excerpt": "Correct me if I'm wrong but lefthook doesn't run its hooks exclusively on the staged changes IIRC. pre-commit, and prek by extension, have a process to stash the unstaged changes using git and running the code only on the staged files. Last I used it, lefthook ran on every file regardless of git status. This annoyed me because I'd have a few stray files that were not ready to be checked in or tracked that would trigg", "context": "", "use_case": "", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 749981936, "item_id": 46873871, "url": "https://news.ycombinator.com/item?id=46873871", "by": "fortuitous-frog", "date": "2026-02-03", "stance": "recommend", "quote": "The prek documentation has a list of many large projects", "excerpt": "They're very commonly used in CI. There are dedicated GitHub actions for pre-commit and prek, but most commonly people just invoke something like `prek run --all-files` or `pre-commit run --all-files` in their typical lint CI jobs. The prek documentation has a list of many large projects (such as CPython and FastAPI, to name a few) who use it; each link is a PR of how they integrated it into CI if you want to see mor", "context": "", "use_case": "CI pre-commit hooks", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 749981889, "item_id": 46873868, "url": "https://news.ycombinator.com/item?id=46873868", "by": "forgotpwd16", "date": "2026-02-03", "stance": "recommend", "quote": "So in CI/CD you can replace all discrete lint/format tool calls with one to pre-commit/prek", "excerpt": "Besides during commit, pre-commit/prek can run all hooks with `run`. So in CI/CD you can replace all discrete lint/format tool calls with one to pre-commit/prek. E.g. https://github.com/python/cpython/blob/main/.github/workflows/lint.yml.", "context": "", "use_case": "running lint hooks in CI", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}]}], "caveats": [{"label": "", "summary": "", "quotes": [{"id": 750263056, "item_id": 46891441, "url": "https://news.ycombinator.com/item?id=46891441", "by": "drewbitt", "date": "2026-02-04", "stance": "warn", "quote": "Would need auto-fix & commit capabilities to really replace lefthook or lint-staged for me.", "excerpt": "Would need auto-fix & commit capabilities to really replace lefthook or lint-staged for me. https://github.com/j178/prek/issues/1051", "context": "", "use_case": "", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}]}], "who": [], "tags": [], "use_cases": ["contributing a pr", "ci pre-commit hooks", "running lint hooks in ci", "pre-commit replacement"], "compared": [{"slug": "pre-commit", "name": "pre-commit", "co": 5, "switched_from": 0, "switched_to": 0}, {"slug": "lefthook", "name": "lefthook", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=46873138", "title": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust", "mentions": 8}, {"url": "https://news.ycombinator.com/item?id=48933310", "title": "The LLM Critics Are Right. I Use LLMs Anyway", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47837698", "title": "Highlights from Git 2.54", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {}, "2026-01": {}, "2026-02": {"compare": 1, "recommend": 3, "neutral": 2, "warn": 1}, "2026-03": {}, "2026-04": {"compare": 1}, "2026-05": {}, "2026-06": {}, "2026-07": {"neutral": 1}, "2026-08": {}, "2026-09": {}, "2026-10": {}}, "quotes": [{"id": 783056176, "item_id": 48941011, "url": "https://news.ycombinator.com/item?id=48941011", "by": "cadamsdotcom", "date": "2026-07-16", "stance": "neutral", "quote": "I filed this PR against prek", "excerpt": "LLMs are awesome, but sometimes we'd be better off with more friction. This is because.. sometimes an idea is just bad. I learned the hard way the other day when I filed this PR against prek: https://github.com/j178/prek/pull/2302 My idea was bad. The implementation was meant to solve my problem. All it did was expose more problems and waste my time and the maintainer's, and god knows how many tokens from Claude and ", "context": "", "use_case": "contributing a PR", "switched_from": "", "story": "The LLM Critics Are Right. I Use LLMs Anyway"}, {"id": 766002465, "item_id": 47875154, "url": "https://news.ycombinator.com/item?id=47875154", "by": "Flimm", "date": "2026-04-23", "stance": "compare", "quote": "An alternative to it is \"prek\", written in Rust.", "excerpt": "To clear up any confusion, Git runs pre-commit hooks, and they can be written in any programming language. There's a completely separate and independent project that gave itself the confusing \"pre-commit\" name, and it is written in Python. This project aims to make it easier to configure pre-commit hooks. An alternative to it is \"prek\", written in Rust.", "context": "", "use_case": "", "switched_from": "", "story": "Highlights from Git 2.54"}, {"id": 750263056, "item_id": 46891441, "url": "https://news.ycombinator.com/item?id=46891441", "by": "drewbitt", "date": "2026-02-04", "stance": "warn", "quote": "Would need auto-fix & commit capabilities to really replace lefthook or lint-staged for me.", "excerpt": "Would need auto-fix & commit capabilities to really replace lefthook or lint-staged for me. https://github.com/j178/prek/issues/1051", "context": "", "use_case": "", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 750131312, "item_id": 46883207, "url": "https://news.ycombinator.com/item?id=46883207", "by": "flowingfocus", "date": "2026-02-04", "stance": "neutral", "quote": "prek is the default used for devenv's git-hooks since November 2025", "excerpt": "For folks using devenv: prek is the default used for devenv's git-hooks since November 2025 https://devenv.sh/blog/2025/11/26/devenv-111-module-changelogs-and-secretspec-040/#module-changelogs", "context": "", "use_case": "", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 750060160, "item_id": 46878760, "url": "https://news.ycombinator.com/item?id=46878760", "by": "BeeOnRope", "date": "2026-02-03", "stance": "neutral", "quote": "How does prek handle pre-push hooks?", "excerpt": "How does prek handle pre-push hooks? I.e. how does it determine the list of modified files. This is a long standing sore point in pre-commit, see https://github.com/pre-commit/pre-commit/issues/860 and also linked duplicates (some of which are not duplicates).", "context": "", "use_case": "", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 750009282, "item_id": 46875580, "url": "https://news.ycombinator.com/item?id=46875580", "by": "aniforprez", "date": "2026-02-03", "stance": "recommend", "quote": "pre-commit, and prek by extension, have a process to stash the unstaged changes", "excerpt": "Correct me if I'm wrong but lefthook doesn't run its hooks exclusively on the staged changes IIRC. pre-commit, and prek by extension, have a process to stash the unstaged changes using git and running the code only on the staged files. Last I used it, lefthook ran on every file regardless of git status. This annoyed me because I'd have a few stray files that were not ready to be checked in or tracked that would trigg", "context": "", "use_case": "", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 749986912, "item_id": 46874182, "url": "https://news.ycombinator.com/item?id=46874182", "by": "fortuitous-frog", "date": "2026-02-03", "stance": "neutral", "quote": "There's a config option for that :)", "excerpt": "There's a config option for that :) https://prek.j178.dev/configuration/#default_install_hook_types", "context": "", "use_case": "", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 749981936, "item_id": 46873871, "url": "https://news.ycombinator.com/item?id=46873871", "by": "fortuitous-frog", "date": "2026-02-03", "stance": "recommend", "quote": "The prek documentation has a list of many large projects", "excerpt": "They're very commonly used in CI. There are dedicated GitHub actions for pre-commit and prek, but most commonly people just invoke something like `prek run --all-files` or `pre-commit run --all-files` in their typical lint CI jobs. The prek documentation has a list of many large projects (such as CPython and FastAPI, to name a few) who use it; each link is a PR of how they integrated it into CI if you want to see mor", "context": "", "use_case": "CI pre-commit hooks", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 749981889, "item_id": 46873868, "url": "https://news.ycombinator.com/item?id=46873868", "by": "forgotpwd16", "date": "2026-02-03", "stance": "recommend", "quote": "So in CI/CD you can replace all discrete lint/format tool calls with one to pre-commit/prek", "excerpt": "Besides during commit, pre-commit/prek can run all hooks with `run`. So in CI/CD you can replace all discrete lint/format tool calls with one to pre-commit/prek. E.g. https://github.com/python/cpython/blob/main/.github/workflows/lint.yml.", "context": "", "use_case": "running lint hooks in CI", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}, {"id": 749981378, "item_id": 46873836, "url": "https://news.ycombinator.com/item?id=46873836", "by": "esafak", "date": "2026-02-03", "stance": "compare", "quote": "Is prek much better?", "excerpt": "I use http://hk.jdx.dev/, which is based on https://pkl-lang.org/ and Rust, as it integrates with http://mise.jdx.dev/. Is prek much better?", "context": "", "use_case": "pre-commit replacement", "switched_from": "", "story": "Prek: A better, faster, drop-in pre-commit replacement, engineered in Rust"}]}