Repository navigation
Conversation
Adds a commit-msg hook that removes Co-Authored-By: Claude and Claude-Session trailers, an installer (per-repo or global), a Claude Code PreToolUse guard against --no-verify and hooksPath bypasses, a dry-run-by-default git filter-repo wrapper for existing commits, tests, and a workflow that runs them.
…cwd-safe Adds the supported attribution.commit="" / attribution.sessionUrl=false setting to the example settings and documents it as the first line of defense; the hook stays as a backstop. The SessionStart command now cds into CLAUDE_PROJECT_DIR first, so it works when the session's working directory is not the repository.
Repositories that run ruff format --check or black over the whole tree rejected the vendored copy. No behaviour change; tests still pass.
Resolves add/add conflicts on the files this branch updates by keeping this branch's versions, which are supersets of what was squash-merged to main (attribution setting, cwd-safe SessionStart, black-formatted guard).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #12. The hook only fires where
core.hooksPathhas been pointed at.githooks/, so a machine that never ran that step still gets the trailers. Claude Code has a supportedattributionsetting that stops them being written at all; this makes that the first line of defense and keeps the hook as the backstop.Changes
claude-settings.example.json: adds"attribution": {"commit": "", "sessionUrl": false}, which removes theCo-Authored-Bytrailer and theClaude-Session:link wherever the project settings load, with no git configuration. TheSessionStartcommand now runscd "${CLAUDE_PROJECT_DIR:-.}"first, so it works when the session's working directory is not the repository (multi-repo cloud sessions).README.md: documents the setting up front, notes"pr": ""for the pull-request footer, and positions the hook as the backstop.How tested
tools/commit-cleaner/test.shstill passes (no script changes). The same settings change is pushed to every wired repository's open PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01MU3XgW95kXzx2SHkKwPW32
Generated by Claude Code