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 -2
View File
@@ -1,11 +1,11 @@
const fs = require('fs');
const path = require('path');
const os = require('os');
const { getClaudeDir } = require('./ponytail-config');
const isCodex = Boolean(process.env.PLUGIN_DATA);
const statePath = isCodex
? path.join(process.env.PLUGIN_DATA, '.ponytail-active')
: path.join(os.homedir(), '.claude', '.ponytail-active');
: path.join(getClaudeDir(), '.ponytail-active');
function setMode(mode) {
fs.mkdirSync(path.dirname(statePath), { recursive: true });