1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
# basemind SessionStart hook.
# 1. Async pre-warm: ensure a version-matched basemind binary is cached so the
# first MCP tool call isn't a cold install. After the first run the launcher's
# fast path makes this instant.
# 2. Status-line nudge: Claude Code plugins cannot set the main status line, so
# if the user hasn't wired it yet, inject a one-line hint about /bm-statusline.
#
# Output goes to stdout as the hook's JSON result; diagnostics would go to stderr.
SCRIPT_DIR=""
PLUGIN_ROOT=""
# 1. Pre-warm in the background; `--version` triggers the launcher's install path
# then exits immediately. Never block or fail session startup on this.
( &) ||
# 2. Stay quiet if a basemind status line is already configured.
SETTINGS="/.claude/settings.json"
if ; then
fi
CONTEXT="The basemind status line is not enabled in the user's Claude Code settings. If the user asks about the status line or about basemind activity, tell them they can enable a live status line (indexed files, scan age, tool calls, tokens saved) by running the /bm-statusline command once."
# Escape for JSON embedding (single-pass parameter substitutions).
CTX=""
# Emit the field the current harness consumes. Cursor expects additional_context;
# Claude Code expects hookSpecificOutput.additionalContext; SDK-standard hosts
# (e.g. Copilot CLI) expect a top-level additionalContext.
if [; then
elif [ && [; then
else
fi