-
Notifications
You must be signed in to change notification settings - Fork 1
feat(claude): add Claude Code hookify plugin #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Activated the hookify plugin in .claude/settings.json and added three local hook rules for blocking package folder edits, syncing documentation, and warning on security issues. Updated .gitignore to stop ignoring .claude/*.local.* files and to ignore .claude/settings.local.json instead. Co-Authored-By: Claude <noreply@anthropic.com>
Expanded file pattern matching and improved instructions in sync-docs rule, clarified checklist formatting, and added spacing for readability in block-packages and warn-security rules. Co-Authored-By: Claude <noreply@anthropic.com>
Introduces .claude/hooks/notify.sh, a Bash script that sends enhanced notifications with prompt previews and status icons based on task completion. Updates settings.json to use this script instead of a static osascript command. Co-Authored-By: Claude <noreply@anthropic.com>
Set the 'require-tests' hook to disabled in the local configuration. Added a TODO note to consider using alternative test commands like 'make test' or 'make check'.
Summary of ChangesHello @kimchanhyung98, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the local development experience within the Claude Code environment by integrating the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a great initiative to improve the local development workflow using hookify and enhance notifications. The new hooks for blocking package edits, reminding about documentation, and warning about security issues are valuable additions. My review focuses on improving the robustness, security, and performance of the newly added scripts and configurations. I've provided suggestions to refine the regular expressions in the hooks for better accuracy and to address a critical command injection vulnerability in the notification script, along with other performance and reliability improvements for that script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the Claude Code development environment by introducing workflow automation through the hookify plugin and improving task completion notifications. The changes establish guardrails for development practices and provide richer feedback through enhanced notifications.
Changes:
- Enabled the hookify plugin and added four local hook configurations to enforce best practices (blocking dependency folder edits, warning about documentation updates, detecting security issues, and optionally requiring tests)
- Replaced the simple notification command with a sophisticated shell script that extracts prompts from history and provides context-aware notifications with different sounds and status icons
- Updated
.gitignoreto allow tracking of.local.mdhookify configuration files while maintaining privacy for.local.jsonsettings
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.gitignore |
Modified to specifically ignore only .claude/settings.local.json instead of all .local.* files, allowing hookify .local.md files to be tracked |
.claude/settings.json |
Enabled the hookify plugin and updated the Stop hook to use the new notification script instead of a simple osascript command |
.claude/hooks/notify.sh |
Added a new bash script that parses hook JSON input, extracts session information from history, and displays rich notifications with status icons and sounds based on stop reason |
.claude/hookify.block-packages.local.md |
Added hook to block direct edits to dependency folders like node_modules/, vendor/, .venv/, and .git/ |
.claude/hookify.sync-docs.local.md |
Added hook to warn when code files are modified, prompting documentation updates in domain docs |
.claude/hookify.warn-security.local.md |
Added hook to detect debug code and hardcoded secrets in code changes |
.claude/hookify.require-tests.local.md |
Added (but disabled) hook to require test execution before task completion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
정규식 패턴을 개선하여 하위 디렉토리의 패키지 폴더도 정확히 차단: 변경 전: - pattern: node_modules/|vendor/|\.venv/|venv/|__pycache__/|\.git/ - 문제: src/my_vendor/ 같은 False positive 매칭 변경 후: - pattern: (^|/)(node_modules|vendor|\.venv|venv|__pycache__|\.git)/ - 개선: 경로 어디든 정확한 디렉토리 이름만 매칭 - 효과: False positive 방지 + 하위 디렉토리 100% 매칭 테스트 결과: ✅ node_modules/, src/node_modules/, api/vendor/ 모두 차단 ❌ my_node_modules_backup/, my_vendor/ 허용 (False positive 방지) Co-Authored-By: Claude <noreply@anthropic.com>
jq 중복 호출을 제거하여 성능 21% 개선: 변경 전: - get_status()와 get_sound()에서 각각 jq 호출 (2회/실행) - 평균 실행 시간: 14ms 변경 후: - REASON 변수를 한 번만 파싱하여 함수에 매개변수로 전달 - jq 호출 1회/실행으로 감소 (50% 절감) - 평균 실행 시간: 11ms (21% 향상) 개선 효과: ⚡ 성능: 21% 빠름 ♻️ 코드: DRY 원칙 준수, 가독성 향상 ✅ 검증: 모든 stop_reason 케이스 정상 작동 추가 수정: - osascript 명령 닫는 따옴표 버그 수정 Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request introduces several improvements to local development workflow automation and notification handling for the Claude Code environment. The main changes include enabling and configuring the
hookifyplugin with multiple local hooks to enforce best practices (such as blocking edits to dependency folders, warning about missing documentation updates, and detecting debug code or secrets), as well as replacing the previous simple notification command with an enhanced shell script that provides richer feedback upon task completion.Key changes:
Hookify plugin and local hooks:
hookifyplugin in.claude/settings.jsonto allow custom workflow automation hooks..claude/hookify.block-packages.local.mdto block direct edits to dependency and environment folders (e.g.,node_modules/,vendor/,.venv/,.git/) with a clear message in both English and Korean..claude/hookify.sync-docs.local.mdto warn when code files are changed, reminding developers to update or add documentation in the relevant domain docs..claude/hookify.warn-security.local.mdto warn if debug code or hardcoded secrets are detected in code changes, helping prevent accidental leaks or debug artifacts..claude/hookify.require-tests.local.md(currently disabled) to block completion if common test commands are not detected in the transcript, encouraging test execution before finishing work.Notification improvements:
.claude/hooks/notify.sh, a shell script that shows a status icon, a preview of the last prompt, and uses different sounds based on the stop reason, providing more context in task completion notifications. [1] [2]Greptile Overview
Greptile Summary
Enables the hookify plugin and adds four local workflow automation hooks to enforce development best practices: blocking edits to dependency folders, warning about documentation sync needs, detecting debug code and hardcoded secrets, and optionally requiring test execution. Also replaces the simple notification command with an enhanced shell script (
notify.sh) that reads session history to display a preview of the last prompt along with context-aware notification sounds.Major changes:
hookify@claude-plugins-officialplugin in settings.claude/hookify.block-packages.local.mdto prevent accidental edits tonode_modules/,vendor/,.venv/, and.git/.claude/hookify.warn-security.local.mdto detectconsole.log,debugger,var_dump, and hardcoded secrets.claude/hookify.sync-docs.local.mdto remind developers to update domain documentation.claude/hookify.require-tests.local.md(disabled by default) to enforce test execution.claude/hooks/notify.shfor richer task completion notifications with prompt preview.gitignoreto allow*.local.mdhookify files while excludingsettings.local.jsonNotes:
notify.shscript requiresjqandosascript(macOS-only), so this enhancement is platform-specificConfidence Score: 5/5
set -euo pipefail, safely processes JSON input, and uses appropriate string interpolation. All changes are additive and improve the development workflow without affecting production code.Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Claude as Claude Code participant Hookify as Hookify Plugin participant NotifyScript as notify.sh participant History as ~/.claude/history.jsonl participant macOS as macOS Notification User->>Claude: Edits code file Claude->>Hookify: File event triggered alt File matches blocked patterns Hookify->>Hookify: Check block-packages rule Hookify-->>Claude: Block edit (node_modules, .git, etc.) Claude-->>User: Show block message else File is source code Hookify->>Hookify: Check warn-security rule alt Debug code or secrets detected Hookify-->>Claude: Warn about security issue Claude-->>User: Show warning end Hookify->>Hookify: Check sync-docs rule Hookify-->>Claude: Warn to update docs Claude-->>User: Show documentation reminder end User->>Claude: Task completion (stop event) Claude->>Hookify: Stop event triggered alt require-tests enabled Hookify->>Hookify: Check transcript for test commands alt No tests found Hookify-->>Claude: Block completion Claude-->>User: Request test execution end end Claude->>NotifyScript: Execute hook with JSON input NotifyScript->>NotifyScript: Parse session_id from stdin NotifyScript->>History: Read history.jsonl History-->>NotifyScript: Return last prompt for session NotifyScript->>NotifyScript: Determine status icon & sound NotifyScript->>macOS: osascript display notification macOS-->>User: Show notification with prompt preview