{"slug": "til-disable-claude-code-s-co-author-git-attribution", "title": "TIL: Disable Claude Code's Co-Author Git Attribution", "summary": "Claude Code now controls git and pull-request attribution through a dedicated `attribution` configuration object, and older keys such as `gitCommitCoAuthor` and the deprecated `includeCoAuthoredBy` are ignored, according to a TIL write-up on disabling the trailers. By default Anthropic's Claude Code appends a `Co-Authored-By: Claude` trailer to commits, a `Generated with Claude Code` footer to pull requests, and a `Claude-Session: <url>` trailer to remote sessions; setting `commit` and `pr` to empty strings in `~/.claude/settings.json` or `.claude/settings.json` drops them, and `sessionUrl: false` suppresses the session URL. The write-up also recommends `CLAUDE.md` rules and a `commit-msg` git hook to strip `Co-Authored-By: Claude` lines for enforcement across agent runs.", "body_md": "## On this page\n\n# Disable Claude Code's Co-Author Git Attribution\n\nToday I learned how to stop Claude Code from adding git attribution trailers to my commits and pull requests.\n\nI initially added `\"gitCommitCoAuthor\": false` to my settings file. I expected that to silence the AI commit signatures. It did not. Claude Code continued stamping `Co-Authored-By: Claude <` trailers onto every commit and appending footer notes to pull requests.[\\[email protected\\]](https://kondasamy.com/cdn-cgi/l/email-protection)>\n\nThe culprit was a configuration mismatch. Older boolean flags like `includeCoAuthoredBy` are deprecated, and unmapped keys like `gitCommitCoAuthor` are ignored. Current versions of Claude Code control this behavior through a dedicated `attribution` configuration object.\n\n## The Default Behavior\n\nBy default, Anthropic configures Claude Code to stamp provenance data onto your version control artifacts:\n\n1. **Git commits:** Appends a`Co-Authored-By: Claude <`[\\[email protected\\]](https://kondasamy.com/cdn-cgi/l/email-protection) >\ntrailer line.\n2. **Pull requests:** Appends a`Generated with Claude Code` footer note.\n3. **Remote sessions:** Appends a`Claude-Session: <url>` trailer line.\n\nThis metadata suits teams that require audit trails for generated code. But for solo developers, client repositories with strict authorship guidelines, or engineers who view Claude Code as a local editor tool, these trailers clutter your git log.\n\n## The Fix: The `attribution` Setting\n\nTo turn off git and pull request attribution, update your `settings.json` file. You can configure this globally for all projects or locally within a single repository:\n\n- **Global configuration:**`~/.claude/settings.json`\n- **Project-level configuration:**`.claude/settings.json` (inside your repository root)\n\nSet the `commit` and `pr` properties to empty strings:\n\n```\n{\n  \"attribution\": {\n    \"commit\": \"\",\n    \"pr\": \"\"\n  }\n}\n```\n\nIf you also run Claude Code from web or remote sessions, suppress the session URL trailer by setting `sessionUrl` to `false`:\n\n```\n{\n  \"attribution\": {\n    \"commit\": \"\",\n    \"pr\": \"\",\n    \"sessionUrl\": false\n  }\n}\n```\n\nPassing empty strings instructs the harness to drop the trailer lines entirely instead of falling back to default text.\n\n## Configuration Keys Compared\n\nClaude Code’s configuration options changed across releases. Here is how the keys differ:\n\n| Setting Key | Status | Result | \n|---|---|---|\n| `\"gitCommitCoAuthor\": false` | Invalid | Key is ignored. Claude Code continues appending commit trailers. | \n| `\"includeCoAuthoredBy\": false` | Deprecated | Replaced by `attribution` . Ignored in modern releases. | \n| `\"attribution\": { \"commit\": \"\", \"pr\": \"\" }` | Current standard | Empties the commit trailer and drops the pull request footer. | \n\n## Defense in Depth: Project Instructions and Git Hooks\n\nThe `attribution` setting handles automated tools. But Claude Code can still construct commit trailers manually if prompted to write a commit message in a shell command. Two extra layers prevent this.\n\n### 1. Add Rules to `CLAUDE.md`\n\nAdd an explicit rule to your global `~/.claude/CLAUDE.md` or repository-level `CLAUDE.md` file:\n\n```\n## Git Commit Conventions\n- Never add `Co-Authored-By` or AI attribution trailers to commit messages.\n- Never add \"Generated with Claude Code\" footers to pull request descriptions.\n```\n\n### 2. Enforce with a Local Git Hook\n\nIf you want absolute enforcement across all agent runs and terminal sessions, add a `commit-msg` hook to your repository:\n\n``` bash\ncat << 'EOF' > .git/hooks/commit-msg\n#!/bin/sh\nCOMMIT_MSG_FILE=$1\nsed -i '' '/Co-Authored-By: Claude/d' \"$COMMIT_MSG_FILE\" 2>/dev/null || sed -i '/Co-Authored-By: Claude/d' \"$COMMIT_MSG_FILE\"\nEOF\n\nchmod +x .git/hooks/commit-msg\n```\n\nThe hook strips any `Co-Authored-By: Claude` lines from the commit message file before git creates the commit object.\n\n## Cleaning Up Recent Commits\n\nIf Claude Code already stamped trailers onto your latest unpushed commit, remove the trailer by amending the commit message:\n\n```\ngit commit --amend --no-edit\n```\n\nFor older unpushed commits, run an interactive rebase (`git rebase -i HEAD~N`) and reword the commit messages to remove the trailer lines.\n\n## What I Learned\n\n- `\"gitCommitCoAuthor\": false` is not a valid setting. Claude Code ignores it and continues stamping commits.\n- Claude Code deprecated the older `\"includeCoAuthoredBy\": false` flag in favor of the structured`\"attribution\"` setting.\n- Setting `\"commit\": \"\"` and`\"pr\": \"\"` inside the`\"attribution\"` object strips attribution trailers from commits and pull requests.\n- Set `\"sessionUrl\": false` inside the`\"attribution\"` block to remove session link trailers during remote runs.\n- Combining the `attribution` configuration with a`CLAUDE.md` prompt rule and a local`commit-msg` hook stops attribution across every surface.\n\n## References\n\n*Prefer keeping your Git history free of AI attribution trailers? Tell me how your team handles commit provenance on [LinkedIn](https://www.linkedin.com/in/kondasamy/).*", "url": "https://wpnews.pro/news/til-disable-claude-code-s-co-author-git-attribution", "canonical_source": "https://kondasamy.com/til/2026/claude-code-disable-git-attribution/", "published_at": "2026-10-27 00:00:00+00:00", "updated_at": "2026-10-27 12:11:12.274407+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents", "artificial-intelligence"], "entities": ["Claude Code", "Anthropic", "Git"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/til-disable-claude-code-s-co-author-git-attribution", "markdown": "https://wpnews.pro/news/til-disable-claude-code-s-co-author-git-attribution.md", "text": "https://wpnews.pro/news/til-disable-claude-code-s-co-author-git-attribution.txt", "jsonld": "https://wpnews.pro/news/til-disable-claude-code-s-co-author-git-attribution.jsonld"}}