-
Notifications
You must be signed in to change notification settings - Fork 0
fix(completion-integrity): remove Claude hooks, keep git hook only #54
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
Claude hooks don't work with --dangerously-skip-permissions mode. Keep only the git pre-commit hook which works in all modes. Removed: - hooks/hooks.json - hooks/scripts/pre-commit-gate.sh (PreToolUse - bypassed) - hooks/scripts/phase-end-check.sh (Stop - uncertain) Kept: - scripts/install-git-hook.sh (native git hook) - scripts/integrity-check.sh (detection logic) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughReplaces hook-based enforcement with a repository-installed Git pre-commit hook: removes plugin hook declarations and hook scripts, adds an installer and pre-commit hook script, and updates documentation and changelog to document the new install path and behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer (git client)
participant Hook as pre-commit hook (repo/.git/hooks/pre-commit)
participant Installer as install-git-hook.sh
participant Checker as integrity check logic (hook script)
Note over Installer, Hook: Installation flow
Dev->>Installer: run install-git-hook.sh
Installer-->>Dev: writes `pre-commit` to repo/.git/hooks, backs up existing hook
Note over Dev, Hook: Commit-time flow (new)
Dev->>Hook: git commit (pre-commit triggered)
Hook->>Checker: analyze staged files (exclude docs/scripts)
alt Violations found
Checker-->>Hook: report violations (colorized output)
Hook-->>Dev: exit non-zero (blocks commit)
else No violations
Checker-->>Hook: success
Hook-->>Dev: exit 0 (allow commit)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @ANcpLua, 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 refines the completion integrity plugin by eliminating problematic Claude-specific hooks that interfered with certain operational modes. The change consolidates the integrity checking mechanism to solely rely on a robust native Git pre-commit hook, ensuring consistent and reliable enforcement of code quality standards regardless of the plugin's execution context. This streamlines the plugin's architecture and improves its compatibility. 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 effectively simplifies the completion-integrity plugin by removing the Claude-specific hooks, which were causing issues with certain modes, and retaining only the more robust native git pre-commit hook. The changes are logical and the updates to the documentation in README.md and SKILL.md correctly reflect this simplification. I have one suggestion to improve the clarity of the installation instructions. Additionally, please note that the repository style guide (lines 20, 109) requires updating CHANGELOG.md for non-trivial changes like this one.
| /plugin install completion-integrity@ancplua-claude-plugins | ||
|
|
||
| # Install the git hook in your repo | ||
| bash scripts/install-git-hook.sh |
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.
The installation path scripts/install-git-hook.sh is ambiguous. It assumes the user is running the command from within the plugins/completion-integrity/ directory. To ensure the command works correctly for users at the repository root and to prevent confusion, it's better to provide the full path from the repository root.
| bash scripts/install-git-hook.sh | |
| bash plugins/completion-integrity/scripts/install-git-hook.sh |
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 removes Claude Code plugin hooks (hooks.json, pre-commit-gate.sh, phase-end-check.sh) that don't work with --dangerously-skip-permissions mode, while attempting to keep the native git pre-commit hook functionality. The changes update documentation to reflect that only the git hook mechanism is used going forward.
Key changes:
- Removes Claude plugin hook infrastructure that relied on
PreToolUseandStopevents - Updates documentation to describe the plugin as using only git hooks
- Simplifies the plugin.json by removing the hooks reference
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
plugins/completion-integrity/.claude-plugin/plugin.json |
Removes hooks reference from plugin manifest |
plugins/completion-integrity/README.md |
Updates solution description and installation instructions to reference git hooks only; removes phase-end scoring documentation |
plugins/completion-integrity/skills/completion-integrity/SKILL.md |
Updates description, adds installation section, removes hooks documentation, updates failure conditions |
plugins/completion-integrity/hooks/hooks.json |
Deletes Claude plugin hooks configuration |
plugins/completion-integrity/hooks/scripts/pre-commit-gate.sh |
Deletes PreToolUse hook script |
plugins/completion-integrity/hooks/scripts/phase-end-check.sh |
Deletes Stop hook script |
| # Install the git hook in your repo | ||
| bash scripts/install-git-hook.sh |
Copilot
AI
Jan 7, 2026
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.
The documentation references a script that does not exist. The file scripts/install-git-hook.sh is not present in the repository. Either this script needs to be added, or the documentation should be updated to reflect the actual installation process. According to the PR description, this script was supposed to be kept, but it appears to be missing from the codebase.
| # Install the git hook in your repo | |
| bash scripts/install-git-hook.sh | |
| # Install the git pre-commit hook in your repo (from the repo root) | |
| cat > .git/hooks/pre-commit << 'EOF' | |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| bash scripts/integrity-check.sh | |
| EOF | |
| chmod +x .git/hooks/pre-commit |
| ```bash | ||
| bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh" |
Copilot
AI
Jan 7, 2026
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.
The documentation references a script that does not exist. The file scripts/install-git-hook.sh is not present in the repository. Either this script needs to be added, or the documentation should be updated to reflect the actual installation process. According to the PR description, this script was supposed to be kept, but it appears to be missing from the codebase.
| ```bash | |
| bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh" | |
| Create (or update) `.git/hooks/pre-commit` in your repository to run the integrity check, then make it executable: | |
| ```bash | |
| # .git/hooks/pre-commit | |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| CLAUDE_PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-plugins/completion-integrity}" | |
| bash "${CLAUDE_PLUGIN_ROOT}/scripts/integrity-check.sh" |
| /plugin install completion-integrity@ancplua-claude-plugins | ||
|
|
||
| # Install the git hook in your repo | ||
| bash scripts/install-git-hook.sh |
Copilot
AI
Jan 7, 2026
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.
The installation instructions are inconsistent between README.md and SKILL.md. README.md uses bash scripts/install-git-hook.sh (relative path), while SKILL.md uses bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh" (environment variable path). These should use the same approach for consistency. Since SKILL.md is used within the Claude Code context where CLAUDE_PLUGIN_ROOT is available, the SKILL.md version is appropriate for its context, but the README.md version is more appropriate for general use. Both need to be fixed to reference an actual existing script first.
| bash scripts/install-git-hook.sh | |
| bash "${CLAUDE_PLUGIN_ROOT}/scripts/install-git-hook.sh" |
| # Completion Integrity | ||
|
|
||
| This plugin enforces honest task completion by detecting and blocking shortcuts. | ||
| Git pre-commit hook that blocks commits with integrity violations. |
Copilot
AI
Jan 7, 2026
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.
The description "Git pre-commit hook that blocks commits with integrity violations" is incomplete. This plugin is described as providing both the git hook AND the integrity check script, but the description only mentions the git hook. Consider revising to something like "Detects and blocks integrity violations in commits using a git pre-commit hook" or "Provides integrity checking for commits to prevent shortcuts and cheating".
| Git pre-commit hook that blocks commits with integrity violations. | |
| Detects and blocks integrity violations in commits using a git pre-commit hook and a manual integrity check script. |
- Add scripts/install-git-hook.sh (was missing from PR) - Update CHANGELOG to reflect git-hook-only approach - Address reviewer feedback from Copilot/Gemini 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
Remove Claude plugin hooks since they don't work with
--dangerously-skip-permissionsmode.Removed
hooks/hooks.jsonhooks/scripts/pre-commit-gate.sh(PreToolUse - bypassed in skip-permissions mode)hooks/scripts/phase-end-check.sh(Stop - uncertain behavior)Kept
scripts/install-git-hook.sh- Native git pre-commit hook (works in ALL modes)scripts/integrity-check.sh- Detection logic (used by git hook)Test plan
bash scripts/install-git-hook.sh🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.