diff --git a/hooks/ponytail-activate.js b/hooks/ponytail-activate.js index b44251d..fb9ad96 100644 --- a/hooks/ponytail-activate.js +++ b/hooks/ponytail-activate.js @@ -2,7 +2,7 @@ // ponytail — Claude Code SessionStart activation hook // // Runs on every session start: -// 1. Writes flag file at ~/.claude/.ponytail-active (statusline reads this) +// 1. Writes flag file at $CLAUDE_CONFIG_DIR/.ponytail-active (defaults to ~/.claude; statusline reads this) // 2. Emits ponytail ruleset as hidden SessionStart context // 3. Detects missing statusline config and emits setup nudge diff --git a/hooks/ponytail-statusline.ps1 b/hooks/ponytail-statusline.ps1 index d9fe437..2caac54 100644 --- a/hooks/ponytail-statusline.ps1 +++ b/hooks/ponytail-statusline.ps1 @@ -1,4 +1,6 @@ -$Flag = Join-Path $HOME ".claude/.ponytail-active" +# CLAUDE_CONFIG_DIR overrides ~/.claude, matching where the hooks write the flag (issue #34) +$ClaudeDir = if ($env:CLAUDE_CONFIG_DIR) { $env:CLAUDE_CONFIG_DIR } else { Join-Path $HOME ".claude" } +$Flag = Join-Path $ClaudeDir ".ponytail-active" if (-not (Test-Path $Flag)) { exit 0 } diff --git a/hooks/ponytail-statusline.sh b/hooks/ponytail-statusline.sh index 5e83a27..95f75c7 100644 --- a/hooks/ponytail-statusline.sh +++ b/hooks/ponytail-statusline.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -flag="$HOME/.claude/.ponytail-active" +# CLAUDE_CONFIG_DIR overrides ~/.claude, matching where the hooks write the flag (issue #34) +flag="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.ponytail-active" [ -f "$flag" ] || exit 0 mode=$(head -n1 "$flag" | tr -d '[:space:]')