Skip to content

Honor CLAUDE_CONFIG_DIR in hook paths and runtime - #1941

Closed
MarnuLombard wants to merge 1 commit into
danielmiessler:mainfrom
MarnuLombard:fix/hooks-honor-claude-config-dir
Closed

Honor CLAUDE_CONFIG_DIR in hook paths and runtime#1941
MarnuLombard wants to merge 1 commit into
danielmiessler:mainfrom
MarnuLombard:fix/hooks-honor-claude-config-dir

Conversation

@MarnuLombard

Copy link
Copy Markdown

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 the SessionStart MergeSettings hook rewrites the global ~/.claude/settings.json from inside the relocated install.

This roots the hook commands at ${CLAUDE_CONFIG_DIR:-$HOME/.claude} and makes getClaudeDir() honor CLAUDE_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_DIR unset both paths fall back to ~/.claude.


  • 05a1e86 fix: honor CLAUDE_CONFIG_DIR in hook paths and runtime
    • hooks.json commands rooted at ${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.

- 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
MarnuLombard force-pushed the fix/hooks-honor-claude-config-dir branch from 05a1e86 to 08d463a Compare August 22, 2026 09:30
@MarnuLombard

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant