Implementing guard against AI attribution in git commands#51
Merged
Conversation
Copilot created this pull request from a session on behalf of
tutods
July 9, 2026 11:58
View session
tutods
marked this pull request as ready for review
July 9, 2026 12:09
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent AI attribution text from being included in git commits and GitHub PR-related commands run through Claude Code, by adding explicit attribution settings and a PreToolUse hook guard script.
Changes:
- Adds
attributionsettings intended to suppress commit/PR attribution in Claude Code settings generation. - Replaces the existing
PreToolUse(Bash)hook command with a new hook script intended to deny commit/PR commands containing AI attribution or co-author trailers. - Installs a new
block-ai-attribution.shhook script into~/.claude/hooks/via Home Manager.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| home/common/cli/ai/tools/claude/settings.nix | Adds attribution config and updates Claude Code PreToolUse hook wiring; installs the new hook script into ~/.claude/hooks/. |
| home/common/cli/ai/tools/claude/block-ai-attribution.sh | Introduces a PreToolUse guard that scans git commit / gh pr / gh api command content and denies if AI attribution patterns are detected. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
37
to
41
| type = "command"; | ||
| command = "rtk hook claude"; | ||
| command = "\"$HOME/.claude/hooks/block-ai-attribution.sh\""; | ||
| timeout = 10; | ||
| statusMessage = "Checking commit/PR for AI attribution"; | ||
| } |
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.
Pull request created by AI Agent