A Git hook to augment Claude-code attribution
Iain Maitland released strip-claude, an automated Git commit-msg hook that strips trailing Claude Sonnet 5 attribution lines and session URLs from commits.
By Dillip Chowdary β’ Nov 08, 2026 β’ Source: gist.github.com
Software developer Iain Maitland released strip-claude on August 14, 2026, delivering a dedicated client-side utility designed to sanitize version control histories generated by Anthropic coding tools. Published as documented in gist.github.com's report, the project provides an automated Git commit-msg hook that parses commit message text and strips out trailing Claude Code attribution signatures. Anthropic's command-line assistant routinely appends metadata tags and co-authorship markers to describe the machine-assisted provenance of code revisions. The strip-claude script intervenes directly during the local commit workflow, systematically searching for known automated trailer phrases and discarding them before Git seals the commit object into the repository history.
This teardown examines the technical architecture, deployment options, behavioral boundaries, and workflow implications of deploying the strip-claude hook across software development environments. It is intended for software engineers, repository maintainers, and security administrators who rely on Anthropic's Claude Code utility but require strict adherence to standardized repository commit styling or privacy guidelines. The report outlines installation methods for global and repository-specific hook configurations, details the exact syntax patterns targeted for removal, reviews local test verification steps, and evaluates the alternative native attribution settings documented within the Claude Code toolchain.
A Git hook to augment Claude-code attribution: what actually changed
The release of strip-claude introduces an explicit filtering layer into Git commit lifecycle operations to counter automated metadata append behaviors. When Claude Code authors or suggests changes, it appends explicit trailer lines to record tool involvement, including co-author tags and session telemetry URLs. Specifically, strip-claude targets and purges trailing lines matching Co-Authored-By: Claude Sonnet 5 followed by noreply@anthropic.com. It similarly targets Claude-Session lines carrying full URLs pointing to claude.ai tracking instances. Additionally, it identifies and removes plain-text markers including Generated with Claude Code, Created by Claude Code, and markdown-formatted links citing Generated with Claude Code pointing to claude.com/claude-code.
The utility confines its modifications strictly to trailing automated tags while preserving deliberate mentions of artificial intelligence inside the main message narrative. In standard commit construction, developers frequently document architectural reasons, tool comparisons, or prompt requirements in the body of their message. The hook leaves interior sentences untouched, ensuring that a commit body discussing Claude continues to display intact. By distinguishing between descriptive commit commentary and automated trailer tags appended at the end of the message payload, strip-claude prevents inadvertent censorship of human explanations while removing the boilerplate markers appended by Anthropic's agent.
A Git hook to augment Claude-code attribution: how it works

