uv tool install git+https://github.com/gelt-technologies/co-authorsAdd the following alias to your shell config (~/.bashrc, ~/.zshrc, etc.):
alias git="co-authors"Then reload your shell:
source ~/.zshrc # or ~/.bashrcWith this alias in place, all git commands pass through co-authors transparently. Only git commit gets special handling — everything else is forwarded to the real git binary unchanged.
Set GIT_AGENT to the agent key for automatic Co-Authored-By trailer injection:
GIT_AGENT=claude git commit -m "Add feature"
# Commits with: Co-Authored-By: Claude <noreply@anthropic.com>For persistent attribution in a session (e.g. inside a Claude Code session), export the variable:
export GIT_AGENT=claude
git commit -m "Add feature"When GIT_AGENT is not set and no -m message is provided, co-authors prompts you to select an agent interactively:
git commit
# Displays a selection prompt: claude, codex, cursor, or NoneUse --agent to specify the agent for a single commit without setting GIT_AGENT:
git commit -m "Add feature" --agent claude
git commit -m "Add feature" --agent=claudeThis also overrides GIT_AGENT if it is already set.
Use --me to skip trailer injection entirely — useful when GIT_AGENT is exported but a particular commit is your own work:
git commit -m "Fix typo" --meIf -m is provided but GIT_AGENT is not set and --agent is not used, the commit proceeds without any trailer — no prompt is shown.
All non-commit subcommands are passed through unchanged:
git status # forwarded directly to git
git push # forwarded directly to git| Agent key | Co-Authored-By trailer |
|---|---|
claude |
Claude <noreply@anthropic.com> |
codex |
Codex <codex@openai.com> |
cursor |
Cursor <cursoragent@cursor.com> |
Trailers are never duplicated — if the same Co-Authored-By value is already present, it is not added again.

