fix(hooks): respect CLAUDE_CONFIG_DIR for custom config directories
Hooks hardcode ~/.claude/ as the config directory, breaking setups where Claude Code uses a custom config directory (e.g. multi-account with CLAUDE_CONFIG_DIR=~/.claude-personal/). The update check hook shows stale notifications and the statusline reads from wrong paths. - gsd-check-update.js: check CLAUDE_CONFIG_DIR before filesystem scan - gsd-statusline.js: use CLAUDE_CONFIG_DIR for todos and cache paths Closes #870 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
Lex Christopherson
parent
7554503b42
commit
90e7d30839
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user