Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions plugins/glean-core/scripts/session-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down