From 9394efc8655e20a9553e4a36653d439f3bf069e5 Mon Sep 17 00:00:00 2001 From: andrefogelman <31588051+andrefogelman@users.noreply.github.com> Date: Sat, 11 Jul 2026 11:14:44 +0000 Subject: [PATCH] fix(settings-hook): respect CLAUDE_CONFIG_DIR when resolving settings.json Claude Code supports alternate profile directories via the CLAUDE_CONFIG_DIR environment variable, but gstack-settings-hook hardcoded $HOME/.claude/settings.json as its default target. On machines where sessions run with CLAUDE_CONFIG_DIR set (e.g. isolated agent profiles), hooks registered by setup --plan-tune-hooks landed in the wrong profile's settings.json and never executed. Fall back to CLAUDE_CONFIG_DIR before $HOME/.claude. Behavior is unchanged when the variable is unset, and the explicit GSTACK_SETTINGS_FILE override still takes precedence. Co-Authored-By: Claude Fable 5 --- bin/gstack-settings-hook | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/gstack-settings-hook b/bin/gstack-settings-hook index 6d663b23f7..d5404c05d7 100755 --- a/bin/gstack-settings-hook +++ b/bin/gstack-settings-hook @@ -26,7 +26,7 @@ set -euo pipefail ACTION="${1:-}" -SETTINGS_FILE="${GSTACK_SETTINGS_FILE:-$HOME/.claude/settings.json}" +SETTINGS_FILE="${GSTACK_SETTINGS_FILE:-${CLAUDE_CONFIG_DIR:-$HOME/.claude}/settings.json}" if [ -z "$ACTION" ]; then cat <&2