Skip to content

commit-cleaner: turn attribution off via settings, make SessionStart cwd-safe - #13

Closed
jacobyoby wants to merge 4 commits into
mainfrom
claude/peaceful-tesla-ngjufs
Closed

jacobyoby wants to merge 4 commits into
mainfrom
claude/peaceful-tesla-ngjufs

Conversation

@jacobyoby

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #12. The hook only fires where core.hooksPath has been pointed at .githooks/, so a machine that never ran that step still gets the trailers. Claude Code has a supported attribution setting 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 the Co-Authored-By trailer and the Claude-Session: link wherever the project settings load, with no git configuration. The SessionStart command now runs cd "${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.sh still 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

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).
@jacobyoby jacobyoby closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants