fix: enable Claude Code hooks in shared settings - #451
Conversation
- Add hooks configuration to settings.json for all Codespace users - Enable PreToolUse hooks for git quality gates and no-verify blocking - Enable PostToolUse hook for AI review after PR creation - Add execute permission to block_git_no_verify.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds a new "hooks" configuration section to the Claude settings file with PreToolUse hooks that execute Python scripts before Bash tools and ExitPlanMode, and a PostToolUse hook that runs after PR creation via Bash. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
🚥 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)
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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.claude/settings.json (1)
89-92:⚠️ Potential issue | 🟡 MinorMinor: duplicate permission entry for
git checkout.Lines 89 and 92 both allow
Bash(git checkout:*). This is harmless but appears to be a copy-paste artifact.Proposed fix
"Bash(git checkout:*)", "Bash(git add:*)", "Bash(git push:*)", - "Bash(git checkout:*)", "Bash(git remote set-url:*)",
PR Review: Claude Code Hooks の共有設定対応✅ 変更内容の評価このPRは、Codespace環境でClaude Code hooksが動作しない問題を解決するため、個人設定ファイルから共有設定ファイルへhooks設定を移動しています。 🎯 良い点
|
|
🎉 This PR is included in version 1.68.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
settings.local.jsonはgitignoreされているため、共有設定のsettings.jsonにhooks設定を追加block_git_no_verify.pyに実行権限を付与Changes
.claude/settings.json: hooks設定を追加.claude/hooks/block_git_no_verify.py: 実行権限を付与Test plan
gh pr create実行後にAIレビューが自動実行されることを確認git commit前にQuality Gatesが実行されることを確認🤖 Generated with Claude Code
Summary by CodeRabbit
Note: This release includes internal process improvements with no direct user-facing changes.