Fix hook commands breaking on Homebrew/uv upgrades#21
Merged
Conversation
Use stable `gw` entry point instead of versioned Python interpreter path in Claude Code hooks. The old approach hardcoded sys.executable (e.g. Cellar/grove/0.12.0/...) which broke when upgrading versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix fallback module path from grove.cli to grove.dash (has __main__.py) - Move shutil import to module level in cli.py - Extract "gw _hook" magic string to _GROVE_HOOK_CMD constant Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users will uninstall+reinstall hooks when upgrading, so no need to detect the old python-path format. Single _GROVE_MARKER is enough. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without this, `gw dash uninstall` after upgrading would leave orphaned old hooks (grove.dash format) in settings.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sys.executable(versioned Python path likeCellar/grove/0.12.0/...) which broke after Homebrew/uv upgradesgwentry point viashutil.which("gw"), which resolves to the Homebrew symlink that survives version changesgw _hook --event XCLI command as the new hook entry pointgw dash install(detects both oldgrove.dashand newgw _hookformats)Test plan
gw dash installon fresh install writesgw _hookcommandsgw dash installon existing install replaces old python-path hooksgw dash uninstallremoves both old and new format hooksbrew upgrade grove🤖 Generated with Claude Code