fix: hookify Python 3.8 compat and cwd-independent rule loading #23972
+6
−1
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
Two fixes for the hookify plugin in
config_loader.py:from __future__ import annotationsto fixTypeError: 'type' object is not subscriptableon Python 3.8 (Ubuntu 20.04 default). Thetuple[Dict, str]return type syntax requires Python 3.9+; the future import enables it on 3.7+.CLAUDE_PROJECT_DIRenv var instead of relative path for.claude/hookify.*.local.mddiscovery. Previously, rules were only found when the cwd happened to be the project root; now they're found from any working directory.Test plan
TypeErrorCLAUDE_PROJECT_DIRis set (standard Claude Code behavior)os.getcwd()whenCLAUDE_PROJECT_DIRis unsetFixes #14588
Fixes #20749
🤖 Generated with Claude Code