fix: honor CLAUDE_CONFIG_DIR in hooks (#37)

ponytail-activate.js and ponytail-runtime.js hardcoded ~/.claude for the
flag file and settings lookup, ignoring CLAUDE_CONFIG_DIR. Add a shared
getClaudeDir() to ponytail-config.js and use it in both. Regression test
added to hooks.test.js.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
DietrichGebert
2026-06-15 00:00:01 +02:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 6d990f8c54
commit 01578c0cd4
4 changed files with 35 additions and 5 deletions
+2 -3
View File
@@ -8,8 +8,7 @@
const fs = require('fs');
const path = require('path');
const os = require('os');
const { getDefaultMode } = require('./ponytail-config');
const { getDefaultMode, getClaudeDir } = require('./ponytail-config');
const { getPonytailInstructions } = require('./ponytail-instructions');
const {
clearMode,
@@ -18,7 +17,7 @@ const {
writeHookOutput,
} = require('./ponytail-runtime');
const claudeDir = path.join(os.homedir(), '.claude');
const claudeDir = getClaudeDir();
const settingsPath = path.join(claudeDir, 'settings.json');
const mode = getDefaultMode();