The hook executes as an executable commit-msg shell script that Git invokes automatically after a commit message file is drafted but before the commit completes. Git supplies the path of the temporary file containing the commit text as the script's first argument. When invoked, strip-claude reads this file path, evaluates the final lines against known attribution patterns, rewrites the file in place without the trailing Claude strings, and returns an exit code of zero. Because Git halts commit processing if a commit-msg hook exits with a non-zero status, the script functions cleanly within standard shell environments without disrupting routine terminal operations.
Engineers can deploy the hook across an entire machine or limit execution to a solitary codebase. To install globally across all active repositories, users create a dedicated directory at ~/.config/git/hooks, download the raw strip-claude-commit-msg script from Maitland's repository gist, assign execute permissions with chmod +x, and configure Git using git config --global core.hooksPath set to ~/.config/git/hooks. For repository-scoped usage, developers establish a local .githooks directory in the root of the project, fetch the executable script into .githooks/commit-msg, make it executable, and bind the path locally using git config core.hooksPath .githooks.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
A Git hook to augment Claude-code attribution: why it matters
Standardizing commit messages is a standard governance requirement across enterprise codebases and public open-source foundations. Many engineering organizations enforce rigid message syntaxes, such as Conventional Commits, that forbid unexpected co-author headers or external tracking links. Automated trailers like Claude-Session links point to external web sessions hosted on claude.ai, introducing external URLs into permanent version histories. The strip-claude hook resolves these formatting conflicts locally on the developer machine, preventing automated agent tags from entering public repositories without requiring continuous manual editing by the contributing programmer.
Beyond simple message sanitation, the hook introduces the capability to reconfigure attribution messaging to match developer intent or corporate disclosure policies. Maitland notes that the script can be modified either to misdirect attribution toward another agent or to substitute standard trailers with honest, customized disclosures. For example, a developer can customize the script to replace standard Anthropic signatures with an explicit declaration stating that an LLM trained on the sum total of human knowledge was used. This gives teams granular control over commit metadata rather than accepting fixed vendor branding strings.
A Git hook to augment Claude-code attribution: who is affected
Software engineers utilizing Claude Code alongside Git-managed codebases represent the primary group directly affected by this hook. Developers working under strict corporate attribution policies often find themselves forced to delete trailing markers manually on every generated commit. For these contributors, deploying strip-claude automates message cleanup across all local checkouts, ensuring that Co-Authored-By tags attributing changes to Claude Sonnet 5 do not generate build failures in continuous integration pipelines configured to validate author identity or email domain formats.
Repository administrators and peer reviewers reviewing pull requests also encounter the effects of the tool. When contributors implement strip-claude, incoming commits no longer carry third-party session URLs or vendor attribution footers in their metadata headers. Reviewers evaluating incoming patches see only the developer's specified commit title and descriptive body paragraphs. This eliminates visual noise in Git log histories and prevents company codebases from serving as link conduits back to vendor landing pages such as claude.com/claude-code across public GitHub and GitLab repositories.
A Git hook to augment Claude-code attribution: what to watch
Verification and validation workflows are critical elements to observe when incorporating strip-claude into local developer environments. Testing the hook locally involves generating a temporary file using mktemp, populating it with a test subject line, an explanatory body noting that mentions of Claude should stay, and trailing attribution markers. Running the hook directly from the configured hooks directory against the temporary file confirms that the body text remains while the trailing signatures disappear. Developers must ensure core.hooksPath points to the directory containing the executable commit-msg binary to avoid silent execution failures.
Users should also monitor upstream configuration capabilities provided natively within Claude Code. Maitland points out that Claude Code includes built-in attribution settings that can be configured directly at the source to omit trailing attribution lines entirely. However, the author emphasizes that while native configuration omits default attribution, it does not provide options to replace the removed lines with customized, transparent declarations. Development teams must evaluate whether native source suppression or a customizable client-side Git hook best satisfies their logging and attribution standards.
Developer Action Items
- β Diff the official changelog for Anthropic / Claude / GitHub before you bump β APIs, defaults, and removed flags only.
- β Install through the vendor's documented channel in staging; keep a one-command rollback and time-box the canary.
- β Grep your repo for old flag names, lockfile pins, and plugin versions that the notes mark as breaking.
- β Prefer the first patch cut over the day-zero tag unless you have a reason to be on the leading edge.
- β If HN Claude/Codex/Fable did not name a region, plan, or SKU, screenshot the official availability line before you promise it to users.
A Git hook to augment Claude-code attribution FAQ
What specific commit message lines does strip-claude remove?
It removes trailing lines including Co-Authored-By: Claude Sonnet 5 with noreply@anthropic.com, Claude-Session URLs on claude.ai, Created by Claude Code, and Generated with Claude Code plain text and markdown links.
How can strip-claude be installed across all Git repositories on a system?
Users create the directory ~/.config/git/hooks, download the strip-claude-commit-msg script, apply execute permissions with chmod +x, and run git config --global core.hooksPath ~/.config/git/hooks.
Does strip-claude delete references to Claude written inside the commit body?
No, the hook only strips specified trailing attribution metadata lines at the end of the message, leaving explanations or mentions of Claude inside the main body intact.
Can Claude Code disable attribution without using an external Git hook?
Yes, Claude Code includes native attribution settings that can be configured at the source to omit trailer lines, though it cannot inject custom disclosures like the script can.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement