# pre-commit

A framework and multi-language package manager for managing and executing pre-commit hooks.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Using a pre-commit hook to keep coding agents on a diagnostics library

DevFeed: [Using a pre-commit hook to keep coding agents on a diagnostics library](<https://devfeed.tech/articles/quoting-geoffrey-huntley-85925.md>)

Original publisher: [Read original article](<https://simonwillison.net/2026/Oct/13/geoffrey-huntley/>)

Author: Simon Willison

Published: 2026-10-13T13:32:00Z

Content type: article

Language: en

Sources: [Simon Willison's Weblog](<https://devfeed.tech/sources/simon-willison-s-weblog.md>)

Topics: [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [agent observability](<https://devfeed.tech/topics/agent-observability.md>)

Tags: [agentic](<https://devfeed.tech/tags/agentic.md>), [agentic-engineering](<https://devfeed.tech/tags/agentic-engineering.md>), [agentic-engineering-65](<https://devfeed.tech/tags/agentic-engineering-65.md>), [agents-md](<https://devfeed.tech/tags/agents-md.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-2-276](<https://devfeed.tech/tags/ai-2-276.md>), [coding](<https://devfeed.tech/tags/coding.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [coding-agents-257](<https://devfeed.tech/tags/coding-agents-257.md>), [commit](<https://devfeed.tech/tags/commit.md>), [diagnostics](<https://devfeed.tech/tags/diagnostics.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [engineering-ai](<https://devfeed.tech/tags/engineering-ai.md>), [fail](<https://devfeed.tech/tags/fail.md>), [generative-ai](<https://devfeed.tech/tags/generative-ai.md>), [generative-ai-2-018](<https://devfeed.tech/tags/generative-ai-2-018.md>), [geoffrey-huntley](<https://devfeed.tech/tags/geoffrey-huntley.md>), [geoffrey-huntley-4](<https://devfeed.tech/tags/geoffrey-huntley-4.md>), [git](<https://devfeed.tech/tags/git.md>), [git-57](<https://devfeed.tech/tags/git-57.md>), [library](<https://devfeed.tech/tags/library.md>), [llms](<https://devfeed.tech/tags/llms.md>), [llms-1-984](<https://devfeed.tech/tags/llms-1-984.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [observability](<https://devfeed.tech/tags/observability.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [type](<https://devfeed.tech/tags/type.md>)

### AI overview

Geoffrey Huntley describes using a pre-commit hook to detect when a coding agent calls observability modules directly instead of using a diagnostics library. The hook fails the commit and prompts the agent to use the library.

### Source excerpt

If the agent isn't using my diagnostics library, I could introspect and update AGENTS.md, but there's still a delta, and it'll drift. Instead, I write a pre-commit hook that checks the git diff for direct calls to observability modules that bypass my diagnostics module. Boom: fail the commit, inject a prompt telling the agent to use the diagnostics library. All of a sudden it's ten out of ten. -- Geoffrey Huntley, nobody should type code by hand anymore. here's what's left. Tags: coding-agents, generative-ai, git, agentic-engineering, ai, geoffrey-huntley, llms

## Making git hooks visible

DevFeed: [Making git hooks visible](<https://devfeed.tech/articles/making-git-hooks-visible-84964.md>)

Original publisher: [Read original article](<https://nedbatchelder.com/blog/202610/making_git_hooks_visible>)

Author: Ned Batchelder

Published: 2026-10-11T12:25:12Z

Content type: tutorial

Language: en

Sources: [Ned Batchelder's blog](<https://devfeed.tech/sources/ned-batchelder-s-blog.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [git](<https://devfeed.tech/tags/git.md>), [git-hook](<https://devfeed.tech/tags/git-hook.md>), [git-hooks](<https://devfeed.tech/tags/git-hooks.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [security](<https://devfeed.tech/tags/security.md>)

### AI overview

The author describes adding zsh directory-change functions that display active Git hooks when entering a repository and flag repositories with a pre-commit configuration but no installed hook. This makes hook activity more visible and helps catch forgotten pre-commit setup.

### Source excerpt

Frank Wiles wrote about an attack he nearly fell victim to: a downloaded git repo had active git hooks that would have compromised his system. Seeing the risks, I wanted to make git hooks more visible on my own machine. A git hook is a script in the .git directory of a git repo on your machine. They run during various git operations. The important detail to understand about hooks is that they do not get installed locally when you clone a repo. A newly cloned repo never has active hooks. Hooks have to be enabled after cloning, usually by you. The attack Frank saw was dangerous because it wasn't a cloned repo: it was a local checkout that had hooks installed then shared as a Dropbox folder. So when it landed on Frank's machine, the hooks were active without him realizing it. Git hooks are not apparent: they are meant to sit quietly until they run and ideally to be unobtrusive even then. But this attack made me want to know what hooks were in each of my git directories. In zsh, you can define a function called chpwd, and it will execute whenever the current directory changes. Using this feature, I could create a script that lists the active hooks when I change into a git directory: git_show_hooks() { local git_dir=$(git rev-parse --absolute-git-dir 2>/dev/null) if [[ -z $git_dir ]]; then _git_shown_hooks_dir= return fi local hooks_dir=$(git rev-parse --git-path hooks) hooks_dir=${hooks_dir:a} # Only announce once per repo, not for every cd inside it. if [[ $hooks_dir == $_git_shown_hooks_dir ]]; then return fi _git_shown_hooks_dir=$hooks_dir local -a hooks local hook setopt localoptions nullglob for hook in $hooks_dir/*; do if [[ -f $hook && -x $hook && $hook != *.sample ]]; then hooks+=(${hook:t}) fi done if (( $#hooks )); then echo -e "\e[31mgit hooks:\e[0m $hooks (from $git_dir)" fi } autoload -Uz add-zsh-hook add-zsh-hook chpwd git_show_hooks Now entering a git repo I get an announcement of active hooks, if any. It's very rare to see a hook other than pre-commit, b

## Building an Adversarial Pipeline to Catch AI-Generated Code Hallucinations Before Review

DevFeed: [Building an Adversarial Pipeline to Catch AI-Generated Code Hallucinations Before Review](<https://devfeed.tech/articles/the-ai-code-avalanche-building-an-adversarial-pipeline-to-stop-code-hallucinations-before-they-hit-60408.md>)

Original publisher: [Read original article](<https://hackernoon.com/the-ai-code-avalanche-building-an-adversarial-pipeline-to-stop-code-hallucinations-before-they-hit?source=rss>)

Author: Faraazuddin Mohammed

Published: 2026-09-25T22:31:27Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Code](<https://devfeed.tech/topics/code.md>), [Code review](<https://devfeed.tech/topics/code-review.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [Repository](<https://devfeed.tech/topics/repository.md>), [Local AI](<https://devfeed.tech/topics/local-ai.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [ai-generated-code](<https://devfeed.tech/tags/ai-generated-code.md>), [artificial-intelligence](<https://devfeed.tech/tags/artificial-intelligence.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [code](<https://devfeed.tech/tags/code.md>), [code-quality](<https://devfeed.tech/tags/code-quality.md>), [code-review](<https://devfeed.tech/tags/code-review.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [developer-productivity](<https://devfeed.tech/tags/developer-productivity.md>), [github-actions](<https://devfeed.tech/tags/github-actions.md>), [llm](<https://devfeed.tech/tags/llm.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [software-architecture](<https://devfeed.tech/tags/software-architecture.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>)

### AI overview

This tutorial describes an adversarial pipeline for detecting hallucinations and architectural violations in AI-generated code before it reaches a repository. It combines local coding-agent rules, Bash hooks, deterministic checks, and a multi-agent review process that produces structured evidence.

### Source excerpt

Drowning in AI-generated PRs? Learn how to build a multi-agent adversarial pipeline to catch code hallucinations and enforce architecture before it hits main.

## Introducing Kempt

DevFeed: [Introducing Kempt](<https://devfeed.tech/articles/introducing-kempt-39037.md>)

Original publisher: [Read original article](<https://www.zacsweers.dev/introducing-kempt/>)

Author: Zac Sweers

Published: 2026-06-23T00:00:23Z

Content type: release

Language: en

Sources: [Zac Sweers](<https://devfeed.tech/sources/zac-sweers.md>)

Topics: [formatting](<https://devfeed.tech/topics/formatting.md>), [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [hooks](<https://devfeed.tech/topics/hooks.md>), [Continuous integration](<https://devfeed.tech/topics/continuous-integration.md>), [Repository](<https://devfeed.tech/topics/repository.md>), [Java](<https://devfeed.tech/topics/java.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Rust](<https://devfeed.tech/topics/rust.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [formatting](<https://devfeed.tech/tags/formatting.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [repo](<https://devfeed.tech/tags/repo.md>), [rust](<https://devfeed.tech/tags/rust.md>)

### AI overview

The article introduces Kempt, a small project designed to replace heavy Gradle-based formatting setups with a repo-local pipeline for formatting and commit hooks. It supports Kotlin, Java, and Rust, and can run locally, in pre-commit hooks, and in CI.

### Source excerpt

Formatting should be boring, in the best possible way.

## Dependabot now supports pre-commit hooks

DevFeed: [Dependabot now supports pre-commit hooks](<https://devfeed.tech/articles/dependabot-now-supports-pre-commit-hooks-71966.md>)

Original publisher: [Read original article](<https://github.blog/changelog/2026-03-10-dependabot-now-supports-pre-commit-hooks>)

Author: Allison

Published: 2026-03-10T18:04:32Z

Content type: release

Language: en

Sources: [GitHub Changelog](<https://devfeed.tech/sources/github-changelog.md>)

Topics: [Dependabot](<https://devfeed.tech/topics/dependabot.md>), [pre-commit](<https://devfeed.tech/topics/pre-commit.md>)

Tags: [all](<https://devfeed.tech/tags/all.md>), [automatic](<https://devfeed.tech/tags/automatic.md>), [automatically](<https://devfeed.tech/tags/automatically.md>), [based](<https://devfeed.tech/tags/based.md>), [bitbucket](<https://devfeed.tech/tags/bitbucket.md>), [can](<https://devfeed.tech/tags/can.md>), [changelog](<https://devfeed.tech/tags/changelog.md>), [commit](<https://devfeed.tech/tags/commit.md>), [config](<https://devfeed.tech/tags/config.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [dependabot](<https://devfeed.tech/tags/dependabot.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [ecosystem](<https://devfeed.tech/tags/ecosystem.md>), [github](<https://devfeed.tech/tags/github.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [package](<https://devfeed.tech/tags/package.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [pre-commit-hooks](<https://devfeed.tech/tags/pre-commit-hooks.md>), [updates](<https://devfeed.tech/tags/updates.md>), [yaml](<https://devfeed.tech/tags/yaml.md>)

### AI overview

Dependabot can update pre-commit hooks through its existing version-update workflow. Add `pre-commit` as a package ecosystem in `dependabot.yml`; it reads `.pre-commit-config.yaml`, checks hook repositories for tags or releases, and opens pull requests changing `rev`. It supports tag- and SHA-pinned revisions, grouped updates, and changelog and release-note inclusion. Updates preserve YAML structure and adjust inline version comments where applicable. `local` and `meta` hooks are skipped. The text says hooks hosted on GitHub, GitLab, Bitbucket, and other Git providers are supported.

### Source excerpt

GitHub Dependabot now natively supports automatic dependency updates for pre-commit hooks. By adding pre-commit as a package ecosystem in your dependabot.yml configuration, Dependabot will parse your .pre-commit-config.yaml, check each hook's...

## Prek, a pre-commit alternative

DevFeed: [Prek, a pre-commit alternative](<https://devfeed.tech/articles/prek-a-pre-commit-alternative-27743.md>)

Original publisher: [Read original article](<https://gagor.pro/2026/02/prek-a-pre-commit-alternative/>)

Author: Tom

Published: 2026-02-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tomasz Gągor](<https://devfeed.tech/sources/tomasz-gagor.md>)

Topics: [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [Rust](<https://devfeed.tech/topics/rust.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [developer-tools](<https://devfeed.tech/tags/developer-tools.md>), [execution](<https://devfeed.tech/tags/execution.md>), [git-hooks](<https://devfeed.tech/tags/git-hooks.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [performance](<https://devfeed.tech/tags/performance.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [prek](<https://devfeed.tech/tags/prek.md>), [projects](<https://devfeed.tech/tags/projects.md>), [rust](<https://devfeed.tech/tags/rust.md>), [script](<https://devfeed.tech/tags/script.md>), [speed](<https://devfeed.tech/tags/speed.md>)

### AI overview

The article describes switching from pre-commit to Prek, a Rust-based drop-in alternative that preserves configuration compatibility while providing faster hook execution. It also presents a script for converting multiple repositories.

### Source excerpt

Prek is a Rust-based pre-commit alternative that maintains full config compatibility while delivering significantly faster hook execution.

## Pre-commit hooks for Python and MLOps CI and deployment practices

DevFeed: [Pre-commit hooks for Python and MLOps CI and deployment practices](<https://devfeed.tech/articles/welcome-to-pre-commit-heaven-38844.md>)

Original publisher: [Read original article](<https://mettlesome.substack.com/p/welcome-to-pre-commit-heaven>)

Author: Raphaël Hoogvliets

Published: 2024-02-07T08:53:41Z

Content type: tutorial

Language: en

Sources: [Raphaël Hoogvliets](<https://devfeed.tech/sources/raphael-hoogvliets.md>)

Topics: [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [Continuous integration](<https://devfeed.tech/topics/continuous-integration.md>), [Deployment](<https://devfeed.tech/topics/deployment.md>), [MLOps](<https://devfeed.tech/topics/mlops.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [ci](<https://devfeed.tech/tags/ci.md>), [code](<https://devfeed.tech/tags/code.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [mlops](<https://devfeed.tech/tags/mlops.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

This tutorial explains how pre-commit hooks run code checks before changes enter local or remote repositories and in CI pipelines. It introduces categories of hooks and previews a selection for Python and MLOps workflows.

### Source excerpt

Where I learned to stop worrying and love deployment

## Automatically format and lint code with pre-commit

DevFeed: [Automatically format and lint code with pre-commit](<https://devfeed.tech/articles/automatically-format-and-lint-code-with-pre-commit-47345.md>)

Original publisher: [Read original article](<https://interrupt.memfault.com/blog/pre-commit>)

Author: Noah Pendleton

Published: 2021-10-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Interrupt](<https://devfeed.tech/sources/interrupt.md>)

Topics: [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [Embedded Software Dev](<https://devfeed.tech/topics/embedded-software-dev.md>), [formatting](<https://devfeed.tech/topics/formatting.md>), [lint](<https://devfeed.tech/topics/lint.md>), [C](<https://devfeed.tech/topics/c.md>), [hooks](<https://devfeed.tech/topics/hooks.md>), [Git](<https://devfeed.tech/topics/git.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [also](<https://devfeed.tech/tags/also.md>), [bug](<https://devfeed.tech/tags/bug.md>), [c](<https://devfeed.tech/tags/c.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [firmware](<https://devfeed.tech/tags/firmware.md>), [format](<https://devfeed.tech/tags/format.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [lint](<https://devfeed.tech/tags/lint.md>), [linux](<https://devfeed.tech/tags/linux.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>)

### AI overview

A tutorial on using pre-commit and Git hooks to automatically format and lint C-language firmware codebases. It explains formatting and linting, gives general guidelines and example checks, and describes benefits such as reducing style-related churn in pull request reviews.

### Source excerpt

This article provides some background and guidelines for using pre-commit to automatically format and lint C-language firmware codebases. We'll cover general guidelines and go over an example set of checks that can be helpful when working on firmware code. Continue reading...

## git pre-commit hook for code beautification

DevFeed: [git pre-commit hook for code beautification](<https://devfeed.tech/articles/git-pre-commit-hook-for-code-beautification-21702.md>)

Original publisher: [Read original article](<https://nativeguru.wordpress.com/2016/01/30/git-pre-commit-hook-for-code-beautification/>)

Author: Ramon

Published: 2016-01-30T20:22:19Z

Content type: article

Language: en

Sources: [Ramon Fried](<https://devfeed.tech/sources/ramon-fried.md>)

Topics: [pre-commit](<https://devfeed.tech/topics/pre-commit.md>), [code beautification](<https://devfeed.tech/topics/code-beautification.md>), [astyle](<https://devfeed.tech/topics/astyle.md>), [Git](<https://devfeed.tech/topics/git.md>)

Tags: [artistic-style](<https://devfeed.tech/tags/artistic-style.md>), [astyle](<https://devfeed.tech/tags/astyle.md>), [automate](<https://devfeed.tech/tags/automate.md>), [code-beautification](<https://devfeed.tech/tags/code-beautification.md>), [coding-style](<https://devfeed.tech/tags/coding-style.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [commits](<https://devfeed.tech/tags/commits.md>), [gerrit](<https://devfeed.tech/tags/gerrit.md>), [git](<https://devfeed.tech/tags/git.md>), [git-commit](<https://devfeed.tech/tags/git-commit.md>), [git-hook](<https://devfeed.tech/tags/git-hook.md>), [git-hooks](<https://devfeed.tech/tags/git-hooks.md>), [github](<https://devfeed.tech/tags/github.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [id](<https://devfeed.tech/tags/id.md>), [improvements](<https://devfeed.tech/tags/improvements.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [linux](<https://devfeed.tech/tags/linux.md>), [linux-kernel](<https://devfeed.tech/tags/linux-kernel.md>), [pre-commit](<https://devfeed.tech/tags/pre-commit.md>), [run](<https://devfeed.tech/tags/run.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>)

### AI overview

The author describes a Git pre-commit hook for Linux kernel work that runs the kernel's checkpatch.pl script's style-checking role through a formatter: the hook applies astyle to each file in the commit, using configured spacing, indentation, and other formatting rules, and astyle rewrites the original files. This automates some beautification before commits. The author's stated limitation is that astyle processes complete files; they would prefer it to format only the portions changed in the commit. The excerpt does not provide installation or configuration steps.

### Source excerpt

Hi. In this post I will share a git pre-commit hook I created for aiding with code beautification. In Linux, I work in two different coding styles: User space and Kernel. The Linux kernel has a very specific coding style and every commit to kernel must adhere to that style. The Linux kernel provides a [...]