diff --git a/plugins/glean-core/scripts/session-start.sh b/plugins/glean-core/scripts/session-start.sh index 026e085..967b0c7 100755 --- a/plugins/glean-core/scripts/session-start.sh +++ b/plugins/glean-core/scripts/session-start.sh @@ -26,8 +26,11 @@ output_json() { printf '{\n "systemMessage": "%s"\n}\n' "$escaped" } -# Check if any Glean MCP servers are configured -if node -e "const c=require('$HOME/.claude.json'); process.exit(Object.keys(c.mcpServers||{}).some(k=>k.toLowerCase().includes('glean'))?0:1)" 2>/dev/null; then +# Check if any Glean MCP servers are configured. +# Resolve the home directory inside Node via os.homedir() so this works on +# Windows, where $HOME under Git Bash expands to a Unix-style path +# (e.g. /c/Users/foo) that Node on Windows cannot require(). +if node -e "const os=require('os'),p=require('path');const c=require(p.join(os.homedir(),'.claude.json'));process.exit(Object.keys(c.mcpServers||{}).some(k=>k.toLowerCase().includes('glean'))?0:1)" 2>/dev/null; then exit 0 else output_json "$TEMPLATES_DIR/session-unconfigured.txt"