diff --git a/hooks/gsd-check-update.js b/hooks/gsd-check-update.js index c5bb67034..b9a6075ed 100755 --- a/hooks/gsd-check-update.js +++ b/hooks/gsd-check-update.js @@ -11,13 +11,19 @@ const homeDir = os.homedir(); const cwd = process.cwd(); // Detect runtime config directory (supports Claude, OpenCode, Gemini) +// Respects CLAUDE_CONFIG_DIR for custom config directory setups function detectConfigDir(baseDir) { + // Check env override first (supports multi-account setups) + const envDir = process.env.CLAUDE_CONFIG_DIR; + if (envDir && fs.existsSync(path.join(envDir, 'get-shit-done', 'VERSION'))) { + return envDir; + } for (const dir of ['.config/opencode', '.opencode', '.gemini', '.claude']) { if (fs.existsSync(path.join(baseDir, dir, 'get-shit-done', 'VERSION'))) { return path.join(baseDir, dir); } } - return path.join(baseDir, '.claude'); + return envDir || path.join(baseDir, '.claude'); } const globalConfigDir = detectConfigDir(homeDir); diff --git a/hooks/gsd-statusline.js b/hooks/gsd-statusline.js index 9d3fb5b59..d88ca4a2c 100755 --- a/hooks/gsd-statusline.js +++ b/hooks/gsd-statusline.js @@ -68,7 +68,9 @@ process.stdin.on('end', () => { // Current task from todos let task = ''; const homeDir = os.homedir(); - const todosDir = path.join(homeDir, '.claude', 'todos'); + // Respect CLAUDE_CONFIG_DIR for custom config directory setups (#870) + const claudeDir = process.env.CLAUDE_CONFIG_DIR || path.join(homeDir, '.claude'); + const todosDir = path.join(claudeDir, 'todos'); if (session && fs.existsSync(todosDir)) { try { const files = fs.readdirSync(todosDir) @@ -90,7 +92,7 @@ process.stdin.on('end', () => { // GSD update available? let gsdUpdate = ''; - const cacheFile = path.join(homeDir, '.claude', 'cache', 'gsd-update-check.json'); + const cacheFile = path.join(claudeDir, 'cache', 'gsd-update-check.json'); if (fs.existsSync(cacheFile)) { try { const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));