Skip to content

Instantly share code, notes, and snippets.

@coverboy
Last active February 11, 2026 23:04
Show Gist options
  • Select an option

  • Save coverboy/58ac4bccc0e018a7c6dfa7a956214ffe to your computer and use it in GitHub Desktop.

Select an option

Save coverboy/58ac4bccc0e018a7c6dfa7a956214ffe to your computer and use it in GitHub Desktop.
Git commit-msg hook: Claude 서명 차단 (Frontend/Backend 공통)
#!/bin/bash
################################################################################
# Git commit-msg hook: Claude 서명 차단
#
# 설치 방법:
# 1. 이 파일을 .git/hooks/commit-msg 에 저장
# cp commit-msg /path/to/your/project/.git/hooks/commit-msg
#
# 2. 실행 권한 부여
# chmod +x /path/to/your/project/.git/hooks/commit-msg
#
# 3. Frontend/Backend 모두 적용해야 함
# - Frontend: /home/coverboy/PycharmProjects/ssvalve_frontend/.git/hooks/commit-msg
# - Backend: /home/coverboy/PycharmProjects/ssvalve_backend/.git/hooks/commit-msg
#
# 동작:
# - 커밋 메시지에 Claude 서명이 있으면 커밋 거부
# - Co-Authored-By: Claude 또는 Generated with Claude Code 감지
#
################################################################################
# Claude 서명 감지 및 커밋 거부
if grep -q "Co-Authored-By: Claude" "$1"; then
echo ""
echo "❌❌❌ 커밋 거부 ❌❌❌"
echo ""
echo "Claude 서명이 감지되었습니다:"
echo " Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>"
echo ""
echo "이 서명은 절대 금지되어 있습니다."
echo "커밋 메시지를 수정하고 다시 시도하세요."
echo ""
exit 1
fi
if grep -q "Generated with Claude Code" "$1"; then
echo ""
echo "❌❌❌ 커밋 거부 ❌❌❌"
echo ""
echo "Claude Code 관련 문구가 감지되었습니다:"
echo " 🤖 Generated with Claude Code"
echo ""
echo "이 문구는 절대 금지되어 있습니다."
echo "커밋 메시지를 수정하고 다시 시도하세요."
echo ""
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment