commit-msg hook · github action

No AI co‑authors

A commit-msg hook and GitHub Action that rejects commits carrying AI attribution trailers — because the byline is the one place accountability can’t be shared.

$ pre-commit install --hook-type commit-msg
@@ why @@

the manifesto

The byline is not a shared resource.

AI co-author git-commit bylines are an impressive marketing hook — but they provide no useful signal of provenance.

It is mid-2026. All code written is facilitated by a host of sophisticated tools. The most recent of these are AI ‘co-authors.’ These have incredible utility, but — as with the other tools in the development toolchain — they are not meaningfully accountable for their output.

At best, tagging the bot that generated code as a ‘co-author’ adds noise to the single most important accountability and attribution mechanism in the development hierarchy. At worst, the practice implies similarly diffused responsibility.

As much as the act of code authorship is changing, the social rules for authorship must not slip: we are responsible for our contributions.

The ‘author’ is, as ever, the contributing person.

— Remove corporate spam from commit messages. No AI co-authors.

@@ diff @@

what it catches

It strikes the tool. It keeps the person.

Matching runs on both the display name and the email, normalized — so a renamed bot or a numeric noreply address doesn’t slip through. A human is never in the blast radius.

Rejected

# the commit will not be created

-Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
-Claude-Session: https://claude.ai/code/…
-Co-authored-by: Copilot <copilot@github.com>
-Co-authored-by: Cursor <cursoragent@cursor.com>
-Co-authored-by: aider <aider@aider.chat>
ChatGPTGPTCodex GeminiDevinWindsurf OpenCodeAmazon QLlama MistralDeepSeekQwen GrokCodyCodeium ClineTabnine+ more

Kept

# the commit goes through, untouched

+Co-authored-by: Claude Shannon <claude.shannon@example.com>
+Co-authored-by: Grace Hopper <grace@example.com>
+Signed-off-by: Ada Lovelace <ada@example.com>
## commented lines are ignored, too

It blocks the bot named Claude.
It welcomes the human named Claude Shannon.

@@ how @@

the mechanism

One small script. No runtime to install.

/* posix */

Just sh and awk

The hook is a POSIX shell script. No Node, Python, or Ruby. No managed hook environment to bootstrap on every machine.

/* local */

Caught at commit time

Runs as a commit-msg hook, so a tagged commit is stopped before it ever enters your history — not flagged after the fact.

/* ci */

Enforced again in CI

The same logic ships as a GitHub Action that reads commits on push and pull_request, so the rule holds even without local hooks.

@@ use @@

install

Pin 1.0.0. Pick your hook manager.

Every path points at the public repo and a tagged release, so installs are repeatable. Swap the tag when you upgrade.

Add the repo to .pre-commit-config.yaml, then install the commit-msg stage.

.pre-commit-config.yaml
default_install_hook_types: [pre-commit, commit-msg]
repos:
  - repo: https://github.com/GoodHatsLLC/no-ai-coauthors
    rev: 1.0.0
    hooks:
      - id: no-ai-coauthors
terminal
$ pre-commit install --hook-type commit-msg

Your name is on the commit. Mean it.