fix: respect CLAUDE_CONFIG_DIR env var across all hooks#146
Merged
JuliusBrussee merged 1 commit intoJuliusBrussee:mainfrom Apr 15, 2026
Merged
Conversation
All hook files hardcoded ~/.claude as the Claude config directory. Users who set CLAUDE_CONFIG_DIR (e.g. for XDG compliance) had hooks writing to the wrong location. Now all hooks check CLAUDE_CONFIG_DIR first, falling back to ~/.claude. Closes JuliusBrussee#140
stevenossa21
approved these changes
Apr 14, 2026
|
Thanks for this work, this is a key feature to me |
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
~/.claudeas the Claude config directoryCLAUDE_CONFIG_DIR(e.g. for XDG compliance) had hooks reading/writing to the wrong locationCLAUDE_CONFIG_DIRfirst, falling back to~/.claudeFiles changed
hooks/caveman-activate.js— use env var + updated comments and statusline nudge pathhooks/caveman-mode-tracker.js— use env var for flag file pathhooks/caveman-statusline.sh—${CLAUDE_CONFIG_DIR:-$HOME/.claude}hooks/caveman-statusline.ps1—$env:CLAUDE_CONFIG_DIRwith fallbackhooks/install.sh/install.ps1— use env var for install target dirhooks/uninstall.sh/uninstall.ps1— use env var for uninstall target dirTest plan
CLAUDE_CONFIG_DIRto a custom path, runinstall.sh— hooks install to custom dirCLAUDE_CONFIG_DIR, runinstall.sh— hooks install to~/.claude(default behavior unchanged)CLAUDE_CONFIG_DIRset — flag file written to correct locationCloses #140