VVitkilabs

Anvil is an alpha testing release. It may have bugs. If something here doesn't match what you see, tell us.

Anvil docs · AI credit in commits

Who gets credit in your commits.

Coding assistants often add a line to your commit messages that names the AI as a co-author, or says the change was generated with it. Some people want that line. Others don't. Anvil tells you once, remembers what you choose, and helps you stick to it. It doesn't choose for you.

What the line is

A small line with a long life.

When an assistant commits for you, it may end the message with a trailer such as Co-Authored-By: Claude <[email protected]>, or add Generated with Claude Code to a pull request. Other assistants do the same with their own names.

A Co-Authored-By line is part of git's record of who wrote the change. It stays in the project's history for good, and GitHub reads it: the AI vendor's account can then show up in the repository's list of contributors.

Both sides

Neither choice is wrong.

Reasons to keep the line. It is honest about how the work was made. Some employers, clients and open-source projects ask you to disclose AI help, and the line does that where everyone can see it. It also helps reviewers know which changes an assistant wrote.

Reasons to leave it off. An assistant is a tool, and many people keep the authorship record to the people who own the work. That record is what gets checked when code is sold, licensed, audited or defended, so some prefer it to name only them. Others simply don't want an AI vendor listed as a contributor on their repository. Taking the line out later means rewriting history, which is disruptive.

If your employer, a client or the project you contribute to has a rule, that rule comes first. This page is not legal advice.

What Anvil does

It asks once, then does what you said.

The first time Anvil sees one of your assistants about to commit, it asks the assistant to tell you about this, briefly, once. After that it stays quiet until you choose. Set your preference with one command, or ask your assistant to run it for you:

anvil attribution set sole       # no AI co-author or "Generated with" lines
anvil attribution set credit     # assistants may add their line
anvil attribution set ask        # your assistant asks before each commit
anvil attribution set unmanaged  # Anvil stays out of it
anvil attribution status         # see what is set

Anvil then follows it. With Claude Code, sole turns off Claude Code's own co-author and "Generated with" lines, and Anvil points it out if one is about to slip into a commit anyway. Ask has your assistant check with you before each commit. Anvil also saves your choice to its memory, so assistants without Anvil's hooks, such as Codex, ChatGPT and Copilot, find it when they recall.

You can change your mind at any time: run anvil attribution set again. In the app, the same switch is in the Claude Code connect checklist as Leave AI credit lines off commits and pull requests.

Keep commits sole-authored

Make it automatic, not something to remember.

A preference only helps the assistants that read it. If you want no commit to carry an AI credit line, whoever or whatever makes it, git itself can refuse them. Anvil can set this up for you:

anvil attribution hooks            # show the hooks, to read or copy
anvil attribution hooks --install  # install them for every repository

This adds two small git hooks and points git's global core.hooksPath setting at them:

  • commit-msg refuses a message with a Co-Authored-By line naming an AI, a "Generated with" line naming one, or an AI vendor's no-reply address. A plain mention, such as "fix the codex_cli timeout", is fine.
  • pre-commit refuses a commit whose author or committer is an AI.

Each hook then runs your repository's own hook of the same name, so hooks you already use keep working. Anvil won't replace a core.hooksPath you set yourself, or a hook file it didn't write. To undo: git config --global --unset core.hooksPath. Projects that set their own hooks folder, for example with husky, use theirs instead, so add the checks there.

Hooks only run on machines that have them, and git commit --no-verify skips them. For a shared repository, anvil attribution hooks also prints a GitHub Actions check that refuses a push containing an AI credit line. You can also ask your own assistant to set any of this up from the commands above.

Removing old lines

If the line is already in your history.

Removing a trailer from commits that are already pushed means rewriting those commits, for example with git filter-repo, and force-pushing. Everyone who has a copy of the repository then has to fetch the new history. On GitHub, a force-push doesn't immediately clear the contributor list, because it is built from the old commits until GitHub cleans them up. Decide before the line spreads, if you can. That is why Anvil raises it at your first commit.