refactor(stack): install Claude hooks globally#925
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
🧪 CI InsightsHere's what we observed from your CI run for ca34ab5. 🟢 All jobs passed!But CI Insights is watching 👀 |
There was a problem hiding this comment.
Pull request overview
This pull request refactors Claude hook installation from a per-project to a global approach. Instead of installing hooks in each project's .claude/ directory, the hooks are now installed once in the user's home directory, eliminating the need for per-project gitignore handling and ensuring hooks work consistently across all projects.
Changes:
- Moved Claude hook scripts to
~/.config/mergify-cli/claude-hooks/ - Moved Claude settings to
~/.claude/settings.json(global) - Changed
_install_claude_hooks()from async to sync function - Removed
claude_hooks/settings.jsonfile (settings now constructed in code)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| mergify_cli/stack/setup.py | Refactored Claude hooks installation to use global paths; added helper functions for paths; updated import from importlib.metadata to importlib.resources; removed per-project logic |
| mergify_cli/stack/claude_hooks/settings.json | Removed settings template file as configuration is now built dynamically in code with absolute paths |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move Claude hooks from per-project to global installation: - Scripts: ~/.config/mergify-cli/claude-hooks/ - Settings: ~/.claude/settings.json This eliminates the need for per-project gitignore handling and ensures hooks work across all projects automatically. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Change-Id: I3c458313822df489627119561bcc84572c5e9873 Claude-Session-Id: 5f1a97a3-70f4-4099-8edf-810289af8151
54ab5d6 to
ca34ab5
Compare
Merge Queue Status✅ The pull request has been merged at ca34ab5 This pull request spent 5 seconds in the queue, with no time running CI. Required conditions to merge
|
Move Claude hooks from per-project to global installation:
This eliminates the need for per-project gitignore handling
and ensures hooks work across all projects automatically.
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com