Honor CLAUDE_CONFIG_DIR in hook paths and runtime - #1941
Closed
MarnuLombard wants to merge 1 commit into
Closed
Conversation
- hooks.json commands were pinned to $HOME/.claude, so a relocated install ran hooks from global ~/.claude, not its own config root. - getClaudeDir() ignored CLAUDE_CONFIG_DIR that every other module honors, so hook scripts resolved settings/skills/memory to ~/.claude at runtime.
MarnuLombard
force-pushed
the
fix/hooks-honor-claude-config-dir
branch
from
August 22, 2026 09:30
05a1e86 to
08d463a
Compare
Author
|
Closing to prepare a more complete change: route every hook and tool through CLAUDE_CONFIG_DIR/paths.ts, fix the settings-merge dedup on upgrade, deploy settings.system.json into the relocated root, and have the launcher export CLAUDE_CONFIG_DIR - so the install can fully live inside a given config root, not just the 9 hooks that already import paths.ts. |
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.
Installing under a relocated config root (
--config-root/CLAUDE_CONFIG_DIR, e.g. a project-scoped.claude) copies the hook scripts into that root but still wires them to$HOME/.claude.The result: every hook resolves to the global
~/.claude, which holds none of the copied scripts, and theSessionStartMergeSettings hook rewrites the global~/.claude/settings.jsonfrom inside the relocated install.This roots the hook commands at
${CLAUDE_CONFIG_DIR:-$HOME/.claude}and makesgetClaudeDir()honorCLAUDE_CONFIG_DIR, the same relocation every install tool and runtime module (Doctor.ts, PULSE Conduit) already respects.Default installs are byte-identical: with
CLAUDE_CONFIG_DIRunset both paths fall back to~/.claude.${CLAUDE_CONFIG_DIR:-$HOME/.claude}so a relocated install runs its own hooks.getClaudeDir()/getLifeosDir()resolve settings, skills, and memory under the same config root at runtime